修复pgsql从数据库表获取key的问题

This commit is contained in:
piexlmax
2022-06-09 14:53:57 +08:00
parent 4e8544ce97
commit 7d82785ade
2 changed files with 59 additions and 43 deletions
+13 -11
View File
@@ -18,17 +18,19 @@ const getRouter = async(userStore) => {
}
async function handleKeepAlive(to) {
if (to.matched && to.matched.length > 2) {
for (let i = 1; i < to.matched.length; i++) {
const element = to.matched[i - 1]
if (element.name === 'layout') {
to.matched.splice(i, 1)
await handleKeepAlive(to)
}
// 如果没有按需加载完成则等待加载
if (typeof element.components.default === 'function') {
await element.components.default()
await handleKeepAlive(to)
if (to.matched.some(item => item.meta.keepAlive)) {
if (to.matched && to.matched.length > 2) {
for (let i = 1; i < to.matched.length; i++) {
const element = to.matched[i - 1]
if (element.name === 'layout') {
to.matched.splice(i, 1)
await handleKeepAlive(to)
}
// 如果没有按需加载完成则等待加载
if (typeof element.components.default === 'function') {
await element.components.default()
await handleKeepAlive(to)
}
}
}
}