|
@@ -48,24 +48,47 @@ http.interceptor.request((config, cancel) => {
|
|
|
|
|
|
// 响应拦截器
|
|
// 响应拦截器
|
|
http.interceptor.response(response => {
|
|
http.interceptor.response(response => {
|
|
|
|
+ uni.setStorageSync(
|
|
|
|
+ "judgeFlage",
|
|
|
|
+ false
|
|
|
|
+ );
|
|
if (response.data.code == '11011' || response.data.code == '11012') {
|
|
if (response.data.code == '11011' || response.data.code == '11012') {
|
|
- uni.showModal({
|
|
|
|
- content: "登录过期,请重新登录",
|
|
|
|
- complete: (res) => {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- uni.reLaunch({
|
|
|
|
- url: "/pagesA/loginNew/loginNew"
|
|
|
|
- })
|
|
|
|
|
|
+ uni.setStorageSync(
|
|
|
|
+ "judgeFlage",
|
|
|
|
+ false
|
|
|
|
+ );
|
|
|
|
+ let judgeFlage = uni.getStorageSync(
|
|
|
|
+ "judgeFlage"
|
|
|
|
+ )
|
|
|
|
+ if (!judgeFlage) {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ content: "登录过期,请重新登录",
|
|
|
|
+ complete: (res) => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.setStorageSync(
|
|
|
|
+ "judgeFlage",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url: "/pagesA/loginNew/loginNew"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (res.cancel) {
|
|
|
|
+ uni.setStorageSync(
|
|
|
|
+ "judgeFlage",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url: "/pagesA/loginNew/loginNew"
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
return
|
|
return
|
|
- }
|
|
|
|
- if (res.cancel) {
|
|
|
|
- uni.reLaunch({
|
|
|
|
- url: "/pagesA/loginNew/loginNew"
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
console.log(response, '接口打印了>>>')
|
|
console.log(response, '接口打印了>>>')
|
|
return response; // 正常返回响应
|
|
return response; // 正常返回响应
|