修改测试bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { AxiosRequestConfig, Method } from 'axios'
|
||||
import axios from 'axios'
|
||||
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
||||
import { ElLoading,ElMessage, ElNotification, type LoadingOptions } from 'element-plus'
|
||||
import { refreshToken } from '@/api/user-boot/user'
|
||||
import router from '@/router/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
@@ -150,10 +150,11 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
||||
return Promise.reject(response.data)
|
||||
} else {
|
||||
if (options.showCodeMessage) {
|
||||
ElNotification({
|
||||
type: 'error',
|
||||
message: response.data.message || '未知错误'
|
||||
})
|
||||
// ElNotification({
|
||||
// type: 'error',
|
||||
// message: response.data.message || '未知错误'
|
||||
// })
|
||||
ElMessage.error(response.data.message || '未知错误')
|
||||
}
|
||||
return Promise.reject(response.data)
|
||||
}
|
||||
@@ -241,7 +242,7 @@ export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean
|
||||
}
|
||||
// 适配器, 用于适配不同的请求方式
|
||||
export function baseRequest(url, value = {}, method = 'post', options = {}) {
|
||||
url = sysConfig.API_URL + url
|
||||
url = sysConfig?.API_URL + url
|
||||
if (method === 'post') {
|
||||
return service.post(url, value, options)
|
||||
} else if (method === 'get') {
|
||||
|
||||
Reference in New Issue
Block a user