perf(projects): perf code
This commit is contained in:
parent
b235ef3bc0
commit
7fa87f53d1
14
.vscode/extensions.json
vendored
14
.vscode/extensions.json
vendored
@ -1,17 +1,23 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
|
"afzalsayed96.icones",
|
||||||
|
"antfu.iconify",
|
||||||
"antfu.unocss",
|
"antfu.unocss",
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"editorconfig.editorconfig",
|
"editorconfig.editorconfig",
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"formulahendry.auto-complete-tag",
|
|
||||||
"formulahendry.auto-close-tag",
|
"formulahendry.auto-close-tag",
|
||||||
|
"formulahendry.auto-complete-tag",
|
||||||
"formulahendry.auto-rename-tag",
|
"formulahendry.auto-rename-tag",
|
||||||
"kisstkondoros.vscode-gutter-preview",
|
"lokalise.i18n-ally",
|
||||||
"mariusalchimavicius.json-to-ts",
|
|
||||||
"mhutchie.git-graph",
|
"mhutchie.git-graph",
|
||||||
|
"mikestead.dotenv",
|
||||||
|
"naumovs.color-highlight",
|
||||||
|
"pkief.material-icon-theme",
|
||||||
"sdras.vue-vscode-snippets",
|
"sdras.vue-vscode-snippets",
|
||||||
"vue.volar",
|
"vue.volar",
|
||||||
"vue.vscode-typescript-vue-plugin"
|
"vue.vscode-typescript-vue-plugin",
|
||||||
|
"whtouche.vscode-js-console-utils",
|
||||||
|
"zhuangtongfa.material-theme"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ export interface RequestOption<ResponseData = any> {
|
|||||||
*
|
*
|
||||||
* @param response Axios response
|
* @param response Axios response
|
||||||
* @param instance Axios instance
|
* @param instance Axios instance
|
||||||
* @returns
|
|
||||||
*/
|
*/
|
||||||
onBackendFail: (
|
onBackendFail: (
|
||||||
response: AxiosResponse<ResponseData>,
|
response: AxiosResponse<ResponseData>,
|
||||||
|
@ -31,7 +31,7 @@ export const request = createFlatRequest<App.Service.Response>(
|
|||||||
},
|
},
|
||||||
async onBackendFail(_response) {
|
async onBackendFail(_response) {
|
||||||
// when the backend response code is not "0000", it means the request is fail
|
// when the backend response code is not "0000", it means the request is fail
|
||||||
// for example: the token is expired, refetch token and retry request
|
// for example: the token is expired, refresh token and retry request
|
||||||
},
|
},
|
||||||
transformBackendResponse(response) {
|
transformBackendResponse(response) {
|
||||||
return response.data.data;
|
return response.data.data;
|
||||||
@ -73,7 +73,7 @@ export const demoRequest = createRequest<App.Service.DemoResponse>(
|
|||||||
},
|
},
|
||||||
async onBackendFail(_response) {
|
async onBackendFail(_response) {
|
||||||
// when the backend response code is not "200", it means the request is fail
|
// when the backend response code is not "200", it means the request is fail
|
||||||
// for example: the token is expired, refetch token and retry request
|
// for example: the token is expired, refresh token and retry request
|
||||||
},
|
},
|
||||||
transformBackendResponse(response) {
|
transformBackendResponse(response) {
|
||||||
return response.data.result;
|
return response.data.result;
|
||||||
|
Loading…
Reference in New Issue
Block a user