吴羡
9 小时以前 57067e7107abc6d7b921ca9ba1dc46b4b4107c95
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()