@liujitcn/kratos-taro-app-core 0.0.39 → 0.0.40
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
package/src/navigation.ts
CHANGED
|
@@ -306,7 +306,7 @@ export function navigateAppView(viewKey: string, params: Record<string, string>
|
|
|
306
306
|
navigateAppRoute(`${path}${query ? `?${query}` : ''}`)
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
/**
|
|
309
|
+
/** 自绘 tab 在 H5 直接切换,微信端优先复用原生 tab 或页面栈。 */
|
|
310
310
|
function navigateTabRoute(url: string): void {
|
|
311
311
|
const targetRoute = url.slice(1).split('?', 1)[0].replace(/^\/+/, '')
|
|
312
312
|
const pages = getCurrentPages()
|
|
@@ -318,6 +318,10 @@ function navigateTabRoute(url: string): void {
|
|
|
318
318
|
const release = () => {
|
|
319
319
|
if (tabNavigationTarget === targetRoute) tabNavigationTarget = undefined
|
|
320
320
|
}
|
|
321
|
+
if (process.env.TARO_ENV === 'h5') {
|
|
322
|
+
void Taro.reLaunch({ url }).then(release, release)
|
|
323
|
+
return
|
|
324
|
+
}
|
|
321
325
|
if (nativeTabViewKeys.some((viewKey) => resolveStaticView(viewKey) === targetRoute)) {
|
|
322
326
|
void Taro.switchTab({ url })
|
|
323
327
|
.then(release)
|
|
@@ -295,6 +295,16 @@
|
|
|
295
295
|
font-weight: 700;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
.mfa-remember-device {
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
gap: 10px;
|
|
302
|
+
margin: 4px 0 20px;
|
|
303
|
+
color: #53636d;
|
|
304
|
+
font-size: 24px;
|
|
305
|
+
line-height: 1.4;
|
|
306
|
+
}
|
|
307
|
+
|
|
298
308
|
.login-agreement {
|
|
299
309
|
display: flex;
|
|
300
310
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Image, Input, Picker, Text, View } from '@tarojs/components'
|
|
1
|
+
import { Button, Checkbox, Image, Input, Picker, Text, View } from '@tarojs/components'
|
|
2
2
|
import Taro, { useLoad } from '@tarojs/taro'
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
4
4
|
import defaultLogo from '@liujitcn/kratos-taro-app-core/static/images/logo_icon.png'
|
|
@@ -749,6 +749,16 @@ export default function LoginPage() {
|
|
|
749
749
|
placeholder={t('core.login.mfa_recovery_code')}
|
|
750
750
|
onInput={(event) => setMfaRecoveryCode(event.detail.value)}
|
|
751
751
|
/>
|
|
752
|
+
{mfaRememberDays > 0 ? (
|
|
753
|
+
<View className='mfa-remember-device'>
|
|
754
|
+
<Checkbox
|
|
755
|
+
value='remember'
|
|
756
|
+
checked={rememberMfaDevice}
|
|
757
|
+
onChange={(event) => setRememberMfaDevice(event.detail.value.includes('remember'))}
|
|
758
|
+
/>
|
|
759
|
+
<Text>{t('core.login.mfa_remember_device', { days: mfaRememberDays })}</Text>
|
|
760
|
+
</View>
|
|
761
|
+
) : null}
|
|
752
762
|
<Button
|
|
753
763
|
className='login-button login-button-primary'
|
|
754
764
|
loading={mfaLoading}
|