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))
 | 
			
		||||
	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())
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -53,7 +66,7 @@ func (svc *CommonResourceService) GetById(resource string, id int) ([]*dto.Commo
 | 
			
		||||
 | 
			
		||||
func (svc *CommonResourceService) Create(resource string, dtoObj dto.CommonDtoValues) (dto.CommonDtoValues, *entity.CommonResource, error) {
 | 
			
		||||
	if resource == consts.ResourcesName_SysUser {
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	et, err := findCommResourceRepo(resource).Create(dtoObj)
 | 
			
		||||
 | 
			
		||||
@ -2,12 +2,13 @@ import router, {isGetUserInfo, projectOpTreeRoutes, setProjectOperationRoutes} f
 | 
			
		||||
import {cachedProject, cachedProjectResource} from '@/stores/project.js'
 | 
			
		||||
import {getUserInfo} from "@/api/sys.js";
 | 
			
		||||
import LocalCache from "@/stores/localCache.js";
 | 
			
		||||
import ExpireCache from "@/stores/expireCache.js";
 | 
			
		||||
 | 
			
		||||
router.beforeEach((to, from, next) => {
 | 
			
		||||
    if (to.path === '/login') {
 | 
			
		||||
        next()
 | 
			
		||||
    } else {
 | 
			
		||||
        const token = LocalCache.getCache("token");
 | 
			
		||||
        const token = ExpireCache.getCache("token");
 | 
			
		||||
        if (!token) {
 | 
			
		||||
            // 没有token
 | 
			
		||||
            console.log("重定向到login")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user