Merge branch 'dev' into test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-07-19 17:03:31 +08:00
4 changed files with 17 additions and 18 deletions

View File

@@ -64,11 +64,11 @@ function filterAsyncRoutes(routes = [], firstRoute = true) {
children: [],
}
if (route.route === '/' && firstRoute) {
curRoute['redirect'] = route.subMenu[0].route
} else if (route.subMenu && route.type === 1) {
curRoute['redirect'] = `${route.subMenu[0].route}`
}
// if (route.route === '/' && firstRoute) {
// curRoute['redirect'] = route.subMenu[0].route
// } else if (route.subMenu && route.type === 1) {
// curRoute['redirect'] = `${route.subMenu[0].route}`
// }
if (route.subMenu && route.subMenu.length) {
curRoute.children = filterAsyncRoutes(route.subMenu, false)
@@ -84,7 +84,6 @@ function filterAsyncRoutes(routes = [], firstRoute = true) {
curRoute.component = loadRouteView(route.components)
break
}
ret.push(curRoute)
})
return ret
@@ -122,7 +121,6 @@ export const usePermissionStore = defineStore('permission', {
generateRoutes() {
const menus = JSON.parse(localStorage.getItem('menu'))
const accessRoutes = filterAsyncRoutes(menus)
// console.log(accessRoutes)
window.localStorage.setItem('roles', JSON.stringify(findType3Routes(menus)))
this.accessRoutes = accessRoutes
return accessRoutes

View File

@@ -513,7 +513,7 @@ const getList = async () => {
pageSize: pagination.value.pageSize,
name: queryParams.value.word,
})
data.value = res.data.data || []
data.value = res.data.data.sort((a, b) => b.status - a.status) || []
pagination.value.itemCount = res.data.total
} catch (error) {
$message.error(error.msg)

View File

@@ -109,14 +109,15 @@ async function handleLogin() {
lStorage.remove('loginInfo')
}
await addDynamicRoutes()
// if (query.redirect) {
// const path = query.redirect
// Reflect.deleteProperty(query, 'redirect')
// router.push({ path, query })
// } else {
// router.push('/workbench')
// }
router.push('/workbench')
// console.log(query)
if (query.redirect) {
const path = query.redirect
Reflect.deleteProperty(query, 'redirect')
router.push({ path, query })
} else {
router.push('/workbench')
}
// router.push('/workbench')
} catch (error) {
$message.removeMessage()
}

View File

@@ -85,7 +85,7 @@ const columns = ref([
align: 'center',
render: (row) => {
return h('img', {
src: row.icon,
src: row.icon[0].url,
width: 50,
height: 50,
})
@@ -195,7 +195,7 @@ const getList = async () => {
},
],
})) || []
console.log(res)
// console.log(res)
pagination.value.itemCount = res.data.total
loading.value = false
}