微信小程序 302 错误码

代码片段

wx.request({
          
   
          url: ****,
          data: data,
          method: "GET",
          success: (result) => {
          
   
            console.log(result)
            wx.setStorage("user_result",result)
          },
        })

错误展示

错误原因

请求一直被shiro拦截重定向 302 由于项目里面shiroConfig使用的是hashMap 调用时是无序插入到setFilterChainDefinitionMap 为路径设置anon可能会在authc之后,所以失效就会跳转302 重定向到定义的登入url

解决办法

把shiroConfig里的hashMap替换成LinkedHashMap

经验分享 程序员 微信小程序 职场和发展