@liujitcn/kratos-taro-app-core 0.0.1
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 +36 -0
- package/dist/build.mjs +38 -0
- package/dist/runner.mjs +321 -0
- package/package.json +51 -0
- package/src/api/base/config.ts +20 -0
- package/src/api/base/file.ts +57 -0
- package/src/api/base/login.ts +87 -0
- package/src/api/base/menu.ts +17 -0
- package/src/api/base/oauth.ts +149 -0
- package/src/api/system/auth.ts +54 -0
- package/src/api/system/base_area.ts +34 -0
- package/src/api/system/base_dict.ts +24 -0
- package/src/bootstrap.ts +32 -0
- package/src/build.ts +24 -0
- package/src/components/BootstrapStatus.scss +28 -0
- package/src/components/BootstrapStatus.tsx +25 -0
- package/src/components/KratosPageFrame.scss +41 -0
- package/src/components/KratosPageFrame.tsx +51 -0
- package/src/components/KratosTabBar.scss +34 -0
- package/src/components/KratosTabBar.tsx +45 -0
- package/src/index.ts +36 -0
- package/src/module.ts +63 -0
- package/src/navigation-pattern.d.mts +2 -0
- package/src/navigation-pattern.mjs +29 -0
- package/src/navigation-tree.d.mts +12 -0
- package/src/navigation-tree.mjs +45 -0
- package/src/navigation.ts +336 -0
- package/src/pages.ts +21 -0
- package/src/rpc/base/v1/config.ts +34 -0
- package/src/rpc/base/v1/file.ts +66 -0
- package/src/rpc/base/v1/login.ts +128 -0
- package/src/rpc/base/v1/mcp.ts +20 -0
- package/src/rpc/base/v1/oauth.ts +199 -0
- package/src/rpc/base/v1/sse.ts +22 -0
- package/src/rpc/common/v1/common.ts +71 -0
- package/src/rpc/common/v1/enum.ts +71 -0
- package/src/rpc/common/v1/types.ts +77 -0
- package/src/rpc/google/protobuf/empty.ts +19 -0
- package/src/rpc/google/protobuf/wrappers.ts +124 -0
- package/src/rpc/system/app/v1/auth.ts +54 -0
- package/src/rpc/system/app/v1/base_area.ts +24 -0
- package/src/rpc/system/app/v1/base_dict.ts +37 -0
- package/src/rpc/system/app/v1/base_menu.ts +61 -0
- package/src/rpc/system/common/v1/enum.ts +80 -0
- package/src/runner.ts +390 -0
- package/src/static/images/avatar.png +0 -0
- package/src/static/images/center_bg.png +0 -0
- package/src/static/images/logo_icon.png +0 -0
- package/src/static/images/navigator_bg.png +0 -0
- package/src/static/tabs/home_default.png +0 -0
- package/src/static/tabs/home_selected.png +0 -0
- package/src/static/tabs/user_default.png +0 -0
- package/src/static/tabs/user_selected.png +0 -0
- package/src/stores/index.ts +2 -0
- package/src/stores/setting.ts +43 -0
- package/src/stores/user.ts +152 -0
- package/src/styles/base.scss +45 -0
- package/src/types/assets.d.ts +9 -0
- package/src/utils/auth.ts +55 -0
- package/src/utils/file.ts +48 -0
- package/src/utils/http.ts +262 -0
- package/src/utils/index.ts +35 -0
- package/src/utils/navigation.ts +72 -0
- package/src/utils/passwordCrypto.ts +257 -0
- package/src/views/pages/index/index.scss +137 -0
- package/src/views/pages/index/index.tsx +74 -0
- package/src/views/pages/login/components/BehaviorCaptcha.h5.tsx +46 -0
- package/src/views/pages/login/components/BehaviorCaptcha.tsx +6 -0
- package/src/views/pages/login/components/BehaviorCaptcha.weapp.tsx +6 -0
- package/src/views/pages/login/components/types.ts +32 -0
- package/src/views/pages/login/login.scss +310 -0
- package/src/views/pages/login/login.tsx +493 -0
- package/src/views/pages/login/protocal.scss +84 -0
- package/src/views/pages/login/protocal.tsx +73 -0
- package/src/views/pages/status/index.tsx +42 -0
- package/src/views/pages/webview/webview.scss +43 -0
- package/src/views/pages/webview/webview.tsx +41 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.webview-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
flex: 1;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.webview-empty {
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
padding: 48px;
|
|
15
|
+
text-align: center;
|
|
16
|
+
background-color: #fff;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.webview-empty__title {
|
|
20
|
+
font-size: 32px;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
color: #333;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.webview-empty__desc {
|
|
26
|
+
margin-top: 16px;
|
|
27
|
+
font-size: 26px;
|
|
28
|
+
color: #888;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.webview-open-button {
|
|
32
|
+
position: fixed;
|
|
33
|
+
right: 24px;
|
|
34
|
+
bottom: 96px;
|
|
35
|
+
z-index: 2;
|
|
36
|
+
width: 240px;
|
|
37
|
+
height: 72px;
|
|
38
|
+
line-height: 72px;
|
|
39
|
+
border-radius: 72px;
|
|
40
|
+
background-color: #27ba9b;
|
|
41
|
+
color: #fff;
|
|
42
|
+
font-size: 26px;
|
|
43
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Button, Text, View, WebView } from '@tarojs/components'
|
|
2
|
+
import Taro, { useLoad } from '@tarojs/taro'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import './webview.scss'
|
|
5
|
+
|
|
6
|
+
/** 统一外链承载页。 */
|
|
7
|
+
export default function WebViewPage() {
|
|
8
|
+
const [url, setUrl] = useState('')
|
|
9
|
+
|
|
10
|
+
useLoad((query) => {
|
|
11
|
+
const nextUrl = decodeURIComponent(query?.url || '')
|
|
12
|
+
const title = decodeURIComponent(query?.title || '')
|
|
13
|
+
setUrl(nextUrl)
|
|
14
|
+
if (title) void Taro.setNavigationBarTitle({ title })
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
if (!url) {
|
|
18
|
+
return (
|
|
19
|
+
<View className='webview-container'>
|
|
20
|
+
<View className='webview-empty'>
|
|
21
|
+
<Text className='webview-empty__title'>链接无法打开</Text>
|
|
22
|
+
<Text className='webview-empty__desc'>缺少有效链接地址</Text>
|
|
23
|
+
</View>
|
|
24
|
+
</View>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<View className='webview-container'>
|
|
30
|
+
<WebView src={url} onMessage={(event) => console.log('收到H5消息:', event.detail)} />
|
|
31
|
+
{process.env.TARO_ENV === 'h5' ? (
|
|
32
|
+
<Button
|
|
33
|
+
className='webview-open-button'
|
|
34
|
+
onClick={() => window.open(url, '_blank', 'noopener,noreferrer')}
|
|
35
|
+
>
|
|
36
|
+
新窗口打开
|
|
37
|
+
</Button>
|
|
38
|
+
) : null}
|
|
39
|
+
</View>
|
|
40
|
+
)
|
|
41
|
+
}
|