You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
437 B
21 lines
437 B
|
|
export default function checkError(code, res) {
|
|
let result = null
|
|
switch (code) {
|
|
case 401:
|
|
case 202:
|
|
let text = ''
|
|
if (res) {
|
|
text = res && res.data ? res.data.message : '请重新登录'
|
|
}
|
|
break;
|
|
default:
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: res.data ? res.data.message ? res.data.message : res.data.error ? res.data.error :
|
|
'请求失败' : '请求失败'
|
|
})
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|