|
@@ -74,7 +74,6 @@ function request(url, options, additional) {
|
|
|
|
|
|
// 加载中提示打开/关闭
|
|
|
function openCloseLoading(additional, isOpen) {
|
|
|
- console.log({additional, isOpen});
|
|
|
if (additional.needLoading) {
|
|
|
if (isOpen) { // 打开(如果已经打开不必重复打开)
|
|
|
if (AllRequestNum === 0)
|
|
@@ -97,20 +96,20 @@ function LoginExpired(msg) {
|
|
|
AllRequestNum = 0;
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
- content:msg,
|
|
|
- showCancel:false,
|
|
|
+ content: '登录过期,请重新登录!',
|
|
|
success: function (_res) {
|
|
|
if (_res.confirm) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/login/login'
|
|
|
- });
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ });
|
|
|
+ } else if (_res.cancel) {
|
|
|
+ console.log('用户点击取消');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function notifyException(resArr, additional) {
|
|
|
-console.log('openCloseLoading');
|
|
|
openCloseLoading(additional, false);
|
|
|
const [error, res] = resArr;
|
|
|
if (error) {
|
|
@@ -123,21 +122,8 @@ console.log('openCloseLoading');
|
|
|
return false;
|
|
|
} else if (res.data.code !== 'SUCCESS') {
|
|
|
const { code, msg } = res.data;
|
|
|
- console.log('res.data',res.data);
|
|
|
- if (code === '410' || code === '401') {
|
|
|
+ if (code === '410' || code === '401'||code === '403') {
|
|
|
LoginExpired(msg);
|
|
|
- } else if (code === '403') {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '登录过期,请重新登录!',
|
|
|
- success: function (_res) {
|
|
|
- if (_res.confirm) {
|
|
|
- LoginExpired();
|
|
|
- } else if (_res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
} else {
|
|
|
uni.showModal({
|
|
|
title: '错误提示',
|