|
|
|
|
@ -12,10 +12,13 @@ const handleResponse = async ({ config: requestConfig, data, status }) => {
|
|
|
|
|
if (requestConfig.headers.download === true) {
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
let code = data.code || status;
|
|
|
|
|
console.info('[api]', code, requestConfig.method, requestConfig.url, data.data);
|
|
|
|
|
let code = data?.code || status;
|
|
|
|
|
console.info('[api]', code, requestConfig.method, requestConfig.url, data?.data);
|
|
|
|
|
if (code !== 'SUCCESS') {
|
|
|
|
|
ElMessage.error(data.message || '服务器异常');
|
|
|
|
|
ElMessage.error(data?.message || '服务器异常');
|
|
|
|
|
if (data) {
|
|
|
|
|
data.data = null;
|
|
|
|
|
}
|
|
|
|
|
switch (code) {
|
|
|
|
|
case 'SYSTEM_ERROR': //系统异常
|
|
|
|
|
case 'INTERFACE_SYSTEM_ERROR': // 外部接口调用异常
|
|
|
|
|
|