diff --git a/env/.env b/env/.env new file mode 100644 index 0000000..0e4d4d8 --- /dev/null +++ b/env/.env @@ -0,0 +1,16 @@ +VITE_APP_TITLE = 'unibest' +VITE_APP_PORT = 9000 + +VITE_UNI_APPID = 'H57F2ACE4' +VITE_WX_APPID = 'wxa2abb91f64032a2b' + +# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base +VITE_APP_PUBLIC_BASE=/unibest/ + +VITE_SERVER_BASEURL = 'https://ukw0y1.laf.run' +VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload' + +# h5是否需要配置代理 +VITE_APP_PROXY=false +VITE_APP_PROXY_PREFIX = '/api' +VITE_BASEURL = 'https://warehouse.szjixun.cn/oa_backend' diff --git a/env/.env.dev b/env/.env.dev new file mode 100644 index 0000000..afb74ac --- /dev/null +++ b/env/.env.dev @@ -0,0 +1,8 @@ +# 变量必须以 VITE_ 为前缀才能暴露给外部读取 +NODE_ENV = 'development' +# 是否去除console 和 debugger +VITE_DELETE_CONSOLE = false +# 是否开启sourcemap +VITE_SHOW_SOURCEMAP = true +# baseUrl +VITE_BASEURL = 'http://appointtest2.szjixun.cn' diff --git a/env/.env.prod b/env/.env.prod new file mode 100644 index 0000000..1642926 --- /dev/null +++ b/env/.env.prod @@ -0,0 +1,7 @@ +# 变量必须以 VITE_ 为前缀才能暴露给外部读取 +NODE_ENV = 'development' +# 是否去除console 和 debugger +VITE_DELETE_CONSOLE = true +# 是否开启sourcemap +VITE_SHOW_SOURCEMAP = false +VITE_BASEURL = 'https://appoint.szjixun.cn' diff --git a/env/.env.test b/env/.env.test new file mode 100644 index 0000000..ccf3cf1 --- /dev/null +++ b/env/.env.test @@ -0,0 +1,5 @@ +# 变量必须以 VITE_ 为前缀才能暴露给外部读取 +NODE_ENV = 'development' +# 是否去除console 和 debugger +VITE_DELETE_CONSOLE = false +VITE_BASEURL = 'https://appointtest2.szjixun.cn' diff --git a/package.json b/package.json index 348ea5d..c0137dc 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,17 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview" + "dev": "vite --mode dev", + "prod": "vite --mode prod", + "main": "vite --mode main", + "build-test": "vite build --mode test", + "build-prod": "vite build --mode prod", + "serve": "vite preview" }, "dependencies": { "@unocss/reset": "^0.61.9", + "@vueuse/core": "^10.11.0", + "axios": "^1.7.3", "cnjm-postcss-px-to-viewport": "^1.0.1", "jsdom": "^24.0.0", "lodash": "^4.17.21", @@ -31,6 +36,7 @@ "@vitejs/plugin-vue": "^5.0.5", "autoprefixer": "^10.4.20", "babel-plugin-transform-react-jsx": "^6.24.1", + "naive-ui": "^2.39.0", "postcss": "^8.4.40", "sass": "^1.70.0", "unocss": "^0.61.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2626dec..ce21a44 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,12 @@ importers: '@unocss/reset': specifier: ^0.61.9 version: 0.61.9 + '@vueuse/core': + specifier: ^10.11.0 + version: 10.11.0(vue@3.4.35) + axios: + specifier: ^1.7.3 + version: 1.7.3 cnjm-postcss-px-to-viewport: specifier: ^1.0.1 version: 1.0.1(postcss@8.4.40) @@ -69,6 +75,9 @@ importers: babel-plugin-transform-react-jsx: specifier: ^6.24.1 version: 6.24.1 + naive-ui: + specifier: ^2.39.0 + version: 2.39.0(vue@3.4.35) postcss: specifier: ^8.4.40 version: 8.4.40 @@ -80,7 +89,7 @@ importers: version: 0.61.9(postcss@8.4.40)(rollup@4.20.0)(vite@5.3.5(sass@1.77.8)(terser@5.31.3)) unplugin-auto-import: specifier: ^0.18.2 - version: 0.18.2(rollup@4.20.0) + version: 0.18.2(@vueuse/core@10.11.0(vue@3.4.35))(rollup@4.20.0) unplugin-vue-components: specifier: ^0.27.3 version: 0.27.3(@babel/parser@7.25.3)(rollup@4.20.0)(vue@3.4.35) @@ -696,6 +705,16 @@ packages: resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} + '@css-render/plugin-bem@0.15.14': + resolution: {integrity: sha512-QK513CJ7yEQxm/P3EwsI+d+ha8kSOcjGvD6SevM41neEMxdULE+18iuQK6tEChAWMOQNQPLG/Rw3Khb69r5neg==} + peerDependencies: + css-render: ~0.15.14 + + '@css-render/vue3-ssr@0.15.14': + resolution: {integrity: sha512-//8027GSbxE9n3QlD73xFY6z4ZbHbvrOVB7AO6hsmrEzGbg+h2A09HboUyDgu+xsmj7JnvJD39Irt+2D0+iV8g==} + peerDependencies: + vue: ^3.0.11 + '@csstools/cascade-layer-name-parser@2.0.0': resolution: {integrity: sha512-9GEQIvTMrjXfYaVnw1+FteDX5yF65CZq4ttYP75O3CANQevaCJ9jVVTiZt9YTpjYIk8C1mmf52y2S4Hr/CaE/g==} engines: {node: '>=18'} @@ -936,6 +955,9 @@ packages: peerDependencies: postcss: ^8.4 + '@emotion/hash@0.8.0': + resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==} + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -1101,6 +1123,9 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@juggle/resize-observer@3.4.0': + resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1230,6 +1255,18 @@ packages: '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/katex@0.16.7': + resolution: {integrity: sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==} + + '@types/lodash-es@4.17.12': + resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} + + '@types/lodash@4.17.7': + resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==} + + '@types/web-bluetooth@0.0.20': + resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + '@unocss/astro@0.61.9': resolution: {integrity: sha512-adOXz4itYHxqhvQgJHlEU58EHDTtY2qrcEPVmQVk4qI1W+ezQV6nQMQvti8mS/HbFw3MOJhIY1MlJoZK36/cyw==} peerDependencies: @@ -1373,6 +1410,15 @@ packages: '@vue/shared@3.4.35': resolution: {integrity: sha512-hvuhBYYDe+b1G8KHxsQ0diDqDMA8D9laxWZhNAjE83VZb5UDaXl9Xnz7cGdDSyiHM90qqI/CyGMcpBpiDy6VVQ==} + '@vueuse/core@10.11.0': + resolution: {integrity: sha512-x3sD4Mkm7PJ+pcq3HX8PLPBadXCAlSDR/waK87dz0gQE+qJnaaFhc/dZVfJz+IUYzTMVGum2QlR7ImiJQN4s6g==} + + '@vueuse/metadata@10.11.0': + resolution: {integrity: sha512-kQX7l6l8dVWNqlqyN3ePW3KmjCQO3ZMgXuBMddIu83CmucrsBfXlH+JoviYyRBws/yLTQO8g3Pbw+bdIoVm4oQ==} + + '@vueuse/shared@10.11.0': + resolution: {integrity: sha512-fyNoIXEq3PfX1L3NkNhtVQUSRtqYwJtJg+Bp9rIzculIZWHTkKSysujrOk2J+NrRulLTQH9+3gGSfYLWSEWU1A==} + acorn@8.12.1: resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} @@ -1390,6 +1436,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + async-validator@4.2.5: + resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} + asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -1400,6 +1449,9 @@ packages: peerDependencies: postcss: ^8.1.0 + axios@1.7.3: + resolution: {integrity: sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==} + babel-helper-builder-react-jsx@6.26.0: resolution: {integrity: sha512-02I9jDjnVEuGy2BR3LRm9nPRb/+Ja0pvZVLr1eI5TYAA/dB0Xoc+WBo50+aDfhGDLhlBY1+QURjn9uvcFd8gzg==} @@ -1543,6 +1595,9 @@ packages: peerDependencies: postcss: ^8.4 + css-render@0.15.14: + resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==} + css-tree@2.3.1: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} @@ -1559,6 +1614,9 @@ packages: resolution: {integrity: sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==} engines: {node: '>=18'} + csstype@3.0.11: + resolution: {integrity: sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==} + csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} @@ -1566,6 +1624,15 @@ packages: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} + date-fns-tz@2.0.1: + resolution: {integrity: sha512-fJCG3Pwx8HUoLhkepdsP7Z5RsucUi+ZBOxyM5d0ZZ6c4SdYustq0VMmOu6Wf7bli+yS/Jwp91TOCqn9jMcVrUA==} + peerDependencies: + date-fns: 2.x + + date-fns@2.30.0: + resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} + engines: {node: '>=0.11'} + debug@4.3.6: resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} engines: {node: '>=6.0'} @@ -1625,6 +1692,9 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + evtd@0.2.4: + resolution: {integrity: sha512-qaeGN5bx63s/AXgQo8gj6fBkxge+OoLddLniox5qtLAEY5HSnuSlISXVPxnSae1dWblvTh4/HoMIB+mbMsvZzw==} + execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -1644,6 +1714,15 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} + follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -1690,6 +1769,10 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + highlight.js@11.10.0: + resolution: {integrity: sha512-SYVnVFswQER+zu1laSya563s+F8VDGt7o35d4utbamowvUNLLMovFqwCLSocpZTz3MgaSRA1IbqRWZv97dtErQ==} + engines: {node: '>=12.0.0'} + html-encoding-sniffer@4.0.0: resolution: {integrity: sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==} engines: {node: '>=18'} @@ -1801,6 +1884,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash-es@4.17.21: + resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} @@ -1857,6 +1943,11 @@ packages: ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + naive-ui@2.39.0: + resolution: {integrity: sha512-5oUJzRG+rtLSH8eRU+fJvVYiQids2BxF9jp+fwGoAqHOptEINrBlgBu9uy+95RHE5FLJ7Q/z41o+qkoGnUrKxQ==} + peerDependencies: + vue: ^3.0.0 + nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -2118,6 +2209,9 @@ packages: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} + proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} @@ -2202,6 +2296,9 @@ packages: scule@1.3.0: resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==} + seemly@0.3.8: + resolution: {integrity: sha512-MW8Qs6vbzo0pHmDpFSYPna+lwpZ6Zk1ancbajw/7E8TKtHdV+1DfZZD+kKJEhG/cAoB/i+LiT+5msZOqj0DwRA==} + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -2282,6 +2379,9 @@ packages: resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} engines: {node: '>=18'} + treemate@0.3.11: + resolution: {integrity: sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==} + tsx@4.16.5: resolution: {integrity: sha512-ArsiAQHEW2iGaqZ8fTA1nX0a+lN5mNTyuGRRO6OW3H/Yno1y9/t1f9YOI1Cfoqz63VAthn++ZYcbDP7jPflc+A==} engines: {node: '>=18.0.0'} @@ -2377,6 +2477,11 @@ packages: peerDependencies: vue: ^3.0.0 + vdirs@0.1.8: + resolution: {integrity: sha512-H9V1zGRLQZg9b+GdMk8MXDN2Lva0zx72MPahDKc30v+DtwKjfyOSXWRIX4t2mhDubM1H09gPhWeth/BJWPHGUw==} + peerDependencies: + vue: ^3.0.11 + vite@5.3.5: resolution: {integrity: sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2405,6 +2510,22 @@ packages: terser: optional: true + vooks@0.2.12: + resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==} + peerDependencies: + vue: ^3.0.0 + + vue-demi@0.14.10: + resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue-router@4.4.2: resolution: {integrity: sha512-1qNybkn2L7QsLzaXs8nvlQmRKp8XF8DCxZys/Jr1JpQcHsKUxTKzTxCVA1G7NfBfwRIBgCJPoujOG5lHCCNUxw==} peerDependencies: @@ -2418,6 +2539,11 @@ packages: typescript: optional: true + vueuc@0.4.58: + resolution: {integrity: sha512-Wnj/N8WbPRSxSt+9ji1jtDHPzda5h2OH/0sFBhvdxDRuyCZbjGg3/cKMaKqEoe+dErTexG2R+i6Q8S/Toq1MYg==} + peerDependencies: + vue: ^3.0.11 + w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -3283,6 +3409,14 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@css-render/plugin-bem@0.15.14(css-render@0.15.14)': + dependencies: + css-render: 0.15.14 + + '@css-render/vue3-ssr@0.15.14(vue@3.4.35)': + dependencies: + vue: 3.4.35 + '@csstools/cascade-layer-name-parser@2.0.0(@csstools/css-parser-algorithms@3.0.0(@csstools/css-tokenizer@3.0.0))(@csstools/css-tokenizer@3.0.0)': dependencies: '@csstools/css-parser-algorithms': 3.0.0(@csstools/css-tokenizer@3.0.0) @@ -3521,6 +3655,8 @@ snapshots: dependencies: postcss: 8.4.40 + '@emotion/hash@0.8.0': {} + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -3626,6 +3762,8 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@juggle/resize-observer@3.4.0': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -3708,6 +3846,16 @@ snapshots: '@types/estree@1.0.5': {} + '@types/katex@0.16.7': {} + + '@types/lodash-es@4.17.12': + dependencies: + '@types/lodash': 4.17.7 + + '@types/lodash@4.17.7': {} + + '@types/web-bluetooth@0.0.20': {} + '@unocss/astro@0.61.9(rollup@4.20.0)(vite@5.3.5(sass@1.77.8)(terser@5.31.3))': dependencies: '@unocss/core': 0.61.9 @@ -3952,6 +4100,25 @@ snapshots: '@vue/shared@3.4.35': {} + '@vueuse/core@10.11.0(vue@3.4.35)': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 10.11.0 + '@vueuse/shared': 10.11.0(vue@3.4.35) + vue-demi: 0.14.10(vue@3.4.35) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/metadata@10.11.0': {} + + '@vueuse/shared@10.11.0(vue@3.4.35)': + dependencies: + vue-demi: 0.14.10(vue@3.4.35) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + acorn@8.12.1: {} agent-base@7.1.1: @@ -3969,6 +4136,8 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + async-validator@4.2.5: {} + asynckit@0.4.0: {} autoprefixer@10.4.20(postcss@8.4.40): @@ -3981,6 +4150,14 @@ snapshots: postcss: 8.4.40 postcss-value-parser: 4.2.0 + axios@1.7.3: + dependencies: + follow-redirects: 1.15.6 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + babel-helper-builder-react-jsx@6.26.0: dependencies: babel-runtime: 6.26.0 @@ -4139,6 +4316,11 @@ snapshots: dependencies: postcss: 8.4.40 + css-render@0.15.14: + dependencies: + '@emotion/hash': 0.8.0 + csstype: 3.0.11 + css-tree@2.3.1: dependencies: mdn-data: 2.0.30 @@ -4152,6 +4334,8 @@ snapshots: dependencies: rrweb-cssom: 0.6.0 + csstype@3.0.11: {} + csstype@3.1.3: {} data-urls@5.0.0: @@ -4159,6 +4343,14 @@ snapshots: whatwg-mimetype: 4.0.0 whatwg-url: 14.0.0 + date-fns-tz@2.0.1(date-fns@2.30.0): + dependencies: + date-fns: 2.30.0 + + date-fns@2.30.0: + dependencies: + '@babel/runtime': 7.25.0 + debug@4.3.6: dependencies: ms: 2.1.2 @@ -4217,6 +4409,8 @@ snapshots: esutils@2.0.3: {} + evtd@0.2.4: {} + execa@5.1.1: dependencies: cross-spawn: 7.0.3 @@ -4250,6 +4444,8 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 + follow-redirects@1.15.6: {} + form-data@4.0.0: dependencies: asynckit: 0.4.0 @@ -4287,6 +4483,8 @@ snapshots: dependencies: function-bind: 1.1.2 + highlight.js@11.10.0: {} + html-encoding-sniffer@4.0.0: dependencies: whatwg-encoding: 3.1.1 @@ -4405,6 +4603,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash-es@4.17.21: {} + lodash.debounce@4.0.8: {} lodash@4.17.21: {} @@ -4453,6 +4653,29 @@ snapshots: ms@2.1.2: {} + naive-ui@2.39.0(vue@3.4.35): + dependencies: + '@css-render/plugin-bem': 0.15.14(css-render@0.15.14) + '@css-render/vue3-ssr': 0.15.14(vue@3.4.35) + '@types/katex': 0.16.7 + '@types/lodash': 4.17.7 + '@types/lodash-es': 4.17.12 + async-validator: 4.2.5 + css-render: 0.15.14 + csstype: 3.1.3 + date-fns: 2.30.0 + date-fns-tz: 2.0.1(date-fns@2.30.0) + evtd: 0.2.4 + highlight.js: 11.10.0 + lodash: 4.17.21 + lodash-es: 4.17.21 + seemly: 0.3.8 + treemate: 0.3.11 + vdirs: 0.1.8(vue@3.4.35) + vooks: 0.2.12(vue@3.4.35) + vue: 3.4.35 + vueuc: 0.4.58(vue@3.4.35) + nanoid@3.3.7: {} node-fetch-native@1.6.4: {} @@ -4762,6 +4985,8 @@ snapshots: process@0.11.10: {} + proxy-from-env@1.1.0: {} + psl@1.9.0: {} punycode@2.3.1: {} @@ -4857,6 +5082,8 @@ snapshots: scule@1.3.0: {} + seemly@0.3.8: {} + semver@6.3.1: {} shebang-command@2.0.0: @@ -4926,6 +5153,8 @@ snapshots: dependencies: punycode: 2.3.1 + treemate@0.3.11: {} + tsx@4.16.5: dependencies: esbuild: 0.21.5 @@ -5003,7 +5232,7 @@ snapshots: - rollup - supports-color - unplugin-auto-import@0.18.2(rollup@4.20.0): + unplugin-auto-import@0.18.2(@vueuse/core@10.11.0(vue@3.4.35))(rollup@4.20.0): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.0(rollup@4.20.0) @@ -5013,6 +5242,8 @@ snapshots: minimatch: 9.0.5 unimport: 3.10.0(rollup@4.20.0) unplugin: 1.12.0 + optionalDependencies: + '@vueuse/core': 10.11.0(vue@3.4.35) transitivePeerDependencies: - rollup @@ -5066,6 +5297,11 @@ snapshots: '@vue/shared': 3.4.35 vue: 3.4.35 + vdirs@0.1.8(vue@3.4.35): + dependencies: + evtd: 0.2.4 + vue: 3.4.35 + vite@5.3.5(sass@1.77.8)(terser@5.31.3): dependencies: esbuild: 0.21.5 @@ -5076,6 +5312,15 @@ snapshots: sass: 1.77.8 terser: 5.31.3 + vooks@0.2.12(vue@3.4.35): + dependencies: + evtd: 0.2.4 + vue: 3.4.35 + + vue-demi@0.14.10(vue@3.4.35): + dependencies: + vue: 3.4.35 + vue-router@4.4.2(vue@3.4.35): dependencies: '@vue/devtools-api': 6.6.3 @@ -5089,6 +5334,17 @@ snapshots: '@vue/server-renderer': 3.4.35(vue@3.4.35) '@vue/shared': 3.4.35 + vueuc@0.4.58(vue@3.4.35): + dependencies: + '@css-render/vue3-ssr': 0.15.14(vue@3.4.35) + '@juggle/resize-observer': 3.4.0 + css-render: 0.15.14 + evtd: 0.2.4 + seemly: 0.3.8 + vdirs: 0.1.8(vue@3.4.35) + vooks: 0.2.12(vue@3.4.35) + vue: 3.4.35 + w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 diff --git a/src/api/auth/index.js b/src/api/auth/index.js new file mode 100644 index 0000000..40b97e8 --- /dev/null +++ b/src/api/auth/index.js @@ -0,0 +1,9 @@ +import request from '@/service/index.js' +export const sendCode = (data) => { + console.log('schildrenchildrenendCode') + return request({ + url: '/api/children/competition/sendCode', + method: 'POST', + data, + }) +} diff --git a/src/assets/image/dfbackground@2.png b/src/assets/image/dfbackground@2.png new file mode 100644 index 0000000..cada8f3 Binary files /dev/null and b/src/assets/image/dfbackground@2.png differ diff --git a/src/assets/image/gdz12@2x.png b/src/assets/image/gdz12@2x.png new file mode 100644 index 0000000..d5b425d Binary files /dev/null and b/src/assets/image/gdz12@2x.png differ diff --git a/src/assets/image/z3327@2x1.png b/src/assets/image/z3327@2x1.png new file mode 100644 index 0000000..cd7c149 Binary files /dev/null and b/src/assets/image/z3327@2x1.png differ diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 546ebbc..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - diff --git a/src/dict/index.js b/src/dict/index.js index 327e88d..b9e83fc 100644 --- a/src/dict/index.js +++ b/src/dict/index.js @@ -1,3 +1 @@ -export const sizes = [ - {minWidth:'375px',maxWidth:'768px'}, {minWidth:'768px',maxWidth:'1440px'}, {minWidth:'1440px',maxWidth: '1920px'}, {minWidth:'1920px'} -] +export const sizes = [ {minWidth:'0px',maxWidth:'768px'}, {minWidth:'768px',maxWidth:'1440px'}, {minWidth:'1440px',maxWidth: '1920px'}, {minWidth:'1920px'}] diff --git a/src/main.js b/src/main.js index 92c1e9f..7588280 100644 --- a/src/main.js +++ b/src/main.js @@ -7,5 +7,16 @@ import 'virtual:uno.css' import router from "./router/index.js"; const app = createApp(App); app.use(router); - +app.directive('no-space', { + mounted(el) { + el.addEventListener('input', (e) => { + const originalValue = e.target.value; + const newValue = originalValue.replace(/\s/g, ''); + if (originalValue !== newValue) { + e.target.value = newValue; + e.target.dispatchEvent(new Event('input')); + } + }); + } +}) app.mount('#app'); diff --git a/src/router/index.js b/src/router/index.js index 64d593a..e067d40 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,7 @@ import { createRouter, createWebHistory } from 'vue-router'; const routes = [ { path: '/', - redirect: 'login' + redirect: 'auth' }, { path: '/login', diff --git a/src/service/index.js b/src/service/index.js new file mode 100644 index 0000000..a511f3c --- /dev/null +++ b/src/service/index.js @@ -0,0 +1,38 @@ +import { useRouter } from 'vue-router'; +import Request from '@/service/request/index.js' +const request = new Request({ + baseURL: import.meta.env.VITE_BASEURL, + timeout: 1000 * 60 * 5, + interceptors: { + //实例的请求拦截器 + requestInterceptors: (config) => { + const token=localStorage.getItem('token') + config.headers['Content-Type'] = config.method === 'get' ? + 'application/x-www-form-urlencoded' : + 'application/json'; + if (config.isFormData) { + config.headers['Content-Type'] = 'multipart/form-data'; + config.headers['Authorization'] = token + } else { + config.headers['Authorization'] = token + } + return config; + }, + //实例的响应拦截器 + responseInterceptors: async (response) => { + if ([200, 201, 204].includes(response.status)) { + return response.config.responseType === 'blob' ? response : response; + } else { + return Promise.reject(new Error(response.data.msg || 'An error occurred.')); + } + } + } +}); +const fontRequest = (config) => { + if (['get', 'GET'].includes(config.method)) { + config.params = config.data; + } + return request.request(config); +}; + +export default fontRequest; diff --git a/src/service/request/index.js b/src/service/request/index.js new file mode 100644 index 0000000..294cd0c --- /dev/null +++ b/src/service/request/index.js @@ -0,0 +1,77 @@ +import axios from 'axios'; +class Request { + // axios 实例 + instance; + // 拦截器对象 + interceptorsObj; + // * 存放取消请求控制器Map + abortControllerMap; + constructor(config) { + this.instance = axios.create(config); + // * 初始化存放取消请求控制器Map + this.abortControllerMap = new Map(); + this.interceptorsObj = config.interceptors; + // 拦截器执行顺序 接口请求 -> 实例请求 -> 全局请求 -> 实例响应 -> 全局响应 -> 接口响应 + this.instance.interceptors.request.use((res) => { + const controller = new AbortController(); + const url = res.url || ''; + res.signal = controller.signal; + this.abortControllerMap.set(url, controller); + return res; + }, (err) => err); + // 使用实例拦截器 + this.instance.interceptors.request.use(this.interceptorsObj?.requestInterceptors, this.interceptorsObj?.requestInterceptorsCatch); + this.instance.interceptors.response.use(this.interceptorsObj?.responseInterceptors, this.interceptorsObj?.responseInterceptorsCatch); + // 全局响应拦截器保证最后执行 + this.instance.interceptors.response.use( + // 因为我们接口的数据都在res.data下,所以我们直接返回res.data + (res) => { + const url = res.config.url || ''; + this.abortControllerMap.delete(url); + return res.data; + }, (err) => err); + } + request(config) { + return new Promise((resolve, reject) => { + // 如果我们为单个请求设置拦截器,这里使用单个请求的拦截器 + if (config.interceptors?.requestInterceptors) { + config = config.interceptors.requestInterceptors(config); + } + this.instance + .request(config) + .then((res) => { + // 如果我们为单个响应设置拦截器,这里使用单个响应的拦截器 + if (config.interceptors?.responseInterceptors) { + res = config.interceptors.responseInterceptors(res); + } + resolve(res); + }) + .catch((err) => { + reject(err); + }); + // .finally(() => {}) + }); + } + /** + * 取消全部请求 + */ + cancelAllRequest() { + for (const [, controller] of this.abortControllerMap) { + controller.abort(); + } + this.abortControllerMap.clear(); + } + /** + * 取消指定的请求 + * @param url 待取消的请求URL + */ + cancelRequest(url) { + const urlList = Array.isArray(url) ? url : [url]; + for (const _url of urlList) { + this.abortControllerMap.get(_url)?.abort(); + this.abortControllerMap.delete(_url); + } + } +} +export default Request; + diff --git a/src/store/auth/index.js b/src/store/auth/index.js new file mode 100644 index 0000000..19e9a51 --- /dev/null +++ b/src/store/auth/index.js @@ -0,0 +1,29 @@ +import {ref} from 'vue' +import {createGlobalState,useStorage} from '@vueuse/core' +import {sendCode} from '@/api/auth/index.js' +import {message} from "@/utils/message.js" +export const useAuth=createGlobalState(()=>{ + const token = useStorage('token', '', localStorage) + const telNum =ref('') + const code=ref('') + const clickSendCode=async ()=>{ + if (!telNum.value){ + message.warning('请输入手机号') + return + } + const data={ + telNum:telNum.value + } + const res=await sendCode(data) + if (res.status===0){ + message.success('发送成功') + } + } + return { + code, + clickSendCode, + telNum, + token + } + +}) diff --git a/src/utils/message.js b/src/utils/message.js new file mode 100644 index 0000000..2c163d1 --- /dev/null +++ b/src/utils/message.js @@ -0,0 +1,5 @@ +import {createDiscreteApi, useMessage} from 'naive-ui' +const { message } = createDiscreteApi( + ["message"] +) +export {message} diff --git a/src/views/confirm/index.vue b/src/views/confirm/index.vue index 69f66bd..254d9d9 100644 --- a/src/views/confirm/index.vue +++ b/src/views/confirm/index.vue @@ -3,14 +3,20 @@ import {useAdaptation} from "@/utils/self-adaption.js"; import {sizes} from "@/dict/index.js"; import size375 from '@/views/confirm/size375/index.vue' import {computed} from "vue"; -const {maxWidth}= useAdaptation(sizes,(maxWidth)=>{ -}) +import size768 from "@/views/confirm/size768/index.vue"; +import size1440 from "@/views/login/size1440/index.vue"; +import size1920 from "@/views/login/size1920/index.vue"; +const {currentRange }= useAdaptation(sizes) const viewComponent = computed(()=>{ - switch (maxWidth.value){ - case '375px': - return size375 - default: + switch (currentRange.value?.minWidth){ + case '0px': return size375 + case '768px': + return size768 + case '1440px': + return size1440 + case '1920px': + return size1920 } }) diff --git a/src/views/confirm/size768/index.vue b/src/views/confirm/size768/index.vue new file mode 100644 index 0000000..0f5f9f8 --- /dev/null +++ b/src/views/confirm/size768/index.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 0036823..db689a1 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,4 +1,6 @@ diff --git a/src/views/login/size375/index.vue b/src/views/login/size375/index.vue index 39dbfa0..3f8d283 100644 --- a/src/views/login/size375/index.vue +++ b/src/views/login/size375/index.vue @@ -1,49 +1,43 @@ -