@liujitcn/kratos-uni-app-core 0.0.21 → 0.0.24
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/README.md +1 -1
- package/dist/module.mjs +653 -670
- package/dist/vite.mjs +5 -3
- package/package.json +1 -1
- package/src/api/base/language.ts +5 -5
- package/src/bootstrap.ts +1 -1
- package/src/locales/README.md +2 -2
- package/src/locales/en-US.json +65 -68
- package/src/locales/es-ES.json +88 -91
- package/src/locales/fr-FR.json +92 -95
- package/src/locales/generated.ts +22 -0
- package/src/locales/index.ts +48 -67
- package/src/locales/ja-JP.json +78 -81
- package/src/locales/ko-KR.json +87 -90
- package/src/locales/zh-CN.json +65 -68
- package/src/locales/zh-TW.json +65 -68
- package/src/module.ts +3 -17
- package/src/navigation.ts +70 -13
- package/src/rpc/base/v1/config.ts +12 -1
- package/src/rpc/base/v1/language.ts +7 -13
- package/src/rpc/base/v1/login.ts +14 -1
- package/src/stores/modules/setting.ts +3 -3
- package/src/utils/file.ts +2 -2
- package/src/utils/http.ts +5 -5
- package/src/utils/passwordCrypto.ts +14 -14
- package/src/views/pages/index/index.vue +12 -12
- package/src/views/pages/login/login.vue +47 -33
- package/src/views/pages/login/protocal.vue +2 -2
- package/src/views/pages/status/index.vue +9 -8
- package/src/views/pages/webview/webview.vue +4 -4
- package/src/vite.ts +4 -3
- package/src/rpc/base/v1/enum.ts +0 -54
- package/src/rpc/system/common/v1/enum.ts +0 -80
|
@@ -7,8 +7,8 @@ import { useI18n } from '../../../locales'
|
|
|
7
7
|
|
|
8
8
|
const settingStore = useSettingStore()
|
|
9
9
|
const { t } = useI18n()
|
|
10
|
-
const mainTitle = computed(() => settingStore.getData('mainTitle') || t('core.home.
|
|
11
|
-
const subTitle = computed(() => settingStore.getData('subTitle') || t('core.home.
|
|
10
|
+
const mainTitle = computed(() => settingStore.getData('mainTitle') || t('core.home.main_title'))
|
|
11
|
+
const subTitle = computed(() => settingStore.getData('subTitle') || t('core.home.sub_title'))
|
|
12
12
|
const appLogo = computed(() => settingStore.getData('appLogo') || defaultLogo)
|
|
13
13
|
|
|
14
14
|
onLoad(() => {
|
|
@@ -27,7 +27,7 @@ onLoad(() => {
|
|
|
27
27
|
</view>
|
|
28
28
|
|
|
29
29
|
<view class="section">
|
|
30
|
-
<text class="section-title">{{ t('core.home.
|
|
30
|
+
<text class="section-title">{{ t('core.home.tech_stack') }}</text>
|
|
31
31
|
<view class="info-list">
|
|
32
32
|
<view class="info-row">
|
|
33
33
|
<text class="info-label">{{ t('core.home.framework') }}</text>
|
|
@@ -38,38 +38,38 @@ onLoad(() => {
|
|
|
38
38
|
<text class="info-value">TypeScript</text>
|
|
39
39
|
</view>
|
|
40
40
|
<view class="info-row">
|
|
41
|
-
<text class="info-label">{{ t('core.home.
|
|
41
|
+
<text class="info-label">{{ t('core.home.state_management') }}</text>
|
|
42
42
|
<text class="info-value">Pinia</text>
|
|
43
43
|
</view>
|
|
44
44
|
<view class="info-row">
|
|
45
|
-
<text class="info-label">{{ t('core.home.
|
|
45
|
+
<text class="info-label">{{ t('core.home.style_solution') }}</text>
|
|
46
46
|
<text class="info-value">Sass + rpx</text>
|
|
47
47
|
</view>
|
|
48
48
|
</view>
|
|
49
49
|
</view>
|
|
50
50
|
|
|
51
51
|
<view class="section">
|
|
52
|
-
<text class="section-title">{{ t('core.home.
|
|
52
|
+
<text class="section-title">{{ t('core.home.demo_scope') }}</text>
|
|
53
53
|
<view class="demo-list">
|
|
54
54
|
<view class="demo-item">
|
|
55
55
|
<view class="demo-dot">1</view>
|
|
56
56
|
<view class="demo-copy">
|
|
57
|
-
<text class="demo-title">{{ t('core.home.
|
|
58
|
-
<text class="demo-desc">{{ t('core.home.
|
|
57
|
+
<text class="demo-title">{{ t('core.home.cross_platform') }}</text>
|
|
58
|
+
<text class="demo-desc">{{ t('core.home.cross_platform_description') }}</text>
|
|
59
59
|
</view>
|
|
60
60
|
</view>
|
|
61
61
|
<view class="demo-item">
|
|
62
62
|
<view class="demo-dot">2</view>
|
|
63
63
|
<view class="demo-copy">
|
|
64
|
-
<text class="demo-title">{{ t('core.home.
|
|
65
|
-
<text class="demo-desc">{{ t('core.home.
|
|
64
|
+
<text class="demo-title">{{ t('core.home.account_capability') }}</text>
|
|
65
|
+
<text class="demo-desc">{{ t('core.home.account_capability_description') }}</text>
|
|
66
66
|
</view>
|
|
67
67
|
</view>
|
|
68
68
|
<view class="demo-item">
|
|
69
69
|
<view class="demo-dot">3</view>
|
|
70
70
|
<view class="demo-copy">
|
|
71
|
-
<text class="demo-title">{{ t('core.home.
|
|
72
|
-
<text class="demo-desc">{{ t('core.home.
|
|
71
|
+
<text class="demo-title">{{ t('core.home.static_home') }}</text>
|
|
72
|
+
<text class="demo-desc">{{ t('core.home.static_home_description') }}</text>
|
|
73
73
|
</view>
|
|
74
74
|
</view>
|
|
75
75
|
</view>
|
|
@@ -19,7 +19,7 @@ const userStore = useUserStore()
|
|
|
19
19
|
const settingStore = useSettingStore()
|
|
20
20
|
const { locale, setLocale, t } = useI18n()
|
|
21
21
|
const localeOptions = computed(() => getLanguageOptions())
|
|
22
|
-
const localeLabels = computed(() => localeOptions.value.map((item) => item.
|
|
22
|
+
const localeLabels = computed(() => localeOptions.value.map((item) => item.native_name))
|
|
23
23
|
const localeIndex = computed(() =>
|
|
24
24
|
Math.max(
|
|
25
25
|
0,
|
|
@@ -31,10 +31,10 @@ const loginSettingsReady = ref(false)
|
|
|
31
31
|
let loginSettingsPromise: Promise<boolean> | undefined
|
|
32
32
|
|
|
33
33
|
const configuredMainTitle = computed(
|
|
34
|
-
() => settingStore.getData('mainTitle') || t('core.home.
|
|
34
|
+
() => settingStore.getData('mainTitle') || t('core.home.main_title'),
|
|
35
35
|
)
|
|
36
36
|
const configuredSubTitle = computed(
|
|
37
|
-
() => settingStore.getData('subTitle') || t('core.login.
|
|
37
|
+
() => settingStore.getData('subTitle') || t('core.login.default_sub_title'),
|
|
38
38
|
)
|
|
39
39
|
const configuredAppLogo = computed(() => settingStore.getData('appLogo') || defaultLogo)
|
|
40
40
|
const showTenantCode = computed(() => settingStore.getData('showTenantCode') !== 'false')
|
|
@@ -121,7 +121,7 @@ const resolveMiniCaptchaImage = (payload: string, captchaId: string) => {
|
|
|
121
121
|
data: payload.slice(commaIndex + 1),
|
|
122
122
|
encoding: 'base64',
|
|
123
123
|
success: () => resolve(filePath),
|
|
124
|
-
fail: () => reject(new Error(t('core.login.
|
|
124
|
+
fail: () => reject(new Error(t('core.login.captcha_write_failed'))),
|
|
125
125
|
})
|
|
126
126
|
})
|
|
127
127
|
}
|
|
@@ -137,7 +137,7 @@ const refreshMiniCaptcha = async () => {
|
|
|
137
137
|
miniForm.captcha_id = captcha.captcha_id
|
|
138
138
|
miniForm.captcha_code = ''
|
|
139
139
|
} catch {
|
|
140
|
-
await uni.showToast({ icon: 'none', title: t('core.login.
|
|
140
|
+
await uni.showToast({ icon: 'none', title: t('core.login.captcha_load_failed') })
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -171,7 +171,7 @@ const wxLogin = async () => {
|
|
|
171
171
|
try {
|
|
172
172
|
loginCode = (await wx.login()).code
|
|
173
173
|
} catch {
|
|
174
|
-
await uni.showToast({ icon: 'none', title: t('core.login.
|
|
174
|
+
await uni.showToast({ icon: 'none', title: t('core.login.wechat_failed') })
|
|
175
175
|
loading.value = false
|
|
176
176
|
return
|
|
177
177
|
}
|
|
@@ -188,7 +188,7 @@ const wxLogin = async () => {
|
|
|
188
188
|
await loginSuccess()
|
|
189
189
|
} catch (error) {
|
|
190
190
|
if (!isWechatUnboundError(error)) {
|
|
191
|
-
await uni.showToast({ icon: 'none', title: t('core.login.
|
|
191
|
+
await uni.showToast({ icon: 'none', title: t('core.login.wechat_failed') })
|
|
192
192
|
return
|
|
193
193
|
}
|
|
194
194
|
miniBinding.value = true
|
|
@@ -207,7 +207,7 @@ const bindMiniAccount = async () => {
|
|
|
207
207
|
return
|
|
208
208
|
}
|
|
209
209
|
if (!miniForm.user_name || !miniPasswordValue.value) {
|
|
210
|
-
await uni.showToast({ icon: 'none', title: t('core.login.
|
|
210
|
+
await uni.showToast({ icon: 'none', title: t('core.login.user_name_password') })
|
|
211
211
|
return
|
|
212
212
|
}
|
|
213
213
|
if (!miniForm.captcha_id || !miniForm.captcha_code) {
|
|
@@ -216,7 +216,10 @@ const bindMiniAccount = async () => {
|
|
|
216
216
|
}
|
|
217
217
|
loading.value = true
|
|
218
218
|
try {
|
|
219
|
-
const password = await encryptPassword(
|
|
219
|
+
const password = await encryptPassword(
|
|
220
|
+
miniPasswordValue.value,
|
|
221
|
+
PASSWORD_CRYPTO_SCENE.PASSWORD_CRYPTO_SCENE_LOGIN,
|
|
222
|
+
)
|
|
220
223
|
const code = (await wx.login()).code
|
|
221
224
|
await userStore.bindOauthSession({
|
|
222
225
|
provider: wechatMiniProvider,
|
|
@@ -338,7 +341,7 @@ const behaviorCaptchaConfig = computed(() => {
|
|
|
338
341
|
verticalPadding: 0,
|
|
339
342
|
horizontalPadding: 0,
|
|
340
343
|
iconSize: 20,
|
|
341
|
-
title: t('core.login.
|
|
344
|
+
title: t('core.login.behavior_rotate'),
|
|
342
345
|
}
|
|
343
346
|
}
|
|
344
347
|
return {
|
|
@@ -354,8 +357,8 @@ const behaviorCaptchaConfig = computed(() => {
|
|
|
354
357
|
dotSize: 20,
|
|
355
358
|
title:
|
|
356
359
|
currentCaptchaType.value === 'click'
|
|
357
|
-
? t('core.login.
|
|
358
|
-
: t('core.login.
|
|
360
|
+
? t('core.login.behavior_click')
|
|
361
|
+
: t('core.login.behavior_puzzle'),
|
|
359
362
|
}
|
|
360
363
|
})
|
|
361
364
|
const behaviorCaptchaTheme = {
|
|
@@ -377,11 +380,11 @@ const behaviorCaptchaTheme = {
|
|
|
377
380
|
const getCaptcha = async () => {
|
|
378
381
|
const requestedCaptchaType = configuredCaptchaType.value
|
|
379
382
|
if (!requestedCaptchaType) {
|
|
380
|
-
throw new Error(t('core.login.
|
|
383
|
+
throw new Error(t('core.login.captcha_type_missing'))
|
|
381
384
|
}
|
|
382
385
|
const data = await defLoginService.Captcha({ type: requestedCaptchaType })
|
|
383
386
|
if (!data.type) {
|
|
384
|
-
throw new Error(t('core.login.
|
|
387
|
+
throw new Error(t('core.login.captcha_type_response_missing'))
|
|
385
388
|
}
|
|
386
389
|
currentCaptchaType.value = data.type
|
|
387
390
|
if (!isBehaviorCaptcha.value) {
|
|
@@ -405,7 +408,7 @@ const refreshCaptcha = async () => {
|
|
|
405
408
|
behaviorDialogVisible.value = false
|
|
406
409
|
await uni.showToast({
|
|
407
410
|
icon: 'none',
|
|
408
|
-
title: error instanceof Error ? error.message : t('core.login.
|
|
411
|
+
title: error instanceof Error ? error.message : t('core.login.captcha_load_failed'),
|
|
409
412
|
})
|
|
410
413
|
return false
|
|
411
414
|
}
|
|
@@ -473,7 +476,7 @@ const validateLoginForm = async () => {
|
|
|
473
476
|
if (!form.value.user_name) {
|
|
474
477
|
await uni.showToast({
|
|
475
478
|
icon: 'none',
|
|
476
|
-
title: t('core.login.
|
|
479
|
+
title: t('core.login.user_name'),
|
|
477
480
|
})
|
|
478
481
|
return false
|
|
479
482
|
}
|
|
@@ -503,7 +506,10 @@ const verifyCaptchaToken = async (captchaCode: string) => {
|
|
|
503
506
|
}
|
|
504
507
|
// 执行真正的账号登录流程。
|
|
505
508
|
const submitLogin = async (captchaCode: string) => {
|
|
506
|
-
const password = await encryptPassword(
|
|
509
|
+
const password = await encryptPassword(
|
|
510
|
+
passwordValue.value,
|
|
511
|
+
PASSWORD_CRYPTO_SCENE.PASSWORD_CRYPTO_SCENE_LOGIN,
|
|
512
|
+
)
|
|
507
513
|
return userStore.login({
|
|
508
514
|
...form.value,
|
|
509
515
|
tenant_code: showTenantCode.value ? form.value.tenant_code : '0000',
|
|
@@ -591,7 +597,7 @@ const onSubmit = async () => {
|
|
|
591
597
|
const loginSuccess = async () => {
|
|
592
598
|
await userStore.getUserProfile()
|
|
593
599
|
// 成功提示
|
|
594
|
-
await uni.showToast({ icon: 'success', title: t('core.login.
|
|
600
|
+
await uni.showToast({ icon: 'success', title: t('core.login.login_success') })
|
|
595
601
|
setTimeout(() => {
|
|
596
602
|
const lastRoute = uni.getStorageSync('lastRoute') || homeTabPage
|
|
597
603
|
if (lastRoute.startsWith(homeTabPage)) {
|
|
@@ -610,7 +616,7 @@ const checkedAgreePrivacy = async () => {
|
|
|
610
616
|
}
|
|
611
617
|
|
|
612
618
|
if (!settingStore.getData('serviceProtocol') || !settingStore.getData('privacyProtocol')) {
|
|
613
|
-
await uni.showToast({ icon: 'none', title: t('core.login.
|
|
619
|
+
await uni.showToast({ icon: 'none', title: t('core.login.protocol_missing') })
|
|
614
620
|
return false
|
|
615
621
|
}
|
|
616
622
|
|
|
@@ -623,7 +629,7 @@ const checkedAgreePrivacy = async () => {
|
|
|
623
629
|
return new Promise<boolean>((resolve) => {
|
|
624
630
|
uni.showModal({
|
|
625
631
|
title: t('common.title.notice'),
|
|
626
|
-
content: t('core.login.
|
|
632
|
+
content: t('core.login.protocol_prompt'),
|
|
627
633
|
confirmText: t('common.action.confirm'),
|
|
628
634
|
cancelText: t('common.action.cancel'),
|
|
629
635
|
success: ({ confirm }) => {
|
|
@@ -654,7 +660,7 @@ const loadLoginSettings = () => {
|
|
|
654
660
|
// #ifdef H5
|
|
655
661
|
const captchaType = configuredCaptchaType.value
|
|
656
662
|
if (!captchaType) {
|
|
657
|
-
throw new Error(t('core.login.
|
|
663
|
+
throw new Error(t('core.login.captcha_type_missing'))
|
|
658
664
|
}
|
|
659
665
|
currentCaptchaType.value = captchaType
|
|
660
666
|
await loadPageCaptcha()
|
|
@@ -667,7 +673,7 @@ const loadLoginSettings = () => {
|
|
|
667
673
|
} catch (error) {
|
|
668
674
|
await uni.showToast({
|
|
669
675
|
icon: 'none',
|
|
670
|
-
title: error instanceof Error ? error.message : t('core.protocol.
|
|
676
|
+
title: error instanceof Error ? error.message : t('core.protocol.load_failed'),
|
|
671
677
|
})
|
|
672
678
|
loginSettingsPromise = undefined
|
|
673
679
|
return false
|
|
@@ -722,7 +728,7 @@ onLoad(() => {
|
|
|
722
728
|
class="login-input"
|
|
723
729
|
type="text"
|
|
724
730
|
confirm-type="next"
|
|
725
|
-
:placeholder="t('core.login.
|
|
731
|
+
:placeholder="t('core.login.user_name_mobile')"
|
|
726
732
|
@confirm="onSubmit"
|
|
727
733
|
/>
|
|
728
734
|
<input
|
|
@@ -760,7 +766,7 @@ onLoad(() => {
|
|
|
760
766
|
<view v-if="behaviorDialogVisible" class="login-behavior-mask">
|
|
761
767
|
<view class="login-behavior-panel">
|
|
762
768
|
<view v-if="behaviorLoading" class="login-behavior-loading">{{
|
|
763
|
-
t('core.login.
|
|
769
|
+
t('core.login.behavior_loading')
|
|
764
770
|
}}</view>
|
|
765
771
|
<GoCaptchaUni
|
|
766
772
|
:type="currentCaptchaType"
|
|
@@ -787,7 +793,7 @@ onLoad(() => {
|
|
|
787
793
|
{{ t('core.login.wechat') }}
|
|
788
794
|
</button>
|
|
789
795
|
<view v-else class="login-form">
|
|
790
|
-
<view class="login-bind-tip">{{ t('core.login.
|
|
796
|
+
<view class="login-bind-tip">{{ t('core.login.wechat_bind_tip') }}</view>
|
|
791
797
|
<input
|
|
792
798
|
v-if="showTenantCode"
|
|
793
799
|
v-model="miniForm.tenant_code"
|
|
@@ -799,7 +805,7 @@ onLoad(() => {
|
|
|
799
805
|
v-model="miniForm.user_name"
|
|
800
806
|
class="login-input"
|
|
801
807
|
type="text"
|
|
802
|
-
:placeholder="t('core.login.
|
|
808
|
+
:placeholder="t('core.login.user_name_mobile')"
|
|
803
809
|
/>
|
|
804
810
|
<input
|
|
805
811
|
v-model="miniPasswordValue"
|
|
@@ -825,7 +831,7 @@ onLoad(() => {
|
|
|
825
831
|
:loading="loading"
|
|
826
832
|
@tap="bindMiniAccount"
|
|
827
833
|
>
|
|
828
|
-
{{ t('core.login.
|
|
834
|
+
{{ t('core.login.bind_wechat') }}
|
|
829
835
|
</button>
|
|
830
836
|
</view>
|
|
831
837
|
<!-- #endif -->
|
|
@@ -833,11 +839,11 @@ onLoad(() => {
|
|
|
833
839
|
<view class="login-tips" :class="{ animate__shakeY: isAgreePrivacyShakeY }">
|
|
834
840
|
<view class="login-agreement" @tap="toggleAgreePrivacy">
|
|
835
841
|
<view class="login-agree-icon" :class="{ checked: isAgreePrivacy }"></view>
|
|
836
|
-
<text class="login-agree-desc">{{ t('core.login.
|
|
842
|
+
<text class="login-agree-desc">{{ t('core.login.agree_prefix') }}</text>
|
|
837
843
|
<text class="login-agree-link" @tap.stop="onOpenServiceProtocol">{{
|
|
838
844
|
t('core.login.service')
|
|
839
845
|
}}</text>
|
|
840
|
-
<text class="login-agree-separator">{{ t('core.login.
|
|
846
|
+
<text class="login-agree-separator">{{ t('core.login.agree_separator') }}</text>
|
|
841
847
|
<text class="login-agree-link" @tap.stop="onOpenPrivacyContract">{{
|
|
842
848
|
t('core.login.privacy')
|
|
843
849
|
}}</text>
|
|
@@ -1149,16 +1155,22 @@ onLoad(() => {
|
|
|
1149
1155
|
.login-agreement {
|
|
1150
1156
|
display: flex;
|
|
1151
1157
|
align-items: center;
|
|
1158
|
+
flex-wrap: wrap;
|
|
1152
1159
|
justify-content: center;
|
|
1160
|
+
width: 100%;
|
|
1161
|
+
max-width: 100%;
|
|
1162
|
+
min-width: 0;
|
|
1153
1163
|
gap: 6rpx;
|
|
1154
|
-
|
|
1164
|
+
box-sizing: border-box;
|
|
1155
1165
|
}
|
|
1156
1166
|
|
|
1157
1167
|
.login-agree-separator {
|
|
1158
|
-
|
|
1168
|
+
min-width: 0;
|
|
1169
|
+
overflow-wrap: anywhere;
|
|
1159
1170
|
}
|
|
1160
1171
|
|
|
1161
1172
|
.login-agree-icon {
|
|
1173
|
+
flex: 0 0 auto;
|
|
1162
1174
|
width: 26rpx;
|
|
1163
1175
|
height: 26rpx;
|
|
1164
1176
|
margin-right: 2rpx;
|
|
@@ -1175,13 +1187,15 @@ onLoad(() => {
|
|
|
1175
1187
|
}
|
|
1176
1188
|
|
|
1177
1189
|
.login-agree-link {
|
|
1178
|
-
|
|
1190
|
+
min-width: 0;
|
|
1191
|
+
overflow-wrap: anywhere;
|
|
1179
1192
|
color: #28bb9c;
|
|
1180
1193
|
}
|
|
1181
1194
|
|
|
1182
1195
|
.login-agree-desc {
|
|
1196
|
+
min-width: 0;
|
|
1197
|
+
overflow-wrap: anywhere;
|
|
1183
1198
|
color: #9ca3af;
|
|
1184
|
-
white-space: nowrap;
|
|
1185
1199
|
}
|
|
1186
1200
|
}
|
|
1187
1201
|
</style>
|
|
@@ -55,7 +55,7 @@ const loadProtocol = async (type?: string) => {
|
|
|
55
55
|
await settingStore.loadData()
|
|
56
56
|
const protocol = settingStore.getData(key)
|
|
57
57
|
if (!protocol) {
|
|
58
|
-
throw new Error(t('core.protocol.
|
|
58
|
+
throw new Error(t('core.protocol.not_configured', { title }))
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
await uni.setNavigationBarTitle({ title })
|
|
@@ -63,7 +63,7 @@ const loadProtocol = async (type?: string) => {
|
|
|
63
63
|
} catch (error) {
|
|
64
64
|
await uni.showToast({
|
|
65
65
|
icon: 'none',
|
|
66
|
-
title: error instanceof Error ? error.message : t('core.protocol.
|
|
66
|
+
title: error instanceof Error ? error.message : t('core.protocol.load_failed'),
|
|
67
67
|
})
|
|
68
68
|
setTimeout(() => {
|
|
69
69
|
uni.navigateBack()
|
|
@@ -13,18 +13,19 @@ const stateTitle = computed(() =>
|
|
|
13
13
|
state.value === 'BOOTSTRAP_LOADING' ? t('core.status.loading') : t(`core.status.${state.value}`),
|
|
14
14
|
)
|
|
15
15
|
|
|
16
|
-
onLoad(
|
|
16
|
+
onLoad((options) => {
|
|
17
17
|
state.value = (options?.state as BootstrapViewKey | undefined) ?? 'BOOTSTRAP_LOADING'
|
|
18
18
|
detail.value = options?.detail ? decodeURIComponent(options.detail) : ''
|
|
19
19
|
if (options?.bootstrap !== '1') return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
void initializeAppNavigation()
|
|
21
|
+
.then(() => {
|
|
22
|
+
navigateAppRoute(options?.route ? decodeURIComponent(options.route) : 'app/home', {
|
|
23
|
+
replace: true,
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
.catch((error) => {
|
|
27
|
+
launchAppStatus('CONFIG_ERROR', error instanceof Error ? error.message : String(error))
|
|
24
28
|
})
|
|
25
|
-
} catch (error) {
|
|
26
|
-
launchAppStatus('CONFIG_ERROR', error instanceof Error ? error.message : String(error))
|
|
27
|
-
}
|
|
28
29
|
})
|
|
29
30
|
</script>
|
|
30
31
|
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
<!-- #endif -->
|
|
18
18
|
|
|
19
19
|
<view v-if="showFallback" class="webview-empty">
|
|
20
|
-
<view class="webview-empty__title">{{ t('core.webview.
|
|
20
|
+
<view class="webview-empty__title">{{ t('core.webview.open_failed') }}</view>
|
|
21
21
|
<view class="webview-empty__desc">{{ emptyDesc }}</view>
|
|
22
22
|
</view>
|
|
23
23
|
|
|
24
24
|
<!-- #ifdef H5 -->
|
|
25
25
|
<!-- X-Frame-Options 拒绝嵌入时浏览器仍可能触发 iframe load,始终保留外部打开入口。 -->
|
|
26
26
|
<button v-if="isH5 && url && isIframeTimedOut" class="webview-open-button" @tap="openInBrowser">
|
|
27
|
-
{{ t('common.action.
|
|
27
|
+
{{ t('common.action.open_in_new_window') }}
|
|
28
28
|
</button>
|
|
29
29
|
<!-- #endif -->
|
|
30
30
|
</view>
|
|
@@ -46,9 +46,9 @@ const showFallback = computed(
|
|
|
46
46
|
)
|
|
47
47
|
const emptyDesc = computed(() => {
|
|
48
48
|
if (!url.value) {
|
|
49
|
-
return t('core.webview.
|
|
49
|
+
return t('core.webview.invalid_url')
|
|
50
50
|
}
|
|
51
|
-
return t('core.webview.
|
|
51
|
+
return t('core.webview.embed_blocked')
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
onLoad((query) => {
|
package/src/vite.ts
CHANGED
|
@@ -582,6 +582,7 @@ function scanViews(root: string): Array<{ route: string; source: string }> {
|
|
|
582
582
|
function appendPage(manifest: PagesManifest, page: ScannedPage): void {
|
|
583
583
|
const [first, ...rest] = page.route.split('/')
|
|
584
584
|
if (!first.startsWith('pages') || first === 'pages') {
|
|
585
|
+
if (manifest.pages.some((item) => normalizeRoute(item.path) === page.route)) return
|
|
585
586
|
manifest.pages.push({ path: page.route, style: page.style })
|
|
586
587
|
return
|
|
587
588
|
}
|
|
@@ -591,22 +592,22 @@ function appendPage(manifest: PagesManifest, page: ScannedPage): void {
|
|
|
591
592
|
subPackage = { root: first, pages: [] }
|
|
592
593
|
manifest.subPackages.push(subPackage)
|
|
593
594
|
}
|
|
595
|
+
if (subPackage.pages.some((item) => normalizeRoute(`${first}/${item.path}`) === page.route))
|
|
596
|
+
return
|
|
594
597
|
subPackage.pages.push({ path: rest.join('/'), style: page.style })
|
|
595
598
|
}
|
|
596
599
|
|
|
597
600
|
function createPageWrapper(page: ScannedPage): string {
|
|
598
601
|
const source = page.source.replace(/\\/g, '/')
|
|
599
602
|
return `<script setup lang="ts">
|
|
600
|
-
import type { Component } from 'vue'
|
|
601
603
|
import KratosPage from ${JSON.stringify(source)}
|
|
602
604
|
import KratosTabBar from '@liujitcn/kratos-uni-app-core/components/KratosTabBar.vue'
|
|
603
605
|
|
|
604
606
|
defineOptions({ inheritAttrs: false })
|
|
605
|
-
const Page = KratosPage as Component
|
|
606
607
|
</script>
|
|
607
608
|
|
|
608
609
|
<template>
|
|
609
|
-
<
|
|
610
|
+
<KratosPage v-bind="$attrs" />
|
|
610
611
|
<KratosTabBar route=${JSON.stringify(page.route)} />
|
|
611
612
|
</template>
|
|
612
613
|
`
|
package/src/rpc/base/v1/enum.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.8
|
|
4
|
-
// protoc unknown
|
|
5
|
-
// source: base/v1/enum.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
/** AI 助手消息状态 */
|
|
10
|
-
export enum AiMessageStatus {
|
|
11
|
-
/** UNKNOWN_AMS - 未知AI助手消息状态 */
|
|
12
|
-
UNKNOWN_AMS = 0,
|
|
13
|
-
/** GENERATING_AMS - 生成中 */
|
|
14
|
-
GENERATING_AMS = 1,
|
|
15
|
-
/** SUCCESS_AMS - 成功 */
|
|
16
|
-
SUCCESS_AMS = 2,
|
|
17
|
-
/** FAILED_AMS - 失败 */
|
|
18
|
-
FAILED_AMS = 3,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** 终端类型 */
|
|
22
|
-
export enum Terminal {
|
|
23
|
-
/** UNKNOWN_TERMINAL - 未知终端 */
|
|
24
|
-
UNKNOWN_TERMINAL = 0,
|
|
25
|
-
/** TERMINAL_APP - 移动端 */
|
|
26
|
-
TERMINAL_APP = 1,
|
|
27
|
-
/** TERMINAL_ADMIN - 管理端 */
|
|
28
|
-
TERMINAL_ADMIN = 2,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** 系统配置位置 */
|
|
32
|
-
export enum BaseConfigSite {
|
|
33
|
-
UNKNOWN_BCS = 0,
|
|
34
|
-
/** SYSTEM - 系统内使用 */
|
|
35
|
-
SYSTEM = 1,
|
|
36
|
-
/** ADMIN - 管理端 */
|
|
37
|
-
ADMIN = 2,
|
|
38
|
-
/** APP - 移动端 */
|
|
39
|
-
APP = 3,
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** 密码加密场景枚举 */
|
|
43
|
-
export enum PasswordCryptoScene {
|
|
44
|
-
/** UNKNOWN_PCS - 未指定密码加密场景 */
|
|
45
|
-
UNKNOWN_PCS = 0,
|
|
46
|
-
/** LOGIN - 登录密码加密场景 */
|
|
47
|
-
LOGIN = 1,
|
|
48
|
-
/** CREATE_BASE_USER - 新增后台用户密码加密场景 */
|
|
49
|
-
CREATE_BASE_USER = 2,
|
|
50
|
-
/** RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景 */
|
|
51
|
-
RESET_BASE_USER_PASSWORD = 3,
|
|
52
|
-
/** UPDATE_USER_PASSWORD - 个人修改密码加密场景 */
|
|
53
|
-
UPDATE_USER_PASSWORD = 4,
|
|
54
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.8
|
|
4
|
-
// protoc unknown
|
|
5
|
-
// source: system/common/v1/enum.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
/** 系统配置类型 */
|
|
10
|
-
export enum BaseConfigType {
|
|
11
|
-
UNKNOWN_BCT = 0,
|
|
12
|
-
/** TEXT - 文本 */
|
|
13
|
-
TEXT = 1,
|
|
14
|
-
/** IMAGE - 图片 */
|
|
15
|
-
IMAGE = 2,
|
|
16
|
-
/** RICH_TEXT - 富文本 */
|
|
17
|
-
RICH_TEXT = 3,
|
|
18
|
-
/** DICT - 字典 */
|
|
19
|
-
DICT = 4,
|
|
20
|
-
/** BOOLEAN - 布尔 */
|
|
21
|
-
BOOLEAN = 5,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** 定时任务日志状态 */
|
|
25
|
-
export enum BaseJobLogStatus {
|
|
26
|
-
UNKNOWN_BJLS = 0,
|
|
27
|
-
/** SUCCESS - 成功 */
|
|
28
|
-
SUCCESS = 1,
|
|
29
|
-
/** FAIL - 失败 */
|
|
30
|
-
FAIL = 2,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** 菜单类型 */
|
|
34
|
-
export enum BaseMenuType {
|
|
35
|
-
UNKNOWN_MT = 0,
|
|
36
|
-
/** FOLDER - 目录 */
|
|
37
|
-
FOLDER = 1,
|
|
38
|
-
/** MENU - 菜单 */
|
|
39
|
-
MENU = 2,
|
|
40
|
-
/** BUTTON - 按钮 */
|
|
41
|
-
BUTTON = 3,
|
|
42
|
-
/** EXT_LINK - 外部链接 */
|
|
43
|
-
EXT_LINK = 4,
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** 角色数据范围 */
|
|
47
|
-
export enum BaseRoleDataScope {
|
|
48
|
-
UNKNOWN_RDS = 0,
|
|
49
|
-
/** ALL - 全部数据 */
|
|
50
|
-
ALL = 1,
|
|
51
|
-
/** DEPT_AND_CHILDREN - 部门及子部门数据 */
|
|
52
|
-
DEPT_AND_CHILDREN = 2,
|
|
53
|
-
/** SELF_DEPT - 本部门数据 */
|
|
54
|
-
SELF_DEPT = 3,
|
|
55
|
-
/** SELF_USER - 本人数据 */
|
|
56
|
-
SELF_USER = 4,
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** 用户性别 */
|
|
60
|
-
export enum BaseUserGender {
|
|
61
|
-
UNKNOWN_BUG = 0,
|
|
62
|
-
/** SECRET - 保密 */
|
|
63
|
-
SECRET = 1,
|
|
64
|
-
/** BOY - 男 */
|
|
65
|
-
BOY = 2,
|
|
66
|
-
/** GIRL - 禁用 */
|
|
67
|
-
GIRL = 3,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** 代码生成表状态 */
|
|
71
|
-
export enum CodeGenTableStatus {
|
|
72
|
-
/** UNKNOWN_CGTS - 未指定 */
|
|
73
|
-
UNKNOWN_CGTS = 0,
|
|
74
|
-
/** DRAFT_CGTS - 草稿 */
|
|
75
|
-
DRAFT_CGTS = 1,
|
|
76
|
-
/** GENERATED_CGTS - 已生成 */
|
|
77
|
-
GENERATED_CGTS = 2,
|
|
78
|
-
/** DISABLED_CGTS - 停用 */
|
|
79
|
-
DISABLED_CGTS = 3,
|
|
80
|
-
}
|