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