src/store/modules/user.js
@@ -22,6 +22,16 @@ permissions: [] }), actions: { // 更新按钮权限,不重复触发登录时的密码提示。 async refreshPermissions() { const token = this.token const res = await getInfo() if (this.token === token) { this.roles = res.roles?.length ? res.roles : ['ROLE_DEFAULT'] this.permissions = res.permissions || [] } return res }, // 登录 login(userInfo) { const username = userInfo.username.trim()