This commit is contained in:
2024-04-10 14:46:29 +08:00
parent c94ddeed1a
commit 222bae69d9
14 changed files with 304 additions and 213 deletions

View File

@@ -1,8 +1,4 @@
import type {
HttpError,
HttpRequestConfig,
HttpResponse
} from 'uview-plus/libs/luch-request';
import type { HttpError, HttpRequestConfig, HttpResponse } from 'uview-plus/libs/luch-request';
import { showMessage } from './status';
import { getCompanyId, getToken } from '@/utils/auth';
import useUserStore from '@/store/modules/user';
@@ -57,7 +53,7 @@ function responseInterceptors() {
}
// 请求成功则返回结果
if(data.code === 200) {
if(data.code === 200 || data?.retcode == 0) {
return data || {};
}
@@ -87,7 +83,7 @@ function responseInterceptors() {
// 如果没有显式定义custom的toast参数为false的话默认对报错进行toast弹出提示
if(custom?.toast !== false) {
uni.$u.toast(data.message);
uni.$u.toast(data.message || data.retinfo);
}
// 如果需要catch返回则进行reject