@liujitcn/kratos-taro-app-core 0.1.1 → 0.1.4

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
@@ -7,7 +7,7 @@
7
7
  "type": "git",
8
8
  "url": "git@github.com:liujitcn/kratos-admin.git"
9
9
  },
10
- "version": "0.1.1",
10
+ "version": "0.1.4",
11
11
  "type": "module",
12
12
  "files": [
13
13
  "dist",
@@ -0,0 +1,38 @@
1
+ import { http } from '../../../utils/http'
2
+ import type {
3
+ AccountService,
4
+ CurrentPasswordPolicy,
5
+ GetCurrentPasswordPolicyRequest,
6
+ UpdateUserPasswordRequest,
7
+ } from '../../../rpc/base/v1/account'
8
+ import type { Empty } from '../../../rpc/google/protobuf/empty'
9
+
10
+ const ACCOUNT_URL = '/v1/base/account'
11
+
12
+ /** 账户安全公共服务。 */
13
+ export class AccountServiceImpl implements AccountService {
14
+ /** 获取当前用户生效的密码策略。 */
15
+ GetCurrentPasswordPolicy(
16
+ request: GetCurrentPasswordPolicyRequest,
17
+ ): Promise<CurrentPasswordPolicy> {
18
+ return http<CurrentPasswordPolicy>({
19
+ url: `${ACCOUNT_URL}/password-policy`,
20
+ method: 'GET',
21
+ authMode: 'required',
22
+ data: request,
23
+ })
24
+ }
25
+
26
+ /** 修改当前用户密码。 */
27
+ UpdateUserPassword(request: UpdateUserPasswordRequest): Promise<Empty> {
28
+ return http<Empty>({
29
+ url: `${ACCOUNT_URL}/password`,
30
+ method: 'PUT',
31
+ authMode: 'required',
32
+ data: request.user_password,
33
+ })
34
+ }
35
+ }
36
+
37
+ /** 当前用户账户安全公共服务实例。 */
38
+ export const defAccountService = new AccountServiceImpl()
@@ -23,9 +23,9 @@
23
23
  max-width: calc(100% - 190px);
24
24
  overflow: hidden;
25
25
  color: var(--kratos-color-text);
26
- font-size: 16PX;
26
+ font-size: 32px;
27
27
  font-weight: 700;
28
- line-height: 22PX;
28
+ line-height: 44px;
29
29
  text-overflow: ellipsis;
30
30
  white-space: nowrap;
31
31
  transform: translate(-50%, -50%);
@@ -3,19 +3,17 @@
3
3
  --kratos-tab-bar-active-color: var(--kratos-color-primary, #28f0d4);
4
4
 
5
5
  position: fixed;
6
- right: 20px;
7
- bottom: env(safe-area-inset-bottom);
8
- left: 20px;
6
+ right: 0;
7
+ bottom: 0;
8
+ left: 0;
9
9
  z-index: 999;
10
10
  box-sizing: border-box;
11
11
  display: flex;
12
- height: 104px;
12
+ height: var(--kratos-tab-bar-space, calc(104px + env(safe-area-inset-bottom)));
13
13
  padding: 0 8px;
14
- border: 1PX solid var(--kratos-color-border-accent, rgba(120, 230, 215, 0.16));
15
- border-radius: 30px;
16
- background: var(--kratos-dock-bg, rgba(10, 18, 30, 0.72));
17
- box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
18
- backdrop-filter: blur(32px);
14
+ border-top: 1px solid var(--kratos-color-border-accent, rgba(120, 230, 215, 0.16));
15
+ background: var(--kratos-color-surface-solid, #070d18);
16
+ box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
19
17
  }
20
18
 
21
19
  .kratos-tab-bar__item {
@@ -25,50 +23,52 @@
25
23
  align-items: center;
26
24
  justify-content: center;
27
25
  flex-direction: column;
26
+ height: 104px;
27
+ padding: 10px 0 8px;
28
28
  color: var(--kratos-tab-bar-color);
29
- font-size: 10PX;
30
- line-height: 12PX;
29
+ font-size: 20px;
30
+ line-height: 28px;
31
31
  }
32
32
 
33
33
  .kratos-tab-bar__icon {
34
34
  flex-shrink: 0;
35
- width: 28PX;
36
- height: 28PX;
37
- margin-bottom: 4PX;
35
+ width: 44px;
36
+ height: 44px;
37
+ margin-bottom: 4px;
38
38
  }
39
39
 
40
40
  .kratos-tab-bar__message-icon {
41
41
  position: relative;
42
- width: 22PX;
43
- height: 18PX;
44
- margin-bottom: 6PX;
45
- border: 2PX solid var(--kratos-tab-bar-color);
46
- border-radius: 6PX;
42
+ width: 36px;
43
+ height: 30px;
44
+ margin-bottom: 8px;
45
+ border: 2px solid var(--kratos-tab-bar-color);
46
+ border-radius: 8px;
47
47
  box-sizing: border-box;
48
48
  }
49
49
  .kratos-tab-bar__message-icon::before {
50
50
  position: absolute;
51
- top: 5PX;
52
- left: 4PX;
53
- width: 3PX;
54
- height: 3PX;
51
+ top: 8px;
52
+ left: 7px;
53
+ width: 4px;
54
+ height: 4px;
55
55
  border-radius: 50%;
56
56
  background: var(--kratos-tab-bar-color);
57
57
  box-shadow:
58
- 5PX 0 var(--kratos-tab-bar-color),
59
- 10PX 0 var(--kratos-tab-bar-color);
58
+ 8px 0 var(--kratos-tab-bar-color),
59
+ 16px 0 var(--kratos-tab-bar-color);
60
60
  content: '';
61
61
  }
62
62
 
63
63
  .kratos-tab-bar__message-icon::after {
64
64
  position: absolute;
65
- bottom: -5PX;
66
- left: 3PX;
67
- width: 7PX;
68
- height: 7PX;
69
- border-right: 2PX solid var(--kratos-tab-bar-color);
70
- border-bottom: 2PX solid var(--kratos-tab-bar-color);
71
- background: var(--kratos-dock-bg, rgba(10, 18, 30, 0.72));
65
+ bottom: -8px;
66
+ left: 5px;
67
+ width: 10px;
68
+ height: 10px;
69
+ border-right: 2px solid var(--kratos-tab-bar-color);
70
+ border-bottom: 2px solid var(--kratos-tab-bar-color);
71
+ background: var(--kratos-color-surface-solid, #070d18);
72
72
  content: '';
73
73
  transform: rotate(45deg);
74
74
  }
@@ -80,8 +80,8 @@
80
80
  .kratos-tab-bar__message-icon--active::before {
81
81
  background: var(--kratos-tab-bar-active-color);
82
82
  box-shadow:
83
- 5PX 0 var(--kratos-tab-bar-active-color),
84
- 10PX 0 var(--kratos-tab-bar-active-color);
83
+ 8px 0 var(--kratos-tab-bar-active-color),
84
+ 16px 0 var(--kratos-tab-bar-active-color);
85
85
  }
86
86
 
87
87
  .kratos-tab-bar__message-icon--active::after {
@@ -91,18 +91,24 @@
91
91
  .kratos-tab-bar__text--active {
92
92
  color: var(--kratos-tab-bar-active-color);
93
93
  font-weight: 700;
94
- text-shadow: 0 0 12px currentColor;
94
+ }
95
+
96
+ .kratos-tab-bar__text {
97
+ display: block;
98
+ min-height: 28px;
99
+ text-align: center;
100
+ white-space: nowrap;
95
101
  }
96
102
 
97
103
  .kratos-tab-bar__badge {
98
104
  position: absolute;
99
105
  top: 0;
100
- right: calc(50% - 19PX);
101
- width: 10PX;
102
- height: 10PX;
106
+ right: calc(50% - 30px);
107
+ width: 16px;
108
+ height: 16px;
103
109
  box-sizing: border-box;
104
- border: 2PX solid var(--kratos-dock-bg, rgba(10, 18, 30, 0.72));
105
- border-radius: 50%;
110
+ border: 2px solid var(--kratos-color-surface-solid, #070d18);
111
+ border-radius: 18px;
106
112
  background: var(--kratos-color-danger, #ff4d6d);
107
113
  box-shadow: 0 0 12px var(--kratos-color-danger, #ff4d6d);
108
114
  }
@@ -67,7 +67,9 @@ export function KratosTabBar({ route }: KratosTabBarProps) {
67
67
  {item.viewKey === 'MESSAGE_INBOX' && messageBadge ? (
68
68
  <View className='kratos-tab-bar__badge' aria-hidden='true' />
69
69
  ) : null}
70
- <Text className={active ? 'kratos-tab-bar__text--active' : ''}>{item.title}</Text>
70
+ <Text className={`kratos-tab-bar__text${active ? ' kratos-tab-bar__text--active' : ''}`}>
71
+ {item.title}
72
+ </Text>
71
73
  </View>
72
74
  )
73
75
  })}
@@ -0,0 +1,49 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.1
4
+ // protoc unknown
5
+ // source: base/v1/account.proto
6
+
7
+ /* eslint-disable */
8
+ import type { SecretCrypto } from "../../common/v1/types";
9
+ import type { Empty } from "../../google/protobuf/empty";
10
+
11
+ /** 获取当前用户密码策略请求参数。 */
12
+ export interface GetCurrentPasswordPolicyRequest {
13
+ }
14
+
15
+ /** 当前用户生效的密码策略。 */
16
+ export interface CurrentPasswordPolicy {
17
+ /** 密码最小长度 */
18
+ min_length: number;
19
+ /** 密码至少满足的字符类别数量 */
20
+ min_complexity_classes: number;
21
+ /** 禁止重复使用的历史密码数量 */
22
+ history_count: number;
23
+ /** 密码有效期天数 */
24
+ max_age_days: number;
25
+ }
26
+
27
+ /** 更新当前用户密码请求参数。 */
28
+ export interface UpdateUserPasswordRequest {
29
+ /** 当前用户密码 */
30
+ user_password: UserPasswordForm | undefined;
31
+ }
32
+
33
+ /** 当前用户密码表单。 */
34
+ export interface UserPasswordForm {
35
+ /** 原密码 */
36
+ old_pwd:
37
+ | SecretCrypto
38
+ | undefined;
39
+ /** 新密码 */
40
+ new_pwd: SecretCrypto | undefined;
41
+ }
42
+
43
+ /** Base 账户安全服务。 */
44
+ export interface AccountService {
45
+ /** 获取当前用户生效的密码策略。 */
46
+ GetCurrentPasswordPolicy(request: GetCurrentPasswordPolicyRequest): Promise<CurrentPasswordPolicy>;
47
+ /** 修改当前用户密码。 */
48
+ UpdateUserPassword(request: UpdateUserPasswordRequest): Promise<Empty>;
49
+ }
@@ -75,6 +75,57 @@ html.theme-dark page {
75
75
  * 取不到页面根类,用 theme store 镜像到 html 上的主题类着色。
76
76
  * ============================================================ */
77
77
  /* #ifdef h5 */
78
+ html .taro-modal__content {
79
+ box-sizing: border-box;
80
+ background: var(--kratos-color-surface-solid, #ffffff) !important;
81
+ color: var(--kratos-color-text, #102232) !important;
82
+ font-family: var(--kratos-font-sans, sans-serif);
83
+ }
84
+
85
+ html .taro-modal__content * {
86
+ box-sizing: border-box;
87
+ }
88
+
89
+ html .taro-modal__title {
90
+ padding: 16PX 24PX 8PX !important;
91
+ color: var(--kratos-color-text, #102232) !important;
92
+ font-size: 18PX !important;
93
+ line-height: 25PX !important;
94
+ }
95
+
96
+ html .taro-modal__text {
97
+ min-height: 40PX !important;
98
+ padding: 8PX 24PX 16PX !important;
99
+ color: var(--kratos-color-text-muted, #5a7083) !important;
100
+ font-size: 15PX !important;
101
+ line-height: 21PX !important;
102
+ }
103
+
104
+ html .taro-modal__foot {
105
+ font-size: 18PX !important;
106
+ line-height: 48PX !important;
107
+ }
108
+
109
+ html .taro-modal__foot::after {
110
+ position: absolute;
111
+ top: 0;
112
+ right: 0;
113
+ left: 0;
114
+ height: 1PX;
115
+ border-top: 1PX solid var(--kratos-color-border, #e3eaf2);
116
+ content: '';
117
+ transform: scaleY(0.5);
118
+ transform-origin: 0 0;
119
+ }
120
+
121
+ html .taro-model__confirm {
122
+ color: var(--kratos-color-primary, #039e8c) !important;
123
+ }
124
+
125
+ html .taro-model__cancel {
126
+ color: var(--kratos-color-text-muted, #5a7083) !important;
127
+ }
128
+
78
129
  html.theme-dark .taro-modal__mask {
79
130
  background: var(--kratos-color-mask) !important;
80
131
  }
@@ -526,11 +526,10 @@
526
526
  * ============================================================ */
527
527
  .k-set-cat {
528
528
  margin: 32px 4px 20px;
529
- font-size: 21px;
530
- letter-spacing: 2px;
531
- color: var(--kratos-color-text-dim);
532
- font-family: var(--kratos-font-mono);
533
- text-transform: uppercase;
529
+ color: var(--kratos-color-text-muted);
530
+ font-size: 26px;
531
+ font-family: var(--kratos-font-sans);
532
+ font-weight: 700;
534
533
  }
535
534
  .k-set-row {
536
535
  display: flex;
@@ -8,7 +8,7 @@ page {
8
8
  flex-direction: column;
9
9
  justify-content: center;
10
10
  min-height: 100vh;
11
- padding: 48px 40px calc(56px + env(safe-area-inset-bottom));
11
+ padding: 48px 20px calc(56px + env(safe-area-inset-bottom));
12
12
  background: var(--kratos-bg-gradient);
13
13
  box-sizing: border-box;
14
14
  }
@@ -24,7 +24,7 @@ page {
24
24
  align-items: center;
25
25
  justify-content: space-between;
26
26
  height: 44PX;
27
- padding: env(safe-area-inset-top) 28px 0;
27
+ padding: env(safe-area-inset-top) 20px 0;
28
28
  box-sizing: content-box;
29
29
  }
30
30