1. 在路由实例中保留基础路由 router/index.js中只需要保留基础路由,其他的都删了 2. 获取用户菜单,并保存到Vuex中 stroe/modules/user.js中,有个getInfo方法查询用户基本信息,返回了用户的菜单列表 // get user info getInfo({ commit, state }) { return new Promise((resolve, reject) => { getInfo(state.token).then(response =>
1. 用户登录时,将用户的权限写入Cookie: //将需要的信息写入claims后 var identity = new ClaimsIdentity(claims, IdentityConstants.ApplicationScheme); var userPrincipal = new ClaimsPrincipal(identity); await HttpContext.SignInAsync(IdentityConstants.ApplicationScheme, userPrinc