@vtj/renderer 0.8.164 → 0.8.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@vtj/renderer",
3
3
  "private": false,
4
- "version": "0.8.164",
4
+ "version": "0.8.166",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "mockjs": "~1.1.0",
8
- "@vtj/icons": "~0.8.164",
9
- "@vtj/core": "~0.8.164",
10
- "@vtj/utils": "~0.8.164",
11
- "@vtj/ui": "~0.8.164"
8
+ "@vtj/core": "~0.8.166",
9
+ "@vtj/ui": "~0.8.166",
10
+ "@vtj/icons": "~0.8.166",
11
+ "@vtj/utils": "~0.8.166"
12
12
  },
13
13
  "devDependencies": {
14
14
  "vue": "~3.5.5",
@@ -28,9 +28,9 @@ export interface AccessOptions {
28
28
  */
29
29
  unauthorized?: string | (() => void);
30
30
  /**
31
- * 授权登录页面路由路径或url
31
+ * 授权登录页面 pathname
32
32
  */
33
- auth?: string | (() => void);
33
+ auth?: string | ((search: string) => void);
34
34
  /**
35
35
  * 判断是否登录页面
36
36
  * @param path
@@ -50,7 +50,7 @@ export interface AccessOptions {
50
50
  * @param message
51
51
  * @returns
52
52
  */
53
- alert?: (message: string) => void;
53
+ alert?: (message: string, options: Record<string, any>) => Promise<any>;
54
54
  unauthorizedMessage?: string;
55
55
  }
56
56
  export interface AccessData {
@@ -76,9 +76,11 @@ export declare const ACCESS_KEY: InjectionKey<Access>;
76
76
  export declare class Access {
77
77
  private options;
78
78
  private data;
79
+ private mode?;
79
80
  constructor(options: Partial<AccessOptions>);
80
81
  connect(params: AccessConnectParams): void;
81
82
  login(data: AccessData): void;
83
+ clear(): void;
82
84
  logout(): void;
83
85
  getData(): AccessData | null;
84
86
  can(code: string | string[]): boolean;
@@ -92,6 +94,7 @@ export declare class Access {
92
94
  private guard;
93
95
  private isWhiteList;
94
96
  private isUnauthorized;
97
+ private showUnauthorizedAlert;
95
98
  private setRequest;
96
99
  }
97
100
  export declare function useAccess(): Access;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.164
5
+ * @version 0.8.165
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.164";
8
+ export declare const version = "0.8.165";