mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2026-01-23 16:10:21 +08:00
style: lint
This commit is contained in:
@@ -13,7 +13,8 @@ let isConfirming = false
|
||||
export function resolveResError(code, message) {
|
||||
switch (code) {
|
||||
case 401:
|
||||
if (isConfirming) return
|
||||
if (isConfirming)
|
||||
return
|
||||
isConfirming = true
|
||||
$dialog.confirm({
|
||||
title: '提示',
|
||||
@@ -31,7 +32,8 @@ export function resolveResError(code, message) {
|
||||
return false
|
||||
case 11007:
|
||||
case 11008:
|
||||
if (isConfirming) return
|
||||
if (isConfirming)
|
||||
return
|
||||
isConfirming = true
|
||||
$dialog.confirm({
|
||||
title: '提示',
|
||||
|
||||
@@ -20,7 +20,7 @@ export function setupInterceptors(axiosInstance) {
|
||||
const { accessToken } = useAuthStore()
|
||||
if (accessToken) {
|
||||
// token: Bearer + xxx
|
||||
config.headers.Authorization = 'Bearer ' + accessToken
|
||||
config.headers.Authorization = `Bearer ${accessToken}`
|
||||
}
|
||||
|
||||
return config
|
||||
@@ -42,7 +42,7 @@ export function setupInterceptors(axiosInstance) {
|
||||
// 根据code处理对应的操作,并返回处理后的message
|
||||
const message = resolveResError(code, data?.message ?? statusText)
|
||||
|
||||
//需要错误提醒
|
||||
// 需要错误提醒
|
||||
!config?.noNeedTip && message && window.$message?.error(message)
|
||||
return Promise.reject({ code, message, error: data ?? response })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user