|
@@ -4,7 +4,9 @@ const request = axios.create({
|
|
|
//"/prod-api" : "/dev-api"
|
|
|
});
|
|
|
request.interceptors.request.use(config => {
|
|
|
- const token = window.localStorage.getItem("token") || ""
|
|
|
+ const token =window.localStorage.getItem("token") || ""
|
|
|
+ console.log(token)
|
|
|
+ console.log(config)
|
|
|
if (config.headers.isToken === "0") {
|
|
|
config.headers["Authorization"] = ""
|
|
|
}
|
|
@@ -27,28 +29,27 @@ request.interceptors.response.use((res) => {
|
|
|
break;
|
|
|
case 401:
|
|
|
// Toast("登录失败,需要再次登录")
|
|
|
- window.setTimeout(() => {
|
|
|
-
|
|
|
- switch (process.env.NODE_ENV) {
|
|
|
- case "development":
|
|
|
- window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx457ba48e0801c0b6&redirect_uri=https://nbjk1-h5.zzxcx.net/&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`)
|
|
|
- break;
|
|
|
- case "test":
|
|
|
- window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx457ba48e0801c0b6&redirect_uri=https://nbjk1-h5.zzxcx.net/&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`)
|
|
|
- break;
|
|
|
- case "production":
|
|
|
- window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx457ba48e0801c0b6&redirect_uri=https://nbjk-h5.zzxcx.net/&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }, 2000)
|
|
|
-
|
|
|
+ // window.setTimeout(() => {
|
|
|
+
|
|
|
+ // switch (process.env.NODE_ENV) {
|
|
|
+ // case "development":
|
|
|
+ // window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx457ba48e0801c0b6&redirect_uri=https://nbjk1-h5.zzxcx.net/&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`)
|
|
|
+ // break;
|
|
|
+ // case "test":
|
|
|
+ // window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx457ba48e0801c0b6&redirect_uri=https://nbjk1-h5.zzxcx.net/&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`)
|
|
|
+ // break;
|
|
|
+ // case "production":
|
|
|
+ // window.location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx457ba48e0801c0b6&redirect_uri=https://nbjk-h5.zzxcx.net/&response_type=code&scope=snsapi_userinfo&state=LOGIN#wechat_redirect`);
|
|
|
+ // break;
|
|
|
+ // default:
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }, 2000)
|
|
|
break;
|
|
|
case 502:
|
|
|
console.log('进入502')
|
|
|
if (res.data.msg === "微信授权无效,请重新授权") {
|
|
|
- window.location.replace("https://coach.zzxcx.net/")
|
|
|
+ window.location.replace("https://nbjk-h5.zzxcx.net/")
|
|
|
return
|
|
|
}
|
|
|
|