|
@@ -289,7 +289,7 @@ module.exports = {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- getT: function(url, data, header) {
|
|
|
|
|
|
|
+ getT: function(url, data, header, timeout, hideToast) {
|
|
|
header = header || "application/x-www-form-urlencoded";
|
|
header = header || "application/x-www-form-urlencoded";
|
|
|
return ensureDomainReady().then(() => {
|
|
return ensureDomainReady().then(() => {
|
|
|
const host = this.config('APIHOST1')
|
|
const host = this.config('APIHOST1')
|
|
@@ -305,6 +305,7 @@ module.exports = {
|
|
|
"content-type": header,
|
|
"content-type": header,
|
|
|
"token": token
|
|
"token": token
|
|
|
},
|
|
},
|
|
|
|
|
+ timeout: timeout ? timeout : 60000,
|
|
|
success: function(result) {
|
|
success: function(result) {
|
|
|
if (result.data.code == 401) {
|
|
if (result.data.code == 401) {
|
|
|
uni.removeStorageSync("token")
|
|
uni.removeStorageSync("token")
|
|
@@ -321,7 +322,7 @@ module.exports = {
|
|
|
title: '请先登录,以便更好使用!',
|
|
title: '请先登录,以便更好使用!',
|
|
|
icon: 'none'
|
|
icon: 'none'
|
|
|
})
|
|
})
|
|
|
- } else if (result.data.code != 0 && result.data.msg != '未进入公司') {
|
|
|
|
|
|
|
+ } else if (result.data.code != 0 && result.data.msg != '未进入公司' && !hideToast) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: result.data.msg || '查询失败',
|
|
title: result.data.msg || '查询失败',
|
|
|
icon: 'none'
|
|
icon: 'none'
|