optimize
This commit is contained in:
parent
16b648f3a2
commit
3a45c760a5
@ -36,6 +36,19 @@ func (svc *CommonResourceService) List(resource string, pageNo, pageLen int, ext
|
|||||||
}
|
}
|
||||||
retList := make([]dto.CommonDtoValues, 0, len(etList))
|
retList := make([]dto.CommonDtoValues, 0, len(etList))
|
||||||
for _, v := range etList {
|
for _, v := range etList {
|
||||||
|
dtoObj := v.ToCommonDto()
|
||||||
|
if resource == consts.ResourcesName_SysUser {
|
||||||
|
if name, find := dtoObj["UserName"]; find && name == "admin" {
|
||||||
|
// 不显示初始管理员数据
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if resource == consts.ResourcesName_SysCharacter {
|
||||||
|
if name, find := dtoObj["Name"]; find && name == "admin" {
|
||||||
|
// 不显示初始管理员数据
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
retList = append(retList, v.ToCommonDto())
|
retList = append(retList, v.ToCommonDto())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,12 +2,13 @@ import router, {isGetUserInfo, projectOpTreeRoutes, setProjectOperationRoutes} f
|
|||||||
import {cachedProject, cachedProjectResource} from '@/stores/project.js'
|
import {cachedProject, cachedProjectResource} from '@/stores/project.js'
|
||||||
import {getUserInfo} from "@/api/sys.js";
|
import {getUserInfo} from "@/api/sys.js";
|
||||||
import LocalCache from "@/stores/localCache.js";
|
import LocalCache from "@/stores/localCache.js";
|
||||||
|
import ExpireCache from "@/stores/expireCache.js";
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
const token = LocalCache.getCache("token");
|
const token = ExpireCache.getCache("token");
|
||||||
if (!token) {
|
if (!token) {
|
||||||
// 没有token
|
// 没有token
|
||||||
console.log("重定向到login")
|
console.log("重定向到login")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user