@e-xi/xion 0.0.25 → 0.0.27
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/dist/main/app/index.js
CHANGED
|
@@ -44,7 +44,7 @@ import "../../chunk-files/chunk-J34MOWJP.js";
|
|
|
44
44
|
import "../../chunk-files/chunk-RSUM4GBD.js";
|
|
45
45
|
import {
|
|
46
46
|
BannerManager
|
|
47
|
-
} from "../../chunk-files/chunk-
|
|
47
|
+
} from "../../chunk-files/chunk-CZF5FXD4.js";
|
|
48
48
|
import "../../chunk-files/chunk-YLZRRUY7.js";
|
|
49
49
|
import {
|
|
50
50
|
defineAppConfig,
|
|
@@ -1,35 +1,62 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Pinia } from 'pinia';
|
|
2
2
|
/**
|
|
3
|
-
* JWT 认证 Store
|
|
3
|
+
* JWT 认证 Store
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
declare const useXoAuthStoreDefinition: import("pinia").StoreDefinition<"useXoAuthStore", Pick<{
|
|
6
|
+
status: import("vue").Ref<"error" | "unauthenticated" | "initializing" | "authenticating" | "refreshing" | "authenticated", "error" | "unauthenticated" | "initializing" | "authenticating" | "refreshing" | "authenticated">;
|
|
7
|
+
user: import("vue").Ref<unknown, unknown>;
|
|
8
|
+
error: import("vue").Ref<string | undefined, string | undefined>;
|
|
9
|
+
isInitializing: import("vue").ComputedRef<boolean>;
|
|
10
|
+
isAuthenticating: import("vue").ComputedRef<boolean>;
|
|
11
|
+
isRefreshing: import("vue").ComputedRef<boolean>;
|
|
12
|
+
isAuthenticated: import("vue").ComputedRef<boolean>;
|
|
13
|
+
isUnauthenticated: import("vue").ComputedRef<boolean>;
|
|
14
|
+
isError: import("vue").ComputedRef<boolean>;
|
|
15
|
+
initialize: () => Promise<void>;
|
|
16
|
+
login: (request: XoAuth.LoginRequest) => Promise<void>;
|
|
17
|
+
logout: () => Promise<void>;
|
|
18
|
+
}, "error" | "status" | "user">, Pick<{
|
|
19
|
+
status: import("vue").Ref<"error" | "unauthenticated" | "initializing" | "authenticating" | "refreshing" | "authenticated", "error" | "unauthenticated" | "initializing" | "authenticating" | "refreshing" | "authenticated">;
|
|
20
|
+
user: import("vue").Ref<unknown, unknown>;
|
|
21
|
+
error: import("vue").Ref<string | undefined, string | undefined>;
|
|
22
|
+
isInitializing: import("vue").ComputedRef<boolean>;
|
|
23
|
+
isAuthenticating: import("vue").ComputedRef<boolean>;
|
|
24
|
+
isRefreshing: import("vue").ComputedRef<boolean>;
|
|
25
|
+
isAuthenticated: import("vue").ComputedRef<boolean>;
|
|
26
|
+
isUnauthenticated: import("vue").ComputedRef<boolean>;
|
|
27
|
+
isError: import("vue").ComputedRef<boolean>;
|
|
28
|
+
initialize: () => Promise<void>;
|
|
29
|
+
login: (request: XoAuth.LoginRequest) => Promise<void>;
|
|
30
|
+
logout: () => Promise<void>;
|
|
31
|
+
}, "isInitializing" | "isAuthenticating" | "isRefreshing" | "isAuthenticated" | "isUnauthenticated" | "isError">, Pick<{
|
|
32
|
+
status: import("vue").Ref<"error" | "unauthenticated" | "initializing" | "authenticating" | "refreshing" | "authenticated", "error" | "unauthenticated" | "initializing" | "authenticating" | "refreshing" | "authenticated">;
|
|
33
|
+
user: import("vue").Ref<unknown, unknown>;
|
|
34
|
+
error: import("vue").Ref<string | undefined, string | undefined>;
|
|
35
|
+
isInitializing: import("vue").ComputedRef<boolean>;
|
|
36
|
+
isAuthenticating: import("vue").ComputedRef<boolean>;
|
|
37
|
+
isRefreshing: import("vue").ComputedRef<boolean>;
|
|
38
|
+
isAuthenticated: import("vue").ComputedRef<boolean>;
|
|
39
|
+
isUnauthenticated: import("vue").ComputedRef<boolean>;
|
|
40
|
+
isError: import("vue").ComputedRef<boolean>;
|
|
25
41
|
initialize: () => Promise<void>;
|
|
26
|
-
/** 登录 */
|
|
27
42
|
login: (request: XoAuth.LoginRequest) => Promise<void>;
|
|
28
|
-
/** 退出登录 */
|
|
29
43
|
logout: () => Promise<void>;
|
|
30
|
-
}
|
|
44
|
+
}, "login" | "logout" | "initialize">>;
|
|
31
45
|
/**
|
|
32
|
-
*
|
|
46
|
+
* 认证 Store 实例类型
|
|
47
|
+
* @template TUser 业务端指定的登录用户类型
|
|
48
|
+
*/
|
|
49
|
+
export type XoAuthStore<TUser = XoAuth.User> = Omit<ReturnType<typeof useXoAuthStoreDefinition>, 'user'> & {
|
|
50
|
+
/** 当前登录用户 */
|
|
51
|
+
user: TUser | undefined;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 获取认证 Store 实例
|
|
55
|
+
* @template TUser 业务端指定的登录用户类型
|
|
56
|
+
* @param {Pinia | null | undefined} pinia Pinia 实例
|
|
57
|
+
* @returns {XoAuthStore<TUser>} 认证 Store 实例
|
|
58
|
+
* @example
|
|
59
|
+
* const authStore = useXoAuthStore<User>()
|
|
33
60
|
*/
|
|
34
|
-
export declare
|
|
61
|
+
export declare function useXoAuthStore<TUser = XoAuth.User>(pinia?: Pinia | null): XoAuthStore<TUser>;
|
|
35
62
|
export {};
|
|
@@ -69,7 +69,7 @@ var useXoAppStore = defineStore("useXoAppStore", () => {
|
|
|
69
69
|
// src/renderer/store/auth/auth-store.ts
|
|
70
70
|
import { defineStore as defineStore2 } from "pinia";
|
|
71
71
|
import { computed as computed2, ref as ref2, shallowRef } from "vue";
|
|
72
|
-
var
|
|
72
|
+
var useXoAuthStoreDefinition = defineStore2("useXoAuthStore", () => {
|
|
73
73
|
const initializePromise = shallowRef();
|
|
74
74
|
const offState = shallowRef();
|
|
75
75
|
const status = ref2("initializing");
|
|
@@ -135,6 +135,9 @@ var useXoAuthStore = defineStore2("useXoAuthStore", () => {
|
|
|
135
135
|
logout
|
|
136
136
|
};
|
|
137
137
|
});
|
|
138
|
+
function useXoAuthStore(pinia) {
|
|
139
|
+
return useXoAuthStoreDefinition(pinia);
|
|
140
|
+
}
|
|
138
141
|
|
|
139
142
|
// src/shared/remote-service/const/remote-service.ts
|
|
140
143
|
var RemoteServiceStatusOptions = [
|