diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs index 6e8cdb28..55be5dd9 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/TestController.cs @@ -201,8 +201,26 @@ namespace Yi.Framework.ApiMicroservice.Controllers [Authorize] [HttpGet] public Result AuthorizeTest() - { + { return Result.Success(); } + + [HttpGet] + public async Task ClearDb() + { + var rep = _iUserService._repository; + return Result.Success().SetStatus(await rep.UseTranAsync(async () => + { + await rep.DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + await rep.ChangeRepository>().DeleteAsync(u => true); + })); + + } } } diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index 649c9154..614c01a7 100644 Binary files a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.Common/Models/VueRouterModel.cs b/Yi.Framework.Net6/Yi.Framework.Common/Models/VueRouterModel.cs index a6bb5cf4..30af6f11 100644 --- a/Yi.Framework.Net6/Yi.Framework.Common/Models/VueRouterModel.cs +++ b/Yi.Framework.Net6/Yi.Framework.Common/Models/VueRouterModel.cs @@ -18,7 +18,7 @@ namespace Yi.Framework.Common.Models public string Redirect { get; set; } public string Component { get; set; } public bool AlwaysShow { get; set; } - public Meta Meta { get; set; } + public Meta Meta { get; set; } = new Meta(); public List Children { get; set; } } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs index 911c3c63..dfca072a 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/MenuEntity.cs @@ -46,6 +46,7 @@ namespace Yi.Framework.Model.Models r.Redirect = "noRedirect"; r.AlwaysShow = true; r.Component = m.Component; + r.AlwaysShow = false; } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs index b20eb81b..d10103ad 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs @@ -13,6 +13,7 @@ namespace Yi.Framework.Model.Models { public MenuEntity() { + this.IsCache = false; this.CreateTime = DateTime.Now; } [JsonConverter(typeof(ValueToStringConverter))] diff --git a/Yi.Framework.Net6/Yi.Framework.Model/SeedData/DictionarySeed.cs b/Yi.Framework.Net6/Yi.Framework.Model/SeedData/DictionarySeed.cs index ff3c5590..89667d23 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/SeedData/DictionarySeed.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/SeedData/DictionarySeed.cs @@ -12,6 +12,115 @@ namespace Yi.Framework.Model.SeedData { public override List GetSeed() { + DictionaryEntity dict1 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "用户性别", + DictType = "sys_user_sex", + OrderNum = 100, + Remark = "用户性别列表", + IsDeleted = false, + }; + Entitys.Add(dict1); + + DictionaryEntity dict2 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "菜单状态", + DictType = "sys_show_hide", + OrderNum = 100, + Remark = "菜单状态列表", + IsDeleted = false, + }; + Entitys.Add(dict2); + + DictionaryEntity dict3 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "系统开关", + DictType = "sys_normal_disable", + OrderNum = 100, + Remark = "系统开关列表", + IsDeleted = false, + }; + Entitys.Add(dict3); + + DictionaryEntity dict4 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "任务状态", + DictType = "sys_job_status", + OrderNum = 100, + Remark = "任务状态列表", + IsDeleted = false, + }; + Entitys.Add(dict4); + + DictionaryEntity dict5 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "任务分组", + DictType = "sys_job_group", + OrderNum = 100, + Remark = "任务分组列表", + IsDeleted = false, + }; + Entitys.Add(dict5); + + DictionaryEntity dict6 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "系统是否", + DictType = "sys_yes_no", + OrderNum = 100, + Remark = "系统是否列表", + IsDeleted = false, + }; + Entitys.Add(dict6); + + DictionaryEntity dict7 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "通知类型", + DictType = "sys_notice_type", + OrderNum = 100, + Remark = "通知类型列表", + IsDeleted = false, + }; + Entitys.Add(dict7); + DictionaryEntity dict8 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "通知状态", + DictType = "sys_notice_status", + OrderNum = 100, + Remark = "通知状态列表", + IsDeleted = false, + }; + Entitys.Add(dict8); + + DictionaryEntity dict9 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "操作类型", + DictType = "sys_oper_type", + OrderNum = 100, + Remark = "操作类型列表", + IsDeleted = false, + }; + Entitys.Add(dict9); + + + DictionaryEntity dict10 = new DictionaryEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + DictName = "系统状态", + DictType = "sys_common_status", + OrderNum = 100, + Remark = "登录状态列表", + IsDeleted = false, + }; + Entitys.Add(dict10); return Entitys; } } diff --git a/Yi.Framework.Net6/Yi.Framework.Model/SeedData/MenuSeed.cs b/Yi.Framework.Net6/Yi.Framework.Model/SeedData/MenuSeed.cs index 9659a966..aa87ea54 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/SeedData/MenuSeed.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/SeedData/MenuSeed.cs @@ -124,7 +124,7 @@ namespace Yi.Framework.Model.SeedData PermissionCode = "system:role:query", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = user.Id, + ParentId = role.Id, IsDeleted = false }; Entitys.Add(roleQuery); @@ -136,7 +136,7 @@ namespace Yi.Framework.Model.SeedData PermissionCode = "system:role:add", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = user.Id, + ParentId = role.Id, IsDeleted = false }; Entitys.Add(roleAdd); @@ -148,7 +148,7 @@ namespace Yi.Framework.Model.SeedData PermissionCode = "system:role:edit", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = user.Id, + ParentId = role.Id, IsDeleted = false }; Entitys.Add(roleEdit); @@ -160,7 +160,7 @@ namespace Yi.Framework.Model.SeedData PermissionCode = "system:role:remove", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = user.Id, + ParentId = role.Id, IsDeleted = false }; Entitys.Add(roleRemove); @@ -370,71 +370,71 @@ namespace Yi.Framework.Model.SeedData Entitys.Add(postRemove); //字典管理 - MenuEntity dic = new MenuEntity() + MenuEntity dict = new MenuEntity() { Id = SnowFlakeSingle.Instance.NextId(), MenuName = "字典管理", - PermissionCode = "system:dic:list", + PermissionCode = "system:dict:list", MenuType = MenuTypeEnum.Menu.GetHashCode(), - Router = "dic", + Router = "dict", IsShow = true, IsLink = false, IsCache = true, - Component = "system/dic/index", + Component = "system/dict/index", MenuIcon = "dict", OrderNum = 100, ParentId = system.Id, IsDeleted = false }; - Entitys.Add(dic); + Entitys.Add(dict); - MenuEntity dicQuery = new MenuEntity() + MenuEntity dictQuery = new MenuEntity() { Id = SnowFlakeSingle.Instance.NextId(), MenuName = "字典查询", - PermissionCode = "system:dic:query", + PermissionCode = "system:dict:query", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = dic.Id, + ParentId = dict.Id, IsDeleted = false }; - Entitys.Add(dicQuery); + Entitys.Add(dictQuery); - MenuEntity dicAdd = new MenuEntity() + MenuEntity dictAdd = new MenuEntity() { Id = SnowFlakeSingle.Instance.NextId(), MenuName = "字典新增", - PermissionCode = "system:dic:add", + PermissionCode = "system:dict:add", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = dic.Id, + ParentId = dict.Id, IsDeleted = false }; - Entitys.Add(dicAdd); + Entitys.Add(dictAdd); - MenuEntity dicEdit = new MenuEntity() + MenuEntity dictEdit = new MenuEntity() { Id = SnowFlakeSingle.Instance.NextId(), MenuName = "字典修改", - PermissionCode = "system:dic:edit", + PermissionCode = "system:dict:edit", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = dic.Id, + ParentId = dict.Id, IsDeleted = false }; - Entitys.Add(dicEdit); + Entitys.Add(dictEdit); - MenuEntity dicRemove = new MenuEntity() + MenuEntity dictRemove = new MenuEntity() { Id = SnowFlakeSingle.Instance.NextId(), MenuName = "字典删除", - PermissionCode = "system:dic:remove", + PermissionCode = "system:dict:remove", MenuType = MenuTypeEnum.Component.GetHashCode(), OrderNum = 100, - ParentId = dic.Id, + ParentId = dict.Id, IsDeleted = false }; - Entitys.Add(dicRemove); + Entitys.Add(dictRemove); diff --git a/Yi.Framework.Net6/Yi.Framework.Model/SeedData/SeedFactory.cs b/Yi.Framework.Net6/Yi.Framework.Model/SeedData/SeedFactory.cs index 0320a355..ee32cc57 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/SeedData/SeedFactory.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/SeedData/SeedFactory.cs @@ -22,6 +22,10 @@ namespace Yi.Framework.Model.SeedData { return new MenuSeed().GetSeed(); } + public static List GetDictionarySeed() + { + return new DictionarySeed().GetSeed(); + } public static List GetUserRoleSeed(List users, List roles) { List userRoleEntities = new(); diff --git a/Yi.Framework.Net6/Yi.Framework.WebCore/DbExtend/DbSeedExtend.cs b/Yi.Framework.Net6/Yi.Framework.WebCore/DbExtend/DbSeedExtend.cs index 5ab736e8..8e1b11fe 100644 --- a/Yi.Framework.Net6/Yi.Framework.WebCore/DbExtend/DbSeedExtend.cs +++ b/Yi.Framework.Net6/Yi.Framework.WebCore/DbExtend/DbSeedExtend.cs @@ -23,6 +23,7 @@ namespace Yi.Framework.WebCore.DbExtend var users = SeedFactory.GetUserSeed(); var roles = SeedFactory.GetRoleSeed(); var menus = SeedFactory.GetMenuSeed(); + var dicts= SeedFactory.GetDictionarySeed(); if (!_Db.Queryable().Any()) { _Db.Insertable(users).ExecuteCommand(); @@ -38,6 +39,11 @@ namespace Yi.Framework.WebCore.DbExtend _Db.Insertable(menus).ExecuteCommand(); } + if (!_Db.Queryable().Any()) + { + _Db.Insertable(dicts).ExecuteCommand(); + } + if (!_Db.Queryable().Any()) { _Db.Insertable(SeedFactory.GetUserRoleSeed(users, roles)).ExecuteCommand(); diff --git a/Yi.Vue3.X.RuoYi/src/store/modules/permission.js b/Yi.Vue3.X.RuoYi/src/store/modules/permission.js index 2aa465c9..c1168047 100644 --- a/Yi.Vue3.X.RuoYi/src/store/modules/permission.js +++ b/Yi.Vue3.X.RuoYi/src/store/modules/permission.js @@ -36,318 +36,317 @@ const usePermissionStore = defineStore( return new Promise(resolve => { // 向后端请求路由数据 getRouters().then(response => { - // const res=response.data; - + -const res=[ - { - "name": "System", - "path": "/system", - "hidden": false, - "redirect": "noRedirect", - "component": "Layout", - "alwaysShow": true, - "meta": { - "title": "系统管理", - "icon": "system", - "noCache": false, - "link": null - }, - "children": [ - { - "name": "User", - "path": "user", - "hidden": false, - "component": "system/user/index", - "meta": { - "title": "用户管理", - "icon": "user", - "noCache": false, - "link": null - } - }, - { - "name": "Role", - "path": "role", - "hidden": false, - "component": "system/role/index", - "meta": { - "title": "角色管理", - "icon": "peoples", - "noCache": false, - "link": null - } - }, - { - "name": "Menu", - "path": "menu", - "hidden": false, - "component": "system/menu/index", - "meta": { - "title": "菜单管理", - "icon": "tree-table", - "noCache": false, - "link": null - } - }, - { - "name": "Dept", - "path": "dept", - "hidden": false, - "component": "system/dept/index", - "meta": { - "title": "部门管理", - "icon": "tree", - "noCache": false, - "link": null - } - }, - { - "name": "Post", - "path": "post", - "hidden": false, - "component": "system/post/index", - "meta": { - "title": "岗位管理", - "icon": "post", - "noCache": false, - "link": null - } - }, - { - "name": "Dict", - "path": "dict", - "hidden": false, - "component": "system/dict/index", - "meta": { - "title": "字典管理", - "icon": "dict", - "noCache": false, - "link": null - } - }, - { - "name": "Config", - "path": "config", - "hidden": false, - "component": "system/config/index", - "meta": { - "title": "参数设置", - "icon": "edit", - "noCache": false, - "link": null - } - }, - { - "name": "Notice", - "path": "notice", - "hidden": false, - "component": "system/notice/index", - "meta": { - "title": "通知公告", - "icon": "message", - "noCache": false, - "link": null - } - }, - { - "name": "Log", - "path": "log", - "hidden": false, - "redirect": "noRedirect", - "component": "ParentView", - "alwaysShow": true, - "meta": { - "title": "日志管理", - "icon": "log", - "noCache": false, - "link": null - }, - "children": [ - { - "name": "Operlog", - "path": "operlog", - "hidden": false, - "component": "monitor/operlog/index", - "meta": { - "title": "操作日志", - "icon": "form", - "noCache": false, - "link": null - } - }, - { - "name": "Logininfor", - "path": "logininfor", - "hidden": false, - "component": "monitor/logininfor/index", - "meta": { - "title": "登录日志", - "icon": "logininfor", - "noCache": false, - "link": null - } - } - ] - } - ] - }, - { - "name": "Monitor", - "path": "/monitor", - "hidden": false, - "redirect": "noRedirect", - "component": "Layout", - "alwaysShow": true, - "meta": { - "title": "系统监控", - "icon": "monitor", - "noCache": false, - "link": null - }, - "children": [ - { - "name": "Online", - "path": "online", - "hidden": false, - "component": "monitor/online/index", - "meta": { - "title": "在线用户", - "icon": "online", - "noCache": false, - "link": null - } - }, - { - "name": "Job", - "path": "job", - "hidden": false, - "component": "monitor/job/index", - "meta": { - "title": "定时任务", - "icon": "job", - "noCache": false, - "link": null - } - }, - { - "name": "Druid", - "path": "druid", - "hidden": false, - "component": "monitor/druid/index", - "meta": { - "title": "数据监控", - "icon": "druid", - "noCache": false, - "link": null - } - }, - { - "name": "Server", - "path": "server", - "hidden": false, - "component": "monitor/server/index", - "meta": { - "title": "服务监控", - "icon": "server", - "noCache": false, - "link": null - } - }, - { - "name": "Cache", - "path": "cache", - "hidden": false, - "component": "monitor/cache/index", - "meta": { - "title": "缓存监控", - "icon": "redis", - "noCache": false, - "link": null - } - }, - { - "name": "CacheList", - "path": "cacheList", - "hidden": false, - "component": "monitor/cache/list", - "meta": { - "title": "缓存列表", - "icon": "redis-list", - "noCache": false, - "link": null - } - } - ] - }, - { - "name": "Tool", - "path": "/tool", - "hidden": false, - "redirect": "noRedirect", - "component": "Layout", - "alwaysShow": true, - "meta": { - "title": "系统工具", - "icon": "tool", - "noCache": false, - "link": null - }, - "children": [ - { - "name": "Build", - "path": "build", - "hidden": false, - "component": "tool/build/index", - "meta": { - "title": "表单构建", - "icon": "build", - "noCache": false, - "link": null - } - }, - { - "name": "Gen", - "path": "gen", - "hidden": false, - "component": "tool/gen/index", - "meta": { - "title": "代码生成", - "icon": "code", - "noCache": false, - "link": null - } - }, - { - "name": "Swagger", - "path": "swagger", - "hidden": false, - "component": "tool/swagger/index", - "meta": { - "title": "系统接口", - "icon": "swagger", - "noCache": false, - "link": null - } - } - ] - }, - { - "name": "Http://ruoyi.vip", - "path": "http://ruoyi.vip", - "hidden": false, - "component": "Layout", - "meta": { - "title": "若依官网", - "icon": "guide", - "noCache": false, - "link": "http://ruoyi.vip" - } - } -]; - +// const res=[ +// { +// "name": "System", +// "path": "/system", +// "hidden": false, +// "redirect": "noRedirect", +// "component": "Layout", +// "alwaysShow": true, +// "meta": { +// "title": "系统管理", +// "icon": "system", +// "noCache": false, +// "link": null +// }, +// "children": [ +// { +// "name": "User", +// "path": "user", +// "hidden": false, +// "component": "system/user/index", +// "meta": { +// "title": "用户管理", +// "icon": "user", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Role", +// "path": "role", +// "hidden": false, +// "component": "system/role/index", +// "meta": { +// "title": "角色管理", +// "icon": "peoples", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Menu", +// "path": "menu", +// "hidden": false, +// "component": "system/menu/index", +// "meta": { +// "title": "菜单管理", +// "icon": "tree-table", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Dept", +// "path": "dept", +// "hidden": false, +// "component": "system/dept/index", +// "meta": { +// "title": "部门管理", +// "icon": "tree", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Post", +// "path": "post", +// "hidden": false, +// "component": "system/post/index", +// "meta": { +// "title": "岗位管理", +// "icon": "post", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Dict", +// "path": "dict", +// "hidden": false, +// "component": "system/dict/index", +// "meta": { +// "title": "字典管理", +// "icon": "dict", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Config", +// "path": "config", +// "hidden": false, +// "component": "system/config/index", +// "meta": { +// "title": "参数设置", +// "icon": "edit", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Notice", +// "path": "notice", +// "hidden": false, +// "component": "system/notice/index", +// "meta": { +// "title": "通知公告", +// "icon": "message", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Log", +// "path": "log", +// "hidden": false, +// "redirect": "noRedirect", +// "component": "ParentView", +// "alwaysShow": true, +// "meta": { +// "title": "日志管理", +// "icon": "log", +// "noCache": false, +// "link": null +// }, +// "children": [ +// { +// "name": "Operlog", +// "path": "operlog", +// "hidden": false, +// "component": "monitor/operlog/index", +// "meta": { +// "title": "操作日志", +// "icon": "form", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Logininfor", +// "path": "logininfor", +// "hidden": false, +// "component": "monitor/logininfor/index", +// "meta": { +// "title": "登录日志", +// "icon": "logininfor", +// "noCache": false, +// "link": null +// } +// } +// ] +// } +// ] +// }, +// { +// "name": "Monitor", +// "path": "/monitor", +// "hidden": false, +// "redirect": "noRedirect", +// "component": "Layout", +// "alwaysShow": true, +// "meta": { +// "title": "系统监控", +// "icon": "monitor", +// "noCache": false, +// "link": null +// }, +// "children": [ +// { +// "name": "Online", +// "path": "online", +// "hidden": false, +// "component": "monitor/online/index", +// "meta": { +// "title": "在线用户", +// "icon": "online", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Job", +// "path": "job", +// "hidden": false, +// "component": "monitor/job/index", +// "meta": { +// "title": "定时任务", +// "icon": "job", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Druid", +// "path": "druid", +// "hidden": false, +// "component": "monitor/druid/index", +// "meta": { +// "title": "数据监控", +// "icon": "druid", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Server", +// "path": "server", +// "hidden": false, +// "component": "monitor/server/index", +// "meta": { +// "title": "服务监控", +// "icon": "server", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Cache", +// "path": "cache", +// "hidden": false, +// "component": "monitor/cache/index", +// "meta": { +// "title": "缓存监控", +// "icon": "redis", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "CacheList", +// "path": "cacheList", +// "hidden": false, +// "component": "monitor/cache/list", +// "meta": { +// "title": "缓存列表", +// "icon": "redis-list", +// "noCache": false, +// "link": null +// } +// } +// ] +// }, +// { +// "name": "Tool", +// "path": "/tool", +// "hidden": false, +// "redirect": "noRedirect", +// "component": "Layout", +// "alwaysShow": true, +// "meta": { +// "title": "系统工具", +// "icon": "tool", +// "noCache": false, +// "link": null +// }, +// "children": [ +// { +// "name": "Build", +// "path": "build", +// "hidden": false, +// "component": "tool/build/index", +// "meta": { +// "title": "表单构建", +// "icon": "build", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Gen", +// "path": "gen", +// "hidden": false, +// "component": "tool/gen/index", +// "meta": { +// "title": "代码生成", +// "icon": "code", +// "noCache": false, +// "link": null +// } +// }, +// { +// "name": "Swagger", +// "path": "swagger", +// "hidden": false, +// "component": "tool/swagger/index", +// "meta": { +// "title": "系统接口", +// "icon": "swagger", +// "noCache": false, +// "link": null +// } +// } +// ] +// }, +// { +// "name": "Http://ruoyi.vip", +// "path": "http://ruoyi.vip", +// "hidden": false, +// "component": "Layout", +// "meta": { +// "title": "若依官网", +// "icon": "guide", +// "noCache": false, +// "link": "http://ruoyi.vip" +// } +// } +// ]; + const res=response.data; const sdata = JSON.parse(JSON.stringify(res)) const rdata = JSON.parse(JSON.stringify(res)) diff --git a/Yi.Vue3.X.RuoYi/src/store/modules/user.js b/Yi.Vue3.X.RuoYi/src/store/modules/user.js index e856e983..aa839ad9 100644 --- a/Yi.Vue3.X.RuoYi/src/store/modules/user.js +++ b/Yi.Vue3.X.RuoYi/src/store/modules/user.js @@ -39,16 +39,16 @@ const useUserStore = defineStore( const avatar = (user.avatar == "" || user.avatar == null) ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar; if (res.roleCodes && res.roleCodes.length > 0) { // 验证返回的roles是否是一个非空数组 - // this.roles = res.roleCodes - // this.permissions = res.permissionCodes - this.roles = ["admin"]; - this.permissions=["*:*:*"] + this.roles = res.roleCodes + this.permissions = res.permissionCodes + // this.roles = ["admin"]; + // this.permissions=["*:*:*"] } else { this.roles = ['ROLE_DEFAULT'] } - this.roles = ["admin"]; - this.permissions=["*:*:*"] + // this.roles = ["admin"]; + // this.permissions=["*:*:*"] this.name = user.userName this.avatar = avatar; resolve(res)