Commit 2843c649a701dec8d35077a5add0859ef5116a1b
1 parent
a03b1e32
feat: 修改配置文件
Showing
3 changed files
with
25 additions
and
2 deletions
.env.production
| ... | ... | @@ -5,7 +5,8 @@ VITE_APP_TITLE = "青浦巴士岗前检测系统" |
| 5 | 5 | VITE_APP_ENV = 'production' |
| 6 | 6 | |
| 7 | 7 | # 签到机系统/生产环境 |
| 8 | -VITE_APP_BASE_API = 'http://101.95.136.202:8100' | |
| 8 | +# VITE_APP_BASE_API = 'http://101.95.136.202:8100' | |
| 9 | +VITE_APP_BASE_API = 'http://101.95.136.206:8100' | |
| 9 | 10 | # VITE_APP_BASE_API = 'http://1.14.107.94:8100' |
| 10 | 11 | |
| 11 | 12 | # 是否在打包时开启压缩,支持 gzip 和 brotli | ... | ... |
src/hooks/defer.js
0 → 100644
| 1 | +import { onUnmounted, ref } from 'vue'; | |
| 2 | + | |
| 3 | +export function useDefer( maxCount = 100) { | |
| 4 | + const frameCount = ref(1); | |
| 5 | + let rafId; | |
| 6 | + function updateFrameCount() { | |
| 7 | + rafId = requestAnimationFrame(() => { | |
| 8 | + frameCount.value++; | |
| 9 | + if (frameCount.value >= maxCount) { | |
| 10 | + return; | |
| 11 | + } | |
| 12 | + updateFrameCount(); | |
| 13 | + }); | |
| 14 | + } | |
| 15 | + updateFrameCount(); | |
| 16 | + onUnmounted(() => { | |
| 17 | + cancelAnimationFrame(rafId); | |
| 18 | + }) | |
| 19 | + return function (n) { | |
| 20 | + return frameCount.value >= n; | |
| 21 | + } | |
| 22 | +} | ... | ... |
vite.config.js
| ... | ... | @@ -31,7 +31,7 @@ export default defineConfig(({ mode, command }) => { |
| 31 | 31 | proxy: { |
| 32 | 32 | // https://cn.vitejs.dev/config/#server-proxy |
| 33 | 33 | '/dev-api': { |
| 34 | - target: 'http://localhost:8080', | |
| 34 | + target: 'http://192.168.168.124:8100', | |
| 35 | 35 | changeOrigin: true, |
| 36 | 36 | rewrite: (p) => p.replace(/^\/dev-api/, '') |
| 37 | 37 | } | ... | ... |