|
@@ -25,7 +25,7 @@ export default createAlova({
|
|
if ( result.success === true || result.code === 200 ) result.code = 0;
|
|
if ( result.success === true || result.code === 200 ) result.code = 0;
|
|
const { success = false, code = success ? 0 : -1, data, msg: message = '未知错误', ...props } = result;
|
|
const { success = false, code = success ? 0 : -1, data, msg: message = '未知错误', ...props } = result;
|
|
if ( code === 0 ) { return data; } else {}
|
|
if ( code === 0 ) { return data; } else {}
|
|
- throw { ...props, message: `${ message }(${ code })` };
|
|
|
|
|
|
+ throw { ...props, message: `${ message }` };
|
|
} catch ( e: any ) {
|
|
} catch ( e: any ) {
|
|
if ( !method.meta?.ignoreException ) {
|
|
if ( !method.meta?.ignoreException ) {
|
|
const { Notify } = await import('@/platform/notify.ui');
|
|
const { Notify } = await import('@/platform/notify.ui');
|
|
@@ -37,7 +37,7 @@ export default createAlova({
|
|
async onError(error, method) {
|
|
async onError(error, method) {
|
|
if ( !method.meta?.ignoreException && error.name !== 'AbortError' ) {
|
|
if ( !method.meta?.ignoreException && error.name !== 'AbortError' ) {
|
|
const { Notify } = await import('@/platform/notify.ui');
|
|
const { Notify } = await import('@/platform/notify.ui');
|
|
- Notify.error(`${ error.message }(${ error?.code })`);
|
|
|
|
|
|
+ Notify.error(`${ error.message }`);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onComplete() {},
|
|
onComplete() {},
|