diff --git a/.stylelintrc b/.stylelintrc index c76b4220..66938459 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -11,11 +11,11 @@ "rules": { "stylistic/max-line-length": null, "stylistic/block-closing-brace-newline-after": [ - "always", - { - "ignoreAtRules": ["if", "else"] - } - ], + "always", + { + "ignoreAtRules": ["if", "else"] + } + ], "at-rule-no-unknown": null, "no-descending-specificity": null, "property-no-unknown": null, diff --git a/src/mock/member.ts b/src/mock/member.ts index 5f36cb41..55f68342 100644 --- a/src/mock/member.ts +++ b/src/mock/member.ts @@ -8,7 +8,7 @@ export default [ status: 1, data: { account: option.body.account, - token: '@string', + token: `${option.body.account}_@string`, failure_time: Math.ceil(new Date().getTime() / 1000) + 24 * 60 * 60, }, } @@ -19,7 +19,7 @@ export default [ method: 'get', response: (option: any) => { let permissions: string[] = [] - if (option.query.account === 'admin') { + if (option.headers.token.indexOf('admin') === 0) { permissions = [ 'permission.browse', 'permission.create', @@ -27,7 +27,7 @@ export default [ 'permission.remove', ] } - else if (option.query.account === 'test') { + else if (option.headers.token.indexOf('test') === 0) { permissions = [ 'permission.browse', ] diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index e4921eb3..56ba4478 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -55,9 +55,6 @@ const useUserStore = defineStore( // 通过 mock 获取权限 const res = await api.get('member/permission', { baseURL: '/mock/', - params: { - account: account.value, - }, }) permissions.value = res.data.permissions return permissions.value @@ -68,7 +65,6 @@ const useUserStore = defineStore( newpassword: string }) { await api.post('member/edit/password', { - account: account.value, password: data.password, newpassword: data.newpassword, }, {