create-young-proj 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/template-uni-app/.vscode/vue-html.code-snippets +14 -0
  3. package/template-uni-app/README.md +24 -1
  4. package/template-uni-app/_env +3 -1
  5. package/template-uni-app/auto-imports.d.ts +3 -0
  6. package/template-uni-app/components.d.ts +1 -4
  7. package/template-uni-app/custom-plugins/multiconf.ts +3 -4
  8. package/template-uni-app/manifest.config.ts +88 -0
  9. package/template-uni-app/package.json +7 -0
  10. package/template-uni-app/pages.config.ts +58 -0
  11. package/template-uni-app/pnpm-lock.yaml +212 -1
  12. package/template-uni-app/src/App.vue +6 -1
  13. package/template-uni-app/src/apis/index.ts +17 -3
  14. package/template-uni-app/src/components/young-loading/young-loading.vue +2 -2
  15. package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +38 -0
  16. package/template-uni-app/src/components/young-navbar/young-navbar.vue +3 -3
  17. package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +14 -10
  18. package/template-uni-app/src/config/enum.ts +4 -3
  19. package/template-uni-app/src/env.d.ts +5 -4
  20. package/template-uni-app/src/layouts/default.vue +24 -0
  21. package/template-uni-app/src/layouts/tabbar.vue +28 -0
  22. package/template-uni-app/src/manifest.json +1 -9
  23. package/template-uni-app/src/pages/demo/index.vue +24 -0
  24. package/template-uni-app/src/pages/index.vue +22 -34
  25. package/template-uni-app/src/pages/my.vue +18 -22
  26. package/template-uni-app/src/pages.json +23 -18
  27. package/template-uni-app/src/static/back.png +0 -0
  28. package/template-uni-app/src/static/h.png +0 -0
  29. package/template-uni-app/src/static/home.png +0 -0
  30. package/template-uni-app/src/static/home_active.png +0 -0
  31. package/template-uni-app/src/static/more.png +0 -0
  32. package/template-uni-app/src/static/my.png +0 -0
  33. package/template-uni-app/src/static/my_active.png +0 -0
  34. package/template-uni-app/src/static/network.png +0 -0
  35. package/template-uni-app/src/store/system.ts +10 -2
  36. package/template-uni-app/src/utils/map.ts +3 -2
  37. package/template-uni-app/src/utils/system.ts +2 -2
  38. package/template-uni-app/tsconfig.json +5 -2
  39. package/template-uni-app/vite.config.ts +20 -24
  40. package/template-uni-app/volar.config.js +6 -0
  41. package/template-uni-app/src/components/young-tabbar-layout/young-tabbar-layout.vue +0 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-young-proj",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "create project from template",
5
5
  "main": "index.mjs",
6
6
  "bin": {
@@ -664,5 +664,19 @@
664
664
  "prefix": "viewclass",
665
665
  "scope": "vue-html",
666
666
  "triggerAssist": true
667
+ },
668
+ "route": {
669
+ "body": [
670
+ "<route lang=\"json\">",
671
+ "{",
672
+ " \"needLogin\": false,",
673
+ " \"style\": {",
674
+ "",
675
+ " }",
676
+ "}",
677
+ "</route>"
678
+ ],
679
+ "prefix": "<route",
680
+ "description": "页面配置",
667
681
  }
668
682
  }
@@ -11,10 +11,33 @@
11
11
  - 📦 自动按需导入组件和 `API`, 减少冗余代码, 自定义的组件和方法亦可自动导入
12
12
 
13
13
  - 方法自动导入,基于 [unplugin-auto-import](https://www.npmjs.com/package/unplugin-auto-import)
14
- - 组件自动导入,基于 `uni-app` 的 [easycom](https://uniapp.dcloud.net.cn/collocation/pages.html#easycom) 以及 [unplugin-vue-components](https://www.npmjs.com/package/unplugin-vue-components)
14
+ - 组件自动导入,基于 `uni-app` 的 [easycom](https://uniapp.dcloud.net.cn/collocation/pages.html#easycom)
15
+ - `ts` 类型提示:
16
+
17
+ - `@uni-helper/uni-app-types` 提供 `uni-app` 组件类型提示
18
+ - `@uni-helper/uni-ui-types` 提供 `uni-ui` 组件类型提示
15
19
 
16
20
  - 🛠️ 支持通过传递不同的 `mode` 值以使用不同的配置
17
21
 
22
+ - 🚀 约定优于配置,基于文件目录的路由:
23
+
24
+ - 根据页面文件自动生成 `pages.json`
25
+ - [官方文档](https://www.npmjs.com/package/@uni-helper/vite-plugin-uni-pages)
26
+
27
+ - 🚀 可定制布局框架
28
+
29
+ - 根据页面的配置,自动注册并导入对应的组件,可将一些全局组件丢入布局之中,避免频繁导入
30
+ - 可以在布局内部进行登录校验,避免各个页面频繁调用
31
+ - [官方文档](https://www.npmjs.com/package/@uni-helper/vite-plugin-uni-layouts)
32
+
33
+
34
+ ### 针对 `uni-app` 的改进
35
+
36
+ > 使用 `pages.config.ts` 和 `manifest.config.ts` 替代原有的 `json` 配置,增强了类型提示与配置合法性校验
37
+
38
+ **`pages.json` 和 `manifest.json` 现在是由插件自动生成,尽量不要手动修改,以免造成意外的 `bug`**
39
+
40
+
18
41
  ## 接口编写
19
42
 
20
43
  > 按需注入特定的类型,以实现完美的类型推导和自动完成
@@ -1 +1,3 @@
1
- VITE_COMMON = 此处存放公共配置
1
+ # 此处存放公共配置
2
+
3
+ VITE_CUSTOM_LOADING = true
@@ -125,6 +125,7 @@ declare global {
125
125
  const useCssVars: typeof import('vue')['useCssVars']
126
126
  const useGet: typeof import('./src/apis/requests/get')['useGet']
127
127
  const useHttp: typeof import('./src/apis/lib/index')['useHttp']
128
+ const useHttpLoading: typeof import('./src/store/system')['useHttpLoading']
128
129
  const usePost: typeof import('./src/apis/requests/post')['usePost']
129
130
  const useSlots: typeof import('vue')['useSlots']
130
131
  const useSystemInfo: typeof import('./src/store/system')['useSystemInfo']
@@ -262,6 +263,7 @@ declare module 'vue' {
262
263
  readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
263
264
  readonly useGet: UnwrapRef<typeof import('./src/apis/requests/get')['useGet']>
264
265
  readonly useHttp: UnwrapRef<typeof import('./src/apis/lib/index')['useHttp']>
266
+ readonly useHttpLoading: UnwrapRef<typeof import('./src/store/system')['useHttpLoading']>
265
267
  readonly usePost: UnwrapRef<typeof import('./src/apis/requests/post')['usePost']>
266
268
  readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
267
269
  readonly useSystemInfo: UnwrapRef<typeof import('./src/store/system')['useSystemInfo']>
@@ -393,6 +395,7 @@ declare module '@vue/runtime-core' {
393
395
  readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
394
396
  readonly useGet: UnwrapRef<typeof import('./src/apis/requests/get')['useGet']>
395
397
  readonly useHttp: UnwrapRef<typeof import('./src/apis/lib/index')['useHttp']>
398
+ readonly useHttpLoading: UnwrapRef<typeof import('./src/store/system')['useHttpLoading']>
396
399
  readonly usePost: UnwrapRef<typeof import('./src/apis/requests/post')['usePost']>
397
400
  readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
398
401
  readonly useSystemInfo: UnwrapRef<typeof import('./src/store/system')['useSystemInfo']>
@@ -9,12 +9,9 @@ declare module 'vue' {
9
9
  export interface GlobalComponents {
10
10
  RouterLink: typeof import('vue-router')['RouterLink']
11
11
  RouterView: typeof import('vue-router')['RouterView']
12
- UniCard: typeof import('@dcloudio/uni-ui/lib/uni-card/uni-card.vue')['default']
13
- UniIcons: typeof import('@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue')['default']
14
- UniNavBar: typeof import('@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue')['default']
15
12
  YoungLoading: typeof import('./src/components/young-loading/young-loading.vue')['default']
13
+ YoungLoadingMini: typeof import('./src/components/young-loading-mini/young-loading-mini.vue')['default']
16
14
  YoungNavbar: typeof import('./src/components/young-navbar/young-navbar.vue')['default']
17
15
  YoungTabbar: typeof import('./src/components/young-tabbar/young-tabbar.vue')['default']
18
- YoungTabbarLayout: typeof import('./src/components/young-tabbar-layout/young-tabbar-layout.vue')['default']
19
16
  }
20
17
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-19 14:32:45
4
- * @LastEditTime: 2023-07-19 15:48:53
4
+ * @LastEditTime: 2023-07-20 14:01:15
5
5
  * @Description:
6
6
  */
7
7
  import type { Plugin } from 'vite';
@@ -23,7 +23,7 @@ export const multiConf = (env: string) => {
23
23
  targetDir = config.build.outDir;
24
24
  },
25
25
  generateBundle(options, bundle) {
26
- const appid = configEnv.VITE_APPID;
26
+ const appid = configEnv.VITE_APP_ID;
27
27
  const json = bundle['project.config.json'] as OutputAsset;
28
28
  if (json?.source && typeof json.source === 'string') {
29
29
  const jsonConf = JSON.parse(json.source);
@@ -69,9 +69,8 @@ export const multiConf = (env: string) => {
69
69
  };
70
70
 
71
71
  json.source = JSON.stringify(jsonConf, null, 2);
72
+ // console.log("🚀 ~ file: multiconf.ts:72 ~ generateBundle ~ jsonConf:", jsonConf);
72
73
  }
73
- // console.log("🚀 ~ file: vite.config.ts:18 ~ generateBundle ~ bundle:", json)
74
- // 处理生成的输出文件
75
74
  },
76
75
  } as Plugin;
77
76
  };
@@ -0,0 +1,88 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-20 12:12:16
4
+ * @LastEditTime: 2023-07-20 12:42:02
5
+ * @Description:
6
+ */
7
+ import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest';
8
+
9
+ export default defineManifestConfig({
10
+ name: '',
11
+ appid: '',
12
+ description: '',
13
+ versionName: '1.0.0',
14
+ versionCode: '100',
15
+ transformPx: false,
16
+ /* 5+App特有相关 */
17
+ 'app-plus': {
18
+ usingComponents: true,
19
+ nvueStyleCompiler: 'uni-app',
20
+ compilerVersion: 3,
21
+ splashscreen: {
22
+ alwaysShowBeforeRender: true,
23
+ waiting: true,
24
+ autoclose: true,
25
+ delay: 0,
26
+ },
27
+ /* 模块配置 */
28
+ modules: {},
29
+ /* 应用发布信息 */
30
+ distribute: {
31
+ /* android打包配置 */
32
+ android: {
33
+ permissions: [
34
+ '<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>',
35
+ '<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>',
36
+ '<uses-permission android:name="android.permission.VIBRATE"/>',
37
+ '<uses-permission android:name="android.permission.READ_LOGS"/>',
38
+ '<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>',
39
+ '<uses-feature android:name="android.hardware.camera.autofocus"/>',
40
+ '<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>',
41
+ '<uses-permission android:name="android.permission.CAMERA"/>',
42
+ '<uses-permission android:name="android.permission.GET_ACCOUNTS"/>',
43
+ '<uses-permission android:name="android.permission.READ_PHONE_STATE"/>',
44
+ '<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>',
45
+ '<uses-permission android:name="android.permission.WAKE_LOCK"/>',
46
+ '<uses-permission android:name="android.permission.FLASHLIGHT"/>',
47
+ '<uses-feature android:name="android.hardware.camera"/>',
48
+ '<uses-permission android:name="android.permission.WRITE_SETTINGS"/>',
49
+ ],
50
+ },
51
+ /* ios打包配置 */
52
+ ios: {},
53
+ /* SDK配置 */
54
+ sdkConfigs: {},
55
+ },
56
+ },
57
+ /* 快应用特有相关 */
58
+ quickapp: {},
59
+ /* 小程序特有相关 */
60
+ 'mp-weixin': {
61
+ appid: '',
62
+ setting: {
63
+ urlCheck: false,
64
+ ignoreUploadUnusedFiles: false,
65
+ ignoreDevUnusedFiles: false,
66
+ },
67
+ usingComponents: true,
68
+ requiredPrivateInfos: ['getLocation', 'chooseLocation'],
69
+ permission: {
70
+ 'scope.userLocation': {
71
+ desc: '你的位置信息将用于获取附近的门店信息',
72
+ },
73
+ },
74
+ },
75
+ 'mp-alipay': {
76
+ usingComponents: true,
77
+ },
78
+ 'mp-baidu': {
79
+ usingComponents: true,
80
+ },
81
+ 'mp-toutiao': {
82
+ usingComponents: true,
83
+ },
84
+ uniStatistics: {
85
+ enable: false,
86
+ },
87
+ vueVersion: '3',
88
+ });
@@ -71,6 +71,13 @@
71
71
  "@dcloudio/uni-stacktracey": "3.0.0-3080720230703001",
72
72
  "@dcloudio/uni-ui": "^1.4.28",
73
73
  "@dcloudio/vite-plugin-uni": "3.0.0-3080720230703001",
74
+ "@uni-helper/pages-json-schema": "^0.2.3",
75
+ "@uni-helper/uni-app-types": "^0.5.8",
76
+ "@uni-helper/uni-ui-types": "^0.5.10",
77
+ "@uni-helper/vite-plugin-uni-layouts": "^0.1.2",
78
+ "@uni-helper/vite-plugin-uni-manifest": "^0.1.3",
79
+ "@uni-helper/vite-plugin-uni-pages": "^0.2.3",
80
+ "@uni-helper/volar-service-uni-pages": "^0.2.3",
74
81
  "@vue/tsconfig": "^0.1.3",
75
82
  "axios": "^1.4.0",
76
83
  "rome": "^12.1.3",
@@ -0,0 +1,58 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-07-19 19:54:37
4
+ * @LastEditTime: 2023-07-20 12:02:37
5
+ * @Description:
6
+ */
7
+ import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages';
8
+
9
+ export default defineUniPages({
10
+ lazyCodeLoading: 'requiredComponents',
11
+ pages: [],
12
+ tabBar: {
13
+ color: '#666',
14
+ selectedColor: '#333',
15
+ borderStyle: 'white',
16
+ backgroundColor: '#ffffff',
17
+ fontSize: '22rpx',
18
+ list: [
19
+ {
20
+ pagePath: 'pages/index',
21
+ text: '首页',
22
+ iconPath: 'static/home.png',
23
+ selectedIconPath: 'static/home_active.png',
24
+ },
25
+ {
26
+ pagePath: 'pages/my',
27
+ text: '我的',
28
+ iconPath: 'static/my.png',
29
+ selectedIconPath: 'static/my_active.png',
30
+ },
31
+ ],
32
+ },
33
+ globalStyle: {
34
+ pageOrientation: 'portrait',
35
+ navigationBarTitleText: 'demo',
36
+ navigationBarTextStyle: 'white',
37
+ navigationBarBackgroundColor: '#0D0D0D',
38
+ navigationStyle: 'custom',
39
+ backgroundColor: '#F2EAE0',
40
+ backgroundColorTop: '#F2EAE0',
41
+ backgroundColorBottom: '#F4F5F6',
42
+ 'mp-360': {
43
+ navigationStyle: 'custom',
44
+ },
45
+ h5: {
46
+ maxWidth: 1190,
47
+ navigationBarTextStyle: 'black',
48
+ navigationBarBackgroundColor: '#FFFFFF',
49
+ },
50
+ },
51
+ easycom: {
52
+ autoscan: true,
53
+ custom: {
54
+ '^young-(.*)': '@/components/young-$1/young-$1.vue',
55
+ '^uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
56
+ },
57
+ },
58
+ });
@@ -91,6 +91,27 @@ devDependencies:
91
91
  '@dcloudio/vite-plugin-uni':
92
92
  specifier: 3.0.0-3080720230703001
93
93
  version: 3.0.0-3080720230703001(postcss@8.4.26)(vite@4.0.4)(vue@3.3.4)
94
+ '@uni-helper/pages-json-schema':
95
+ specifier: ^0.2.3
96
+ version: 0.2.3
97
+ '@uni-helper/uni-app-types':
98
+ specifier: ^0.5.8
99
+ version: 0.5.8(typescript@4.9.5)
100
+ '@uni-helper/uni-ui-types':
101
+ specifier: ^0.5.10
102
+ version: 0.5.10(@uni-helper/uni-app-types@0.5.8)
103
+ '@uni-helper/vite-plugin-uni-layouts':
104
+ specifier: ^0.1.2
105
+ version: 0.1.2
106
+ '@uni-helper/vite-plugin-uni-manifest':
107
+ specifier: ^0.1.3
108
+ version: 0.1.3
109
+ '@uni-helper/vite-plugin-uni-pages':
110
+ specifier: ^0.2.3
111
+ version: 0.2.3(@types/lodash-es@4.17.8)(lodash-es@4.17.21)(lodash@4.17.21)
112
+ '@uni-helper/volar-service-uni-pages':
113
+ specifier: ^0.2.3
114
+ version: 0.2.3
94
115
  '@vue/tsconfig':
95
116
  specifier: ^0.1.3
96
117
  version: 0.1.3
@@ -3144,7 +3165,16 @@ packages:
3144
3165
 
3145
3166
  /@types/json-schema@7.0.12:
3146
3167
  resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==}
3147
- dev: false
3168
+
3169
+ /@types/lodash-es@4.17.8:
3170
+ resolution: {integrity: sha512-euY3XQcZmIzSy7YH5+Unb3b2X12Wtk54YWINBvvGQ5SmMvwb11JQskGsfkH/5HXK77Kr8GF0wkVDIxzAisWtog==}
3171
+ dependencies:
3172
+ '@types/lodash': 4.14.195
3173
+ dev: true
3174
+
3175
+ /@types/lodash@4.14.195:
3176
+ resolution: {integrity: sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==}
3177
+ dev: true
3148
3178
 
3149
3179
  /@types/node@20.4.2:
3150
3180
  resolution: {integrity: sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==}
@@ -3173,6 +3203,89 @@ packages:
3173
3203
  form-data: 4.0.0
3174
3204
  dev: false
3175
3205
 
3206
+ /@uni-helper/pages-json-schema@0.2.3:
3207
+ resolution: {integrity: sha512-feM6Gkgq/w2xTK4IU61dCqCGynmvLPsFVhGtjshMb1+MSyN7J0Ikc3TuSLnO9r5kNyQxsOVysiz8Bpdj+jBkcw==}
3208
+ dev: true
3209
+
3210
+ /@uni-helper/uni-app-types@0.5.8(typescript@4.9.5):
3211
+ resolution: {integrity: sha512-iB2JG6ygBjGcUvSAKpuxrK8JfPBYuLXf3p8fMTM3Mtwoi+VvcyU4hJJwbndX3mqqVJw/lGpsOlPIBozp8NZ3Cg==}
3212
+ engines: {node: '>=14.18'}
3213
+ peerDependencies:
3214
+ typescript: ^4.8.0 || ^5.0.0
3215
+ dependencies:
3216
+ '@dcloudio/types': 3.3.3
3217
+ typescript: 4.9.5
3218
+ vue3: /vue@3.3.4
3219
+ dev: true
3220
+
3221
+ /@uni-helper/uni-env@0.0.3:
3222
+ resolution: {integrity: sha512-K6MEnmN7Dg+NnEkfUUhjaKc/rPVY7tcGdsVUKOlC1/z2E6H6zjSSTdJg8z+sVJtZ03Ff1G/MHz2PYDyAS6gjQQ==}
3223
+ dev: true
3224
+
3225
+ /@uni-helper/uni-ui-types@0.5.10(@uni-helper/uni-app-types@0.5.8):
3226
+ resolution: {integrity: sha512-7DaAPncYHWHn6D6rhp1HzIH4CiMB1b2DIRKmtempH+KbptvfBpj3m7yVvOTF+UGcjkD63ab45/vzGEyG1hXYfg==}
3227
+ engines: {node: '>=14.18'}
3228
+ peerDependencies:
3229
+ '@uni-helper/uni-app-types': ^0.5.1
3230
+ peerDependenciesMeta:
3231
+ '@uni-helper/uni-app-types':
3232
+ optional: true
3233
+ dependencies:
3234
+ '@dcloudio/types': 3.3.3
3235
+ '@uni-helper/uni-app-types': 0.5.8(typescript@4.9.5)
3236
+ vue3: /vue@3.3.4
3237
+ dev: true
3238
+
3239
+ /@uni-helper/vite-plugin-uni-layouts@0.1.2:
3240
+ resolution: {integrity: sha512-ToWPXx/jXjzr1yzHTAA7lCEP8wSLhqK1hM/n0dHg3oN268Rc+X/8+igl+VADvjejWYWR+oO5XbLy6+DQZfx3UQ==}
3241
+ dependencies:
3242
+ '@uni-helper/uni-env': 0.0.3
3243
+ '@vue/compiler-dom': 3.3.4
3244
+ fast-glob: 3.3.0
3245
+ jsonc-parser: 3.2.0
3246
+ magic-string: 0.30.1
3247
+ scule: 1.0.0
3248
+ dev: true
3249
+
3250
+ /@uni-helper/vite-plugin-uni-manifest@0.1.3:
3251
+ resolution: {integrity: sha512-sG6/MR/jvojn53uRhCHAY/6cSkdiU7FhZV786CxPDjL97I9T7OUKcNoTtsTHdwSTwoihpH6jqF0DPqju0VUbJw==}
3252
+ dependencies:
3253
+ chokidar: 3.5.3
3254
+ colorette: 2.0.20
3255
+ consola: 2.15.3
3256
+ fast-glob: 3.3.0
3257
+ type-fest: 3.13.1
3258
+ unconfig: 0.3.9
3259
+ dev: true
3260
+
3261
+ /@uni-helper/vite-plugin-uni-pages@0.2.3(@types/lodash-es@4.17.8)(lodash-es@4.17.21)(lodash@4.17.21):
3262
+ resolution: {integrity: sha512-NHIO1JR5K+VgSU1kUKPFF/FqMkPK2KeaNJJDiDQdamomYh4duISKKfnYtu38dLIfNGxDqW0xYQ8wzpD/DdZmtg==}
3263
+ dependencies:
3264
+ '@uni-helper/uni-env': 0.0.3
3265
+ '@vue/compiler-sfc': 3.3.4
3266
+ chokidar: 3.5.3
3267
+ debug: 4.3.4
3268
+ fast-glob: 3.3.0
3269
+ json5: 2.2.3
3270
+ lodash-unified: 1.0.3(@types/lodash-es@4.17.8)(lodash-es@4.17.21)(lodash@4.17.21)
3271
+ magic-string: 0.30.1
3272
+ unconfig: 0.3.9
3273
+ yaml: 2.3.1
3274
+ transitivePeerDependencies:
3275
+ - '@types/lodash-es'
3276
+ - lodash
3277
+ - lodash-es
3278
+ - supports-color
3279
+ dev: true
3280
+
3281
+ /@uni-helper/volar-service-uni-pages@0.2.3:
3282
+ resolution: {integrity: sha512-8ORXefdRkqMzPgpnEccxdz7oplXVMKuRDlszmUIuD61b27r5MXkAatB+S/ouuy5OSgXbE+Dddcl/AyEMK3U/8Q==}
3283
+ dependencies:
3284
+ '@uni-helper/pages-json-schema': 0.2.3
3285
+ ts-json-schema-generator: 1.2.0
3286
+ vscode-json-languageservice: 5.3.5
3287
+ dev: true
3288
+
3176
3289
  /@unocss/astro@0.53.5(vite@4.0.4):
3177
3290
  resolution: {integrity: sha512-W4A0uIN4xAzVH6Vwf5ukG8rJpCeIwQZcpZPrEBWsqY5YcHZcLTFGMHcNmxyeG0qoXpXoxtvHyXXhgGU0BY5ZEw==}
3178
3291
  dependencies:
@@ -3408,6 +3521,10 @@ packages:
3408
3521
  vite: 4.0.4(sass@1.63.6)(terser@5.19.1)
3409
3522
  vue: 3.3.4
3410
3523
 
3524
+ /@vscode/l10n@0.0.13:
3525
+ resolution: {integrity: sha512-A3uY356uOU9nGa+TQIT/i3ziWUgJjVMUrGGXSrtRiTwklyCFjGVWIOHoEIHbJpiyhDkJd9kvIWUOfXK1IkK8XQ==}
3526
+ dev: true
3527
+
3411
3528
  /@vue/babel-helper-vue-transform-on@1.1.5:
3412
3529
  resolution: {integrity: sha512-SgUymFpMoAyWeYWLAY+MkCK3QEROsiUnfaw5zxOVD/M64KQs8D/4oK6Q5omVA2hnvEOE0SCkH2TZxs/jnnUj7w==}
3413
3530
  dev: true
@@ -4179,6 +4296,11 @@ packages:
4179
4296
  /commander@2.20.3:
4180
4297
  resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
4181
4298
 
4299
+ /commander@9.5.0:
4300
+ resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
4301
+ engines: {node: ^12.20.0 || >=14}
4302
+ dev: true
4303
+
4182
4304
  /compare-versions@3.6.0:
4183
4305
  resolution: {integrity: sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==}
4184
4306
 
@@ -4186,6 +4308,10 @@ packages:
4186
4308
  resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
4187
4309
  dev: true
4188
4310
 
4311
+ /consola@2.15.3:
4312
+ resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==}
4313
+ dev: true
4314
+
4189
4315
  /consola@3.2.3:
4190
4316
  resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==}
4191
4317
  engines: {node: ^14.18.0 || >=16.10.0}
@@ -4834,6 +4960,17 @@ packages:
4834
4960
  path-is-absolute: 1.0.1
4835
4961
  dev: true
4836
4962
 
4963
+ /glob@8.1.0:
4964
+ resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
4965
+ engines: {node: '>=12'}
4966
+ dependencies:
4967
+ fs.realpath: 1.0.0
4968
+ inflight: 1.0.6
4969
+ inherits: 2.0.4
4970
+ minimatch: 5.1.6
4971
+ once: 1.4.0
4972
+ dev: true
4973
+
4837
4974
  /global@4.4.0:
4838
4975
  resolution: {integrity: sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==}
4839
4976
  dependencies:
@@ -5747,6 +5884,22 @@ packages:
5747
5884
  p-locate: 5.0.0
5748
5885
  dev: true
5749
5886
 
5887
+ /lodash-es@4.17.21:
5888
+ resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
5889
+ dev: true
5890
+
5891
+ /lodash-unified@1.0.3(@types/lodash-es@4.17.8)(lodash-es@4.17.21)(lodash@4.17.21):
5892
+ resolution: {integrity: sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==}
5893
+ peerDependencies:
5894
+ '@types/lodash-es': '*'
5895
+ lodash: '*'
5896
+ lodash-es: '*'
5897
+ dependencies:
5898
+ '@types/lodash-es': 4.17.8
5899
+ lodash: 4.17.21
5900
+ lodash-es: 4.17.21
5901
+ dev: true
5902
+
5750
5903
  /lodash.camelcase@4.3.0:
5751
5904
  resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
5752
5905
 
@@ -5866,6 +6019,13 @@ packages:
5866
6019
  brace-expansion: 1.1.11
5867
6020
  dev: true
5868
6021
 
6022
+ /minimatch@5.1.6:
6023
+ resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
6024
+ engines: {node: '>=10'}
6025
+ dependencies:
6026
+ brace-expansion: 2.0.1
6027
+ dev: true
6028
+
5869
6029
  /minimatch@9.0.3:
5870
6030
  resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
5871
6031
  engines: {node: '>=16 || 14 >=14.17'}
@@ -6526,6 +6686,11 @@ packages:
6526
6686
  /safe-buffer@5.2.1:
6527
6687
  resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
6528
6688
 
6689
+ /safe-stable-stringify@2.4.3:
6690
+ resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==}
6691
+ engines: {node: '>=10'}
6692
+ dev: true
6693
+
6529
6694
  /safer-buffer@2.1.2:
6530
6695
  resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
6531
6696
  dev: true
@@ -6922,6 +7087,20 @@ packages:
6922
7087
  punycode: 2.3.0
6923
7088
  dev: true
6924
7089
 
7090
+ /ts-json-schema-generator@1.2.0:
7091
+ resolution: {integrity: sha512-tUMeO3ZvA12d3HHh7T/AK8W5hmUhDRNtqWRHSMN3ZRbUFt+UmV0oX8k1RK4SA+a+BKNHpmW2v06MS49e8Fi3Yg==}
7092
+ engines: {node: '>=10.0.0'}
7093
+ hasBin: true
7094
+ dependencies:
7095
+ '@types/json-schema': 7.0.12
7096
+ commander: 9.5.0
7097
+ glob: 8.1.0
7098
+ json5: 2.2.3
7099
+ normalize-path: 3.0.0
7100
+ safe-stable-stringify: 2.4.3
7101
+ typescript: 4.9.5
7102
+ dev: true
7103
+
6925
7104
  /tslib@2.6.0:
6926
7105
  resolution: {integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==}
6927
7106
  dev: false
@@ -6936,6 +7115,11 @@ packages:
6936
7115
  engines: {node: '>=10'}
6937
7116
  dev: true
6938
7117
 
7118
+ /type-fest@3.13.1:
7119
+ resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==}
7120
+ engines: {node: '>=14.16'}
7121
+ dev: true
7122
+
6939
7123
  /type-is@1.6.18:
6940
7124
  resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}
6941
7125
  engines: {node: '>= 0.6'}
@@ -7250,6 +7434,28 @@ packages:
7250
7434
  optionalDependencies:
7251
7435
  fsevents: 2.3.2
7252
7436
 
7437
+ /vscode-json-languageservice@5.3.5:
7438
+ resolution: {integrity: sha512-DasT+bKtpaS2rTPEB4VMROnvO1WES2KD8RZZxXbumnk9sk5wco10VdB6sJgTlsKQN14tHQLZDXuHnSoSAlE8LQ==}
7439
+ dependencies:
7440
+ '@vscode/l10n': 0.0.13
7441
+ jsonc-parser: 3.2.0
7442
+ vscode-languageserver-textdocument: 1.0.8
7443
+ vscode-languageserver-types: 3.17.3
7444
+ vscode-uri: 3.0.7
7445
+ dev: true
7446
+
7447
+ /vscode-languageserver-textdocument@1.0.8:
7448
+ resolution: {integrity: sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==}
7449
+ dev: true
7450
+
7451
+ /vscode-languageserver-types@3.17.3:
7452
+ resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==}
7453
+ dev: true
7454
+
7455
+ /vscode-uri@3.0.7:
7456
+ resolution: {integrity: sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==}
7457
+ dev: true
7458
+
7253
7459
  /vue-demi@0.14.5(vue@3.3.4):
7254
7460
  resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==}
7255
7461
  engines: {node: '>=12'}
@@ -7506,6 +7712,11 @@ packages:
7506
7712
  resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
7507
7713
  engines: {node: '>= 6'}
7508
7714
 
7715
+ /yaml@2.3.1:
7716
+ resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==}
7717
+ engines: {node: '>= 14'}
7718
+ dev: true
7719
+
7509
7720
  /yargs-parser@20.2.9:
7510
7721
  resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
7511
7722
  engines: {node: '>=10'}
@@ -1,13 +1,18 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-02-13 14:58:26
4
- * @LastEditTime: 2023-07-19 17:23:20
4
+ * @LastEditTime: 2023-07-20 15:31:59
5
5
  * @Description:
6
6
  -->
7
7
  <script setup lang="ts">
8
+ import { pages } from 'virtual:uni-pages';
9
+
8
10
  onLaunch(async () => {
9
11
  console.log('App Launch');
10
12
  console.log('环境变量:', import.meta.env);
13
+ const { pagesInfo } = storeToRefs(useSystemInfo());
14
+ pagesInfo.value = pages;
15
+
11
16
  if (!getUuid()) {
12
17
  setUuid();
13
18
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-18 15:35:24
4
- * @LastEditTime: 2023-07-19 16:47:49
4
+ * @LastEditTime: 2023-07-20 15:06:25
5
5
  * @Description:
6
6
  */
7
7
  import { useHttp } from './lib';
@@ -10,8 +10,22 @@ import { useGet, usePost } from './requests';
10
10
  const http = useHttp({
11
11
  baseURL: import.meta.env.VITE_API_BASE_URL,
12
12
  loading: {
13
- start: showLoading,
14
- end: hideLoading,
13
+ start: () => {
14
+ if (import.meta.env.VITE_CUSTOM_LOADING) {
15
+ const { httpLoadingEl } = storeToRefs(useHttpLoading());
16
+ httpLoadingEl.value?.start();
17
+ } else {
18
+ showLoading();
19
+ }
20
+ },
21
+ end: () => {
22
+ if (import.meta.env.VITE_CUSTOM_LOADING) {
23
+ const { httpLoadingEl } = storeToRefs(useHttpLoading());
24
+ httpLoadingEl.value?.end();
25
+ } else {
26
+ hideLoading();
27
+ }
28
+ },
15
29
  },
16
30
  headers: {
17
31
  getCommonHeaders: () => ({
@@ -22,11 +22,11 @@ withDefaults(defineProps<{
22
22
  const loading = ref(true);
23
23
 
24
24
  const start = () => loading.value = true;
25
- const stop = () => loading.value = false;
25
+ const end = () => loading.value = false;
26
26
 
27
27
  defineExpose({
28
28
  start,
29
- stop
29
+ end
30
30
  });
31
31
  </script>
32
32
  <template>