vue2server7 7.0.118 → 7.0.119

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 (62) hide show
  1. package/package.json +1 -1
  2. package/test/mini2.0-main/.editorconfig +8 -0
  3. package/test/mini2.0-main/.env.development +3 -0
  4. package/test/mini2.0-main/.env.production +3 -0
  5. package/test/mini2.0-main/.env.test +3 -0
  6. package/test/mini2.0-main/.gitattributes +1 -0
  7. package/test/mini2.0-main/.oxlintrc.json +10 -0
  8. package/test/mini2.0-main/.prettierrc.json +6 -0
  9. package/test/mini2.0-main/README.md +179 -0
  10. package/test/mini2.0-main/auto-imports.d.ts +629 -0
  11. package/test/mini2.0-main/components.d.ts +21 -0
  12. package/test/mini2.0-main/docs/MX_API.md +244 -0
  13. package/test/mini2.0-main/docs/REQUEST.md +217 -0
  14. package/test/mini2.0-main/docs/package-json-guide.md +132 -0
  15. package/test/mini2.0-main/env.d.ts +12 -0
  16. package/test/mini2.0-main/eslint.config.ts +26 -0
  17. package/test/mini2.0-main/index.html +16 -0
  18. package/test/mini2.0-main/package-lock.json +6421 -0
  19. package/test/mini2.0-main/package.json +64 -0
  20. package/test/mini2.0-main/plugins/bump-version.ts +50 -0
  21. package/test/mini2.0-main/postcss.config.ts +15 -0
  22. package/test/mini2.0-main/public/favicon.ico +0 -0
  23. package/test/mini2.0-main/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
  24. package/test/mini2.0-main/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
  25. package/test/mini2.0-main/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
  26. package/test/mini2.0-main/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
  27. package/test/mini2.0-main/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
  28. package/test/mini2.0-main/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
  29. package/test/mini2.0-main/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
  30. package/test/mini2.0-main/public/images/img.png +0 -0
  31. package/test/mini2.0-main/src/App.vue +11 -0
  32. package/test/mini2.0-main/src/api/user.ts +23 -0
  33. package/test/mini2.0-main/src/auto-imports.d.ts +639 -0
  34. package/test/mini2.0-main/src/components.d.ts +23 -0
  35. package/test/mini2.0-main/src/config/config.properties +3 -0
  36. package/test/mini2.0-main/src/config/env.ts +6 -0
  37. package/test/mini2.0-main/src/config/plugin.properties.pro +6 -0
  38. package/test/mini2.0-main/src/config/plugin.properties.test +6 -0
  39. package/test/mini2.0-main/src/core/mxApi/index.ts +237 -0
  40. package/test/mini2.0-main/src/core/request/index.ts +129 -0
  41. package/test/mini2.0-main/src/main.ts +21 -0
  42. package/test/mini2.0-main/src/router/index.ts +70 -0
  43. package/test/mini2.0-main/src/stores/counter.ts +12 -0
  44. package/test/mini2.0-main/src/stores/user.ts +48 -0
  45. package/test/mini2.0-main/src/types/api.d.ts +14 -0
  46. package/test/mini2.0-main/src/types/nprogress.d.ts +8 -0
  47. package/test/mini2.0-main/src/utils/request.ts +159 -0
  48. package/test/mini2.0-main/src/views/clearing-detail/index.vue +49 -0
  49. package/test/mini2.0-main/src/views/foreign-position/index.vue +49 -0
  50. package/test/mini2.0-main/src/views/home/index.vue +201 -0
  51. package/test/mini2.0-main/src/views/login/index.vue +166 -0
  52. package/test/mini2.0-main/src/views/net-debit/index.vue +49 -0
  53. package/test/mini2.0-main/src/views/pbc-position/index.vue +49 -0
  54. package/test/mini2.0-main/src/views/position-estimate/index.vue +49 -0
  55. package/test/mini2.0-main/src/views/rmb-position/index.vue +49 -0
  56. package/test/mini2.0-main/src/views/warning/index.vue +49 -0
  57. package/test/mini2.0-main/tsconfig.app.json +18 -0
  58. package/test/mini2.0-main/tsconfig.json +11 -0
  59. package/test/mini2.0-main/tsconfig.node.json +28 -0
  60. package/test/mini2.0-main/vite.config.ts +68 -0
  61. package/test/b137a0ec17d13d2093a89a18eb819e89.png +0 -0
  62. package/test/mini2.0-main (2).zip +0 -0
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "mini2.0",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "dev:test": "vite --mode test",
9
+ "build": "run-p type-check \"build-only {@}\" --",
10
+ "build:test": "run-s type-check build-only:test",
11
+ "build:prod": "run-s type-check build-only:prod",
12
+ "preview": "vite preview",
13
+ "build-only": "vite build",
14
+ "build-only:test": "vite build --mode test",
15
+ "build-only:prod": "vite build --mode production",
16
+ "type-check": "vue-tsc --build",
17
+ "lint": "run-s lint:*",
18
+ "lint:oxlint": "oxlint . --fix",
19
+ "lint:eslint": "eslint . --fix --cache",
20
+ "format": "prettier --write --experimental-cli src/"
21
+ },
22
+ "dependencies": {
23
+ "@iconify/vue": "^5.0.1",
24
+ "@vueuse/core": "^14.3.0",
25
+ "axios": "^1.16.1",
26
+ "clipboard": "^2.0.11",
27
+ "crypto-js": "^4.2.0",
28
+ "dayjs": "^1.11.21",
29
+ "nprogress": "^0.2.0",
30
+ "pinia": "^3.0.4",
31
+ "pinia-plugin-persistedstate": "^4.7.1",
32
+ "qrcode": "^1.5.4",
33
+ "vant": "^4.9.24",
34
+ "vconsole": "^3.15.1",
35
+ "vue": "^3.5.32",
36
+ "vue-router": "^5.0.4"
37
+ },
38
+ "devDependencies": {
39
+ "@tsconfig/node24": "^24.0.4",
40
+ "@types/node": "^24.12.2",
41
+ "@vitejs/plugin-vue": "^6.0.6",
42
+ "@vue/eslint-config-typescript": "^14.7.0",
43
+ "@vue/tsconfig": "^0.9.1",
44
+ "eslint": "^10.2.1",
45
+ "eslint-config-prettier": "^10.1.8",
46
+ "eslint-plugin-oxlint": "~1.60.0",
47
+ "eslint-plugin-vue": "~10.8.0",
48
+ "jiti": "^2.6.1",
49
+ "less": "^4.6.4",
50
+ "npm-run-all2": "^8.0.4",
51
+ "oxlint": "~1.60.0",
52
+ "postcss-px-to-viewport-8-plugin": "^1.2.5",
53
+ "prettier": "3.8.3",
54
+ "typescript": "~6.0.0",
55
+ "unplugin-auto-import": "^21.0.0",
56
+ "unplugin-vue-components": "^32.1.0",
57
+ "vite": "^8.0.8",
58
+ "vite-plugin-vue-devtools": "^8.1.1",
59
+ "vue-tsc": "^3.2.6"
60
+ },
61
+ "engines": {
62
+ "node": "^20.19.0 || >=22.12.0"
63
+ }
64
+ }
@@ -0,0 +1,50 @@
1
+ import { readFileSync, writeFileSync, cpSync } from 'node:fs'
2
+ import { resolve, basename } from 'node:path'
3
+ import { execSync } from 'node:child_process'
4
+ import type { Plugin } from 'vite'
5
+
6
+ /**
7
+ * 打包时自增版本号、复制配置文件、压缩 dist 为 zip
8
+ */
9
+ export function bumpVersion(mode: string): Plugin {
10
+ return {
11
+ name: 'bump-version-and-copy',
12
+ writeBundle(options) {
13
+ const outDir = options.dir
14
+ if (!outDir) return
15
+
16
+ const suffix = mode === 'production' ? 'pro' : 'test'
17
+ const src = `src/config/plugin.properties.${suffix}`
18
+
19
+ let content = readFileSync(src, 'utf-8')
20
+ const match = content.match(/version_code=(\d+)/)
21
+ if (!match) return
22
+
23
+ const oldCode = Number(match[1])
24
+ const newCode = oldCode + 1
25
+
26
+ const major = Math.floor(newCode / 100000)
27
+ const minor = Math.floor((newCode % 100000) / 1000)
28
+ const patch = String(newCode % 1000).padStart(3, '0')
29
+ const versionName = `${major}.${minor}.${patch}`
30
+
31
+ content = content
32
+ .replace(/version_code=\d+/, `version_code=${newCode}`)
33
+ .replace(/version_name=[^;\n]+/, `version_name=${versionName}`)
34
+
35
+ writeFileSync(src, content)
36
+ writeFileSync(resolve(outDir, '..', 'plugin.properties'), content)
37
+
38
+ // 复制 config.properties 到 dist/www/
39
+ cpSync('src/config/config.properties', resolve(outDir, 'config.properties'))
40
+
41
+ console.log(`[plugin.properties] version: ${oldCode} → ${newCode} (${versionName})`)
42
+
43
+ // 压缩 dist 为 zip
44
+ const distDir = resolve(outDir, '..')
45
+ const zipName = `dist_${newCode}.zip`
46
+ execSync(`cd ${distDir} && zip -r ${zipName} www plugin.properties config.properties`, { stdio: 'inherit' })
47
+ console.log(`[zip] 已生成 ${basename(distDir)}/${zipName}`)
48
+ },
49
+ }
50
+ }
@@ -0,0 +1,15 @@
1
+ import pxToViewport from 'postcss-px-to-viewport-8-plugin'
2
+
3
+ export default {
4
+ plugins: [
5
+ pxToViewport({
6
+ viewportWidth: 375,
7
+
8
+ viewportUnit: 'vw',
9
+
10
+ unitPrecision: 6,
11
+
12
+ minPixelValue: 2,
13
+ }),
14
+ ],
15
+ }
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts"></script>
2
+
3
+ <template>
4
+ <router-view v-slot="{ Component }">
5
+ <keep-alive include="Home">
6
+ <component :is="Component" />
7
+ </keep-alive>
8
+ </router-view>
9
+ </template>
10
+
11
+ <style scoped></style>
@@ -0,0 +1,23 @@
1
+ import { request } from '@/core/request'
2
+
3
+ interface UserInfo {
4
+ id: number
5
+ username: string
6
+ avatar: string
7
+ }
8
+
9
+ export function getUserInfo(id: number) {
10
+ return request<UserInfo>({ url: `/user/${id}` })
11
+ }
12
+
13
+ export function login(data: { username: string; password: string }) {
14
+ return request({
15
+ url: '/uaa/oauth/token',
16
+ method: 'POST',
17
+ data,
18
+ auth:{
19
+ username: 'client',
20
+ password: 'secret'
21
+ }
22
+ })
23
+ }