| | |
| | | } |
| | | if (accessToken) { |
| | | config.header['Blade-Auth'] = 'bearer ' + accessToken; |
| | | config.header['roleName'] = uni.getStorageSync("activeRole").roleAlias || ""; |
| | | config.header['communityCode'] = uni.getStorageSync("siteInfo").id || "" |
| | | } |
| | | if (config.params.tenantId) { |
| | | config.header['Tenant-Id'] = config.params.tenantId; |
| | |
| | | // }) |
| | | |
| | | http.interceptors.response.use((response) => { |
| | | |
| | | |
| | | // 若有数据返回则通过 |
| | | if (response.data.access_token || response.data.key) { |
| | | return response.data |
| | |
| | | }); |
| | | return Promise.reject(response); |
| | | } |
| | | }else { |
| | | if(response.data.error_code !== 200){ |
| | | } else { |
| | | if (response.data.error_code !== 200) { |
| | | uni.showToast({ |
| | | title: response.data.msg, |
| | | icon: 'none' |
| | |
| | | const currentPage = pages[pages.length - 1] |
| | | uni.setStorageSync("responIndex", 0) |
| | | uni.clearStorageSync() |
| | | // uni.redirectTo({ |
| | | // url: `/pages/login/login-account?redirect=/${currentPage.route}` |
| | | // }) |
| | | |
| | | |
| | | // uni.redirectTo({ |
| | | // url: `/pages/login/login-account?redirect=/${currentPage.route}` |
| | | // }) |
| | | |
| | | |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "请登录", |
| | | showCancel: false, |
| | | // showCancel: false, |
| | | success: res => { |
| | | if (res.confirm) { |
| | | uni.redirectTo({ |
| | |
| | | } |
| | | } |
| | | }) |
| | | }else { |
| | | } else { |
| | | uni.showToast({ |
| | | title: '系统繁忙,请稍后再试', |
| | | icon: 'none' |