We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * 操作权限校验 * @param authConfig * @param permission * @param role * @param permissions * @param roles * @returns {boolean} */ const auth = function(authConfig, permission, role, permissions, roles) { // authConfig的模板 deleteRecord: { // check: 'delete', // type: 'role' // } const {check, type} = authConfig if (check && typeof check === 'function') { return check.apply(this, [permission, role, permissions, roles]) } if (type === 'permission') { return checkFromPermission(check, permission) } else if (type === 'role') { // 以上面authConfig传入时,role传进的参数一直为空数组role=[] return checkFromRoles(check, role) // role参数改为roles,操作校验就成功了 } else { return checkFromPermission(check, permission) || checkFromRoles(check, role) // role=>roles } }
https://github.com/iczer/vue-antd-admin/blob/basic/src/plugins/authority-plugin.js
[上面失败的情况,是在vuex持有多角色时出现的,不知道单角色的环境下会不会发生]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
[上面失败的情况,是在vuex持有多角色时出现的,不知道单角色的环境下会不会发生]
The text was updated successfully, but these errors were encountered: