mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-16 13:43:42 +08:00
feat: refactor user page, fix alova response issue
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
"name": "@sa/alova",
|
||||
"version": "0.1.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
".": "./src/index.ts",
|
||||
"./client": "./src/client.ts"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
|
||||
1
packages/alova/src/client.ts
Normal file
1
packages/alova/src/client.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from 'alova/client';
|
||||
@@ -62,7 +62,7 @@ export const createAlovaRequest = (customConfig: CustomAlovaConfig<any>, options
|
||||
!isJSON(resp.headers.get('Content-Type') ?? '') ||
|
||||
(options.isBackendSuccess && (await options.isBackendSuccess(resp)))
|
||||
) {
|
||||
return resp;
|
||||
return options.transformBackendResponse ? await options.transformBackendResponse(resp) : resp;
|
||||
}
|
||||
if (options.onBackendFail) {
|
||||
const fail = await options.onBackendFail(resp);
|
||||
@@ -70,7 +70,6 @@ export const createAlovaRequest = (customConfig: CustomAlovaConfig<any>, options
|
||||
return fail;
|
||||
}
|
||||
}
|
||||
return options.transformBackendResponse ? await options.transformBackendResponse(resp) : resp;
|
||||
}
|
||||
throw new Error(resp.statusText);
|
||||
},
|
||||
@@ -84,3 +83,4 @@ export const createAlovaRequest = (customConfig: CustomAlovaConfig<any>, options
|
||||
|
||||
export { BACKEND_ERROR_CODE, REQUEST_ID_KEY };
|
||||
export type * from './type';
|
||||
export type * from 'alova';
|
||||
|
||||
Reference in New Issue
Block a user