!492 解决XTable接口报错时loading不消失等一些问题
Merge pull request !492 from clockdotnet/master-vxepull/497/MERGE
commit
c5fba310a2
|
@ -160,26 +160,42 @@ const getProxyConfig = (options: XTableProps) => {
|
|||
queryParams.pageSize = page.pageSize
|
||||
queryParams.pageNo = page.currentPage
|
||||
}
|
||||
return new Promise(async (resolve) => {
|
||||
resolve(await getListApi(queryParams))
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
resolve(await getListApi(queryParams))
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
})
|
||||
},
|
||||
delete: ({ body }) => {
|
||||
return new Promise(async (resolve) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (options.deleteApi) {
|
||||
resolve(await options.deleteApi(JSON.stringify(body)))
|
||||
try {
|
||||
resolve(await options.deleteApi(JSON.stringify(body)))
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
} else {
|
||||
Promise.reject('未设置deleteApi')
|
||||
reject('未设置deleteApi')
|
||||
}
|
||||
})
|
||||
},
|
||||
queryAll: ({ form }) => {
|
||||
const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form)))
|
||||
return new Promise(async (resolve) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
if (options.getAllListApi) {
|
||||
resolve(await options.getAllListApi(queryParams))
|
||||
try {
|
||||
resolve(await options.getAllListApi(queryParams))
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
} else {
|
||||
resolve(await getListApi(queryParams))
|
||||
try {
|
||||
resolve(await getListApi(queryParams))
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -196,8 +212,12 @@ const getProxyConfig = (options: XTableProps) => {
|
|||
if (options?.params) {
|
||||
queryParams = Object.assign(queryParams, options.params)
|
||||
}
|
||||
return new Promise(async (resolve) => {
|
||||
resolve(await getListApi(queryParams))
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
resolve(await getListApi(queryParams))
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,17 +65,17 @@ const toDocument = () => {
|
|||
</div>
|
||||
<template #dropdown>
|
||||
<ElDropdownMenu>
|
||||
<ElDropdownItem>
|
||||
<ElDropdownItem @click="toProfile">
|
||||
<Icon icon="ep:tools" />
|
||||
<div @click="toProfile">{{ t('common.profile') }}</div>
|
||||
<div>{{ t('common.profile') }}</div>
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem>
|
||||
<ElDropdownItem @click="toDocument">
|
||||
<Icon icon="ep:menu" />
|
||||
<div @click="toDocument">{{ t('common.document') }}</div>
|
||||
<div>{{ t('common.document') }}</div>
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem divided>
|
||||
<ElDropdownItem divided @click="lockScreen">
|
||||
<Icon icon="ep:lock" />
|
||||
<div @click="lockScreen">{{ t('lock.lockScreen') }}</div>
|
||||
<div>{{ t('lock.lockScreen') }}</div>
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem divided @click="loginOut">
|
||||
<Icon icon="ep:switch-button" />
|
||||
|
|
|
@ -53,9 +53,9 @@ async function goLogin() {
|
|||
// 登出后清理
|
||||
deleteUserCache() // 清空用户缓存
|
||||
tagsViewStore.delAllViews()
|
||||
resetRouter() // 重置静态路由表
|
||||
// resetRouter() // 重置静态路由表
|
||||
lockStore.resetLockInfo()
|
||||
replace('/login')
|
||||
replace('/login?redirect=/index')
|
||||
}
|
||||
|
||||
function handleShowForm(show = false) {
|
||||
|
|
|
@ -69,7 +69,11 @@ router.beforeEach(async (to, from, next) => {
|
|||
const userStore = useUserStoreWithOut()
|
||||
const permissionStore = usePermissionStoreWithOut()
|
||||
if (!dictStore.getIsSetDict) {
|
||||
await dictStore.setDictMap()
|
||||
try {
|
||||
await dictStore.setDictMap()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
if (!userStore.getIsSetUser) {
|
||||
isRelogin.show = true
|
||||
|
|
Loading…
Reference in New Issue