mirror of
https://gitee.com/lyt-top/vue-next-admin
synced 2026-07-07 22:27:10 +08:00
'admin-22.06.11:同步master分支v2.1.1版本,具体查看master根目录CHANGELOG.md'
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { store } from '/@/store/index';
|
||||
import { useUserInfo } from '/@/stores/userInfo';
|
||||
import { judementSameArr } from '/@/utils/arrayOperation';
|
||||
|
||||
/**
|
||||
@ -7,7 +7,8 @@ import { judementSameArr } from '/@/utils/arrayOperation';
|
||||
* @returns 有权限,返回 `true`,反之则反
|
||||
*/
|
||||
export function auth(value) {
|
||||
return store.state.userInfos.userInfos.authBtnList.some((v) => v === value);
|
||||
const stores = useUserInfo();
|
||||
return stores.userInfos.authBtnList.some((v) => v === value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -17,7 +18,8 @@ export function auth(value) {
|
||||
*/
|
||||
export function auths(value) {
|
||||
let flag = false;
|
||||
store.state.userInfos.userInfos.authBtnList.map((val) => {
|
||||
const stores = useUserInfo();
|
||||
stores.userInfos.authBtnList.map((val) => {
|
||||
value.map((v) => {
|
||||
if (val === v) flag = true;
|
||||
});
|
||||
@ -31,5 +33,6 @@ export function auths(value) {
|
||||
* @returns 有权限,返回 `true`,反之则反
|
||||
*/
|
||||
export function authAll(value) {
|
||||
return judementSameArr(value, store.state.userInfos.userInfos.authBtnList);
|
||||
const stores = useUserInfo();
|
||||
return judementSameArr(value, stores.userInfos.authBtnList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user