create-wenuts-cli 2.2.0 → 2.3.0
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 +1 -1
- package/template/default/eslint.config.mjs +16 -4
- package/template/default/package.json +4 -1
- package/template/default/postcss.config.mjs +12 -12
- package/template/default/src/api/user.ts +145 -145
- package/template/default/src/app/[local]/(default-layout)/layout.tsx +1 -1
- package/template/default/src/app/[local]/(default-layout)/page.tsx +1 -1
- package/template/default/src/app/[local]/(no-layout)/home/page.tsx +11 -11
- package/template/default/src/app/[local]/(no-layout)/login/components/LoginHandle/index.tsx +40 -44
- package/template/default/src/app/[local]/(no-layout)/login/page.tsx +32 -32
- package/template/default/src/app/[local]/layout.tsx +38 -38
- package/template/default/src/app/api/auth/[...nextauth]/route.ts +38 -41
- package/template/default/src/app/layout.tsx +17 -17
- package/template/default/src/components/System/ClientLayout/index.tsx +42 -42
- package/template/default/src/components/System/LoginModal/index.tsx +48 -53
- package/template/default/src/components/System/ThemeProvider/index.tsx +33 -44
- package/template/default/src/config/CookieMap.ts +1 -1
- package/template/default/src/i18n/routing.ts +8 -9
- package/template/default/src/libs/casdoor_provider.ts +31 -33
- package/template/default/src/libs/fetchCookie/serverCookies.ts +5 -5
- package/template/default/src/libs/nextauth.ts +38 -41
- package/template/default/src/middleware.ts +6 -6
- package/template/default/src/store/useUserStore.ts +35 -35
- package/template/default/src/types/payment.ts +139 -139
- package/template/default/src/types/user.ts +81 -87
|
@@ -1,137 +1,131 @@
|
|
|
1
1
|
/** 用户登录 **/
|
|
2
|
-
export type TSrcType =
|
|
3
|
-
| "casdoor"
|
|
4
|
-
| "discord"
|
|
5
|
-
| "facebook"
|
|
6
|
-
| "google"
|
|
7
|
-
| "googleOneTap"
|
|
8
|
-
| "twitter";
|
|
2
|
+
export type TSrcType = 'casdoor' | 'discord' | 'facebook' | 'google' | 'googleOneTap' | 'twitter';
|
|
9
3
|
|
|
10
4
|
export enum UserCenterTabEnum {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
Profile = 'Profile',
|
|
6
|
+
Subscription = 'Subscription',
|
|
7
|
+
Setting = 'Setting',
|
|
8
|
+
Affiliate = 'Affiliate',
|
|
9
|
+
Cloud = 'Cloud',
|
|
10
|
+
ApiKey = 'Api Key',
|
|
11
|
+
Logout = 'Logout',
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
export enum ELoginTypeMap {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
google = 'Google',
|
|
16
|
+
discord = 'Discord',
|
|
17
|
+
facebook = 'Facebook',
|
|
18
|
+
twitter = 'Twitter',
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
export interface IUserLoginArgs {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
srcType: TSrcType;
|
|
23
|
+
code?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
credential?: string;
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
export interface IUserLoginState {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
name: string;
|
|
30
|
+
avatar: string;
|
|
31
|
+
token: string;
|
|
32
|
+
email: string;
|
|
39
33
|
}
|
|
40
34
|
|
|
41
35
|
/** 用户信息 **/
|
|
42
36
|
export interface IUserProfile {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
autoSendCommunity?: boolean;
|
|
38
|
+
avatar: string;
|
|
39
|
+
credit: number;
|
|
40
|
+
discord: boolean;
|
|
41
|
+
displayNSFW: boolean;
|
|
42
|
+
email: string;
|
|
43
|
+
id: string;
|
|
44
|
+
isCheckin?: boolean; // 当天是否签到
|
|
45
|
+
name: string;
|
|
46
|
+
phone: string;
|
|
47
|
+
subCredit?: number;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
pkgCode: string;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
total: number;
|
|
52
|
+
expiry?: string;
|
|
53
|
+
rebateTime?: string;
|
|
54
|
+
checkinDays?: number;
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
// 用户详情接口返回的数据类型
|
|
64
58
|
export interface IUserDetailResp {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
avatar: string;
|
|
62
|
+
follow: boolean;
|
|
63
|
+
pkgCode: string;
|
|
64
|
+
total: number;
|
|
71
65
|
}
|
|
72
66
|
|
|
73
67
|
export interface IUpdateUserNameParams {
|
|
74
|
-
|
|
68
|
+
username: string;
|
|
75
69
|
}
|
|
76
70
|
|
|
77
71
|
export interface IManageSubscriptionResult {
|
|
78
|
-
|
|
72
|
+
url: string;
|
|
79
73
|
}
|
|
80
74
|
|
|
81
75
|
export interface FeedBackReqParams {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
type: string;
|
|
77
|
+
desc: string;
|
|
78
|
+
email: string;
|
|
79
|
+
images?: string[];
|
|
86
80
|
}
|
|
87
81
|
|
|
88
82
|
export interface INoticeInfo {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
83
|
+
id: string;
|
|
84
|
+
order: number;
|
|
85
|
+
page: string;
|
|
86
|
+
startTime: string;
|
|
87
|
+
endTime: string;
|
|
88
|
+
panels: {
|
|
89
|
+
title: string;
|
|
90
|
+
content: string;
|
|
91
|
+
cover: string;
|
|
92
|
+
link: string;
|
|
93
|
+
options: any;
|
|
94
|
+
}[];
|
|
101
95
|
}
|
|
102
96
|
|
|
103
97
|
// 更新弹窗接口返回信息
|
|
104
98
|
export interface INoticeResult {
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
domain: string;
|
|
100
|
+
notices: INoticeInfo[];
|
|
107
101
|
}
|
|
108
102
|
|
|
109
103
|
export interface IApiKey {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
id: string;
|
|
105
|
+
key: string;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
latestUse: string;
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
// 创建支付凭证接口返回信息
|
|
117
111
|
export interface CreateInvoiceResult {
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
domain: string;
|
|
113
|
+
url: string;
|
|
120
114
|
}
|
|
121
115
|
|
|
122
116
|
export interface IChargeParams {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
type: string;
|
|
118
|
+
payType?: string;
|
|
119
|
+
packageCode?: string;
|
|
120
|
+
payId?: string;
|
|
121
|
+
receipt?: string;
|
|
122
|
+
productId?: string;
|
|
123
|
+
bizId?: string; // paypal 必填
|
|
130
124
|
}
|
|
131
125
|
|
|
132
126
|
export interface IChargeResult {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
credit: number;
|
|
128
|
+
chargedCredit: number;
|
|
129
|
+
packageCode: string;
|
|
130
|
+
resetTime: number; // 距离下次签到间隔的秒数
|
|
137
131
|
}
|