flat: 初始化

This commit is contained in:
史典卓
2024-11-19 16:16:30 +08:00
parent f1acec18f1
commit 47a8edcf60
7 changed files with 74 additions and 65 deletions

View File

@@ -29,6 +29,7 @@ export const errorConfig: RequestConfig = {
errorConfig: {
// 错误抛出
errorThrower: (res) => {
console.log('errorThrower')
const { success, data, errorCode, errorMessage, showType } =
res as unknown as ResponseStructure;
if (!success) {
@@ -99,7 +100,6 @@ export const errorConfig: RequestConfig = {
(response) => {
// 拦截响应数据,进行个性化处理
const { data } = response as unknown as ResponseStructure;
console.log(data)
if (data?.success === false) {
message.error('请求失败!');
}