@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.
Files changed (77) hide show
  1. package/README.md +36 -0
  2. package/dist/build.mjs +38 -0
  3. package/dist/runner.mjs +321 -0
  4. package/package.json +51 -0
  5. package/src/api/base/config.ts +20 -0
  6. package/src/api/base/file.ts +57 -0
  7. package/src/api/base/login.ts +87 -0
  8. package/src/api/base/menu.ts +17 -0
  9. package/src/api/base/oauth.ts +149 -0
  10. package/src/api/system/auth.ts +54 -0
  11. package/src/api/system/base_area.ts +34 -0
  12. package/src/api/system/base_dict.ts +24 -0
  13. package/src/bootstrap.ts +32 -0
  14. package/src/build.ts +24 -0
  15. package/src/components/BootstrapStatus.scss +28 -0
  16. package/src/components/BootstrapStatus.tsx +25 -0
  17. package/src/components/KratosPageFrame.scss +41 -0
  18. package/src/components/KratosPageFrame.tsx +51 -0
  19. package/src/components/KratosTabBar.scss +34 -0
  20. package/src/components/KratosTabBar.tsx +45 -0
  21. package/src/index.ts +36 -0
  22. package/src/module.ts +63 -0
  23. package/src/navigation-pattern.d.mts +2 -0
  24. package/src/navigation-pattern.mjs +29 -0
  25. package/src/navigation-tree.d.mts +12 -0
  26. package/src/navigation-tree.mjs +45 -0
  27. package/src/navigation.ts +336 -0
  28. package/src/pages.ts +21 -0
  29. package/src/rpc/base/v1/config.ts +34 -0
  30. package/src/rpc/base/v1/file.ts +66 -0
  31. package/src/rpc/base/v1/login.ts +128 -0
  32. package/src/rpc/base/v1/mcp.ts +20 -0
  33. package/src/rpc/base/v1/oauth.ts +199 -0
  34. package/src/rpc/base/v1/sse.ts +22 -0
  35. package/src/rpc/common/v1/common.ts +71 -0
  36. package/src/rpc/common/v1/enum.ts +71 -0
  37. package/src/rpc/common/v1/types.ts +77 -0
  38. package/src/rpc/google/protobuf/empty.ts +19 -0
  39. package/src/rpc/google/protobuf/wrappers.ts +124 -0
  40. package/src/rpc/system/app/v1/auth.ts +54 -0
  41. package/src/rpc/system/app/v1/base_area.ts +24 -0
  42. package/src/rpc/system/app/v1/base_dict.ts +37 -0
  43. package/src/rpc/system/app/v1/base_menu.ts +61 -0
  44. package/src/rpc/system/common/v1/enum.ts +80 -0
  45. package/src/runner.ts +390 -0
  46. package/src/static/images/avatar.png +0 -0
  47. package/src/static/images/center_bg.png +0 -0
  48. package/src/static/images/logo_icon.png +0 -0
  49. package/src/static/images/navigator_bg.png +0 -0
  50. package/src/static/tabs/home_default.png +0 -0
  51. package/src/static/tabs/home_selected.png +0 -0
  52. package/src/static/tabs/user_default.png +0 -0
  53. package/src/static/tabs/user_selected.png +0 -0
  54. package/src/stores/index.ts +2 -0
  55. package/src/stores/setting.ts +43 -0
  56. package/src/stores/user.ts +152 -0
  57. package/src/styles/base.scss +45 -0
  58. package/src/types/assets.d.ts +9 -0
  59. package/src/utils/auth.ts +55 -0
  60. package/src/utils/file.ts +48 -0
  61. package/src/utils/http.ts +262 -0
  62. package/src/utils/index.ts +35 -0
  63. package/src/utils/navigation.ts +72 -0
  64. package/src/utils/passwordCrypto.ts +257 -0
  65. package/src/views/pages/index/index.scss +137 -0
  66. package/src/views/pages/index/index.tsx +74 -0
  67. package/src/views/pages/login/components/BehaviorCaptcha.h5.tsx +46 -0
  68. package/src/views/pages/login/components/BehaviorCaptcha.tsx +6 -0
  69. package/src/views/pages/login/components/BehaviorCaptcha.weapp.tsx +6 -0
  70. package/src/views/pages/login/components/types.ts +32 -0
  71. package/src/views/pages/login/login.scss +310 -0
  72. package/src/views/pages/login/login.tsx +493 -0
  73. package/src/views/pages/login/protocal.scss +84 -0
  74. package/src/views/pages/login/protocal.tsx +73 -0
  75. package/src/views/pages/status/index.tsx +42 -0
  76. package/src/views/pages/webview/webview.scss +43 -0
  77. 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
+ }