mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2026-07-23 21:05:42 +08:00
Compare commits
2 Commits
db99bb9bc4
...
6dc7114eea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dc7114eea | ||
|
|
56f6120f88 |
@ -1,3 +1,12 @@
|
||||
## [3.1.12](https://github.com/WeBankFinTech/fes.js/compare/v3.1.11...v3.1.12) (2024-05-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* plugin-access中导出hasAccessSync方法 ([56f6120](https://github.com/WeBankFinTech/fes.js/commit/56f6120f889a88b37760db029faa597597572831))
|
||||
|
||||
|
||||
|
||||
## [3.1.11](https://ssh.github.com:443/WeBankFinTech/fes.js/compare/v3.1.10...v3.1.11) (2024-05-24)
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "fes.js",
|
||||
"type": "module",
|
||||
"version": "3.1.11",
|
||||
"version": "3.1.12",
|
||||
"private": true,
|
||||
"description": "一个好用的前端管理台快速开发框架",
|
||||
"preferGlobal": true,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fesjs/plugin-access",
|
||||
"version": "3.1.5",
|
||||
"version": "3.1.6",
|
||||
"description": "@fesjs/plugin-access",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
|
||||
@ -145,8 +145,13 @@ export const install = (app) => {
|
||||
app.component("Access", createComponent(useAccess));
|
||||
};
|
||||
|
||||
export const hasAccessSync = (path) => {
|
||||
return match(unref(path), getAllowAccessIds());
|
||||
}
|
||||
|
||||
export const access = {
|
||||
hasAccess,
|
||||
hasAccessSync,
|
||||
isDataReady,
|
||||
setRole,
|
||||
getRole: () => {
|
||||
@ -158,10 +163,6 @@ export const access = {
|
||||
setPresetAccess,
|
||||
};
|
||||
|
||||
export const hasAccessSync = (path) => {
|
||||
return match(unref(path), getAllowAccessIds());
|
||||
}
|
||||
|
||||
export const useAccess = (path) => {
|
||||
const allowPageIds = computed(getAllowAccessIds);
|
||||
const result = computed(() => {
|
||||
|
||||
4
packages/fes-plugin-access/types.d.ts
vendored
4
packages/fes-plugin-access/types.d.ts
vendored
@ -3,10 +3,14 @@ import type { Ref } from 'vue';
|
||||
|
||||
export const access: {
|
||||
hasAccess: (accessId: string | number) => Promise<boolean>;
|
||||
hasAccessSync: (accessId: string | number) => boolean;
|
||||
isDataReady: () => boolean;
|
||||
setRole: (roleId: string | Promise<string>) => void;
|
||||
getRole: () => string;
|
||||
setAccess: (accessIds: Array<string | number> | Promise<Array<string | number>>) => void;
|
||||
getAccess: () => string[];
|
||||
match: (path: string, accessIds: string[]) => boolean;
|
||||
setPresetAccess: (accessId: string | string[]) => void;
|
||||
};
|
||||
|
||||
export function useAccess(accessId: string | number): Ref<boolean>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user