@owocow/saber-ui 0.0.3 → 0.0.5
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/composables/use-table.d.ts +1 -1
- package/dist/composables/use-table.mjs +35 -35
- package/dist/index-BealGwXp.js +5020 -0
- package/dist/types/api.d.ts +0 -7
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/crypto.mjs +7 -7
- package/dist/utils/http.d.ts +10 -5
- package/dist/utils/storage.mjs +1 -1
- package/package.json +1 -1
package/dist/types/api.d.ts
CHANGED
|
@@ -4,13 +4,6 @@ export interface ApiResponse<T = unknown> {
|
|
|
4
4
|
msg: string;
|
|
5
5
|
data: T;
|
|
6
6
|
}
|
|
7
|
-
/** rows、total 位于响应顶层的列表响应。 */
|
|
8
|
-
export interface ListResponse<T = unknown> {
|
|
9
|
-
code: number;
|
|
10
|
-
msg: string;
|
|
11
|
-
rows: T[];
|
|
12
|
-
total: number;
|
|
13
|
-
}
|
|
14
7
|
/** 通用分页请求参数。 */
|
|
15
8
|
export interface PageParams {
|
|
16
9
|
pageNum?: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { EnableStatus, Id, Option, PartialNullable, VisibleStatus, YesNo, } from './common';
|
|
2
|
-
export type { ApiResponse, CommonSearchParams,
|
|
2
|
+
export type { ApiResponse, CommonSearchParams, PageData, PageParams, SortOrder, } from './api';
|
|
3
3
|
export type { AuthUserInfo, CaptchaCode, LoginForm, LoginTenant, LoginTenantItem, LoginToken, PwdLoginForm, RegisterForm, SocialLoginForm, } from './auth';
|
package/dist/utils/crypto.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t from "
|
|
1
|
+
import { C as t } from "../index-BealGwXp.js";
|
|
2
2
|
function o() {
|
|
3
3
|
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4
4
|
let n = "";
|
|
@@ -12,25 +12,25 @@ function a() {
|
|
|
12
12
|
function i(e) {
|
|
13
13
|
return t.enc.Base64.stringify(e);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function s(e) {
|
|
16
16
|
return t.enc.Base64.parse(e);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function d(e, n) {
|
|
19
19
|
return t.AES.encrypt(e, n, {
|
|
20
20
|
mode: t.mode.ECB,
|
|
21
21
|
padding: t.pad.Pkcs7
|
|
22
22
|
}).toString();
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function p(e, n) {
|
|
25
25
|
return t.AES.decrypt(e, n, {
|
|
26
26
|
mode: t.mode.ECB,
|
|
27
27
|
padding: t.pad.Pkcs7
|
|
28
28
|
}).toString(t.enc.Utf8);
|
|
29
29
|
}
|
|
30
30
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
s as decryptBase64,
|
|
32
|
+
p as decryptWithAes,
|
|
33
33
|
i as encryptBase64,
|
|
34
|
-
|
|
34
|
+
d as encryptWithAes,
|
|
35
35
|
a as generateAesKey
|
|
36
36
|
};
|
package/dist/utils/http.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ApiResponse,
|
|
2
|
-
export type { ApiResponse,
|
|
3
|
-
/**
|
|
4
|
-
|
|
1
|
+
import { ApiResponse, PageData } from '../types/api';
|
|
2
|
+
export type { ApiResponse, PageData } from '../types/api';
|
|
3
|
+
/**
|
|
4
|
+
* 分页列表响应。
|
|
5
|
+
*
|
|
6
|
+
* 后端分页接口统一返回 `{ code, msg, data: { rows, total } }`,
|
|
7
|
+
* rows/total 位于 `ApiResponse.data` 内。
|
|
8
|
+
*/
|
|
9
|
+
export type ListResult<T = unknown> = ApiResponse<PageData<T>>;
|
|
5
10
|
export interface HttpConfig {
|
|
6
11
|
/** API 基础路径,如 `/api` */
|
|
7
12
|
baseURL: string;
|
|
@@ -36,7 +41,7 @@ export declare function setupHttp(config: HttpConfig): void;
|
|
|
36
41
|
export declare function request<T = unknown>(url: string, options?: RequestOptions): Promise<T>;
|
|
37
42
|
export declare const http: {
|
|
38
43
|
get<T = unknown, P extends object = object>(url: string, params?: P, withToken?: boolean): Promise<ApiResponse<T>>;
|
|
39
|
-
list<T = unknown, P extends object = object>(url: string, params?: P, withToken?: boolean): Promise<
|
|
44
|
+
list<T = unknown, P extends object = object>(url: string, params?: P, withToken?: boolean): Promise<ListResult<T>>;
|
|
40
45
|
post<T = unknown, D extends object = object>(url: string, data?: D, withToken?: boolean, encrypt?: boolean): Promise<ApiResponse<T>>;
|
|
41
46
|
put<T = unknown, D extends object = object>(url: string, data?: D, withToken?: boolean, encrypt?: boolean): Promise<ApiResponse<T>>;
|
|
42
47
|
patch<T = unknown, D extends object = object>(url: string, data?: D, withToken?: boolean, encrypt?: boolean): Promise<ApiResponse<T>>;
|
package/dist/utils/storage.mjs
CHANGED