diff --git a/.env.dev b/.env.dev index dc7d250..ff47476 100644 --- a/.env.dev +++ b/.env.dev @@ -4,7 +4,7 @@ NODE_ENV=production VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' +VITE_BASE_URL='http://localhost:48080' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 VITE_UPLOAD_TYPE=server @@ -31,7 +31,7 @@ VITE_OUT_DIR=dist VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' # 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=true +VITE_APP_CAPTCHA_ENABLE=false # GoView域名 VITE_GOVIEW_URL='http://127.0.0.1:3000' \ No newline at end of file diff --git a/.env.prod b/.env.prod index ff67210..35f39a1 100644 --- a/.env.prod +++ b/.env.prod @@ -28,7 +28,7 @@ VITE_BASE_PATH=/ VITE_OUT_DIR=dist-prod # 商城H5会员端域名 -VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' +VITE_MALL_H5_DOMAIN='http://127.0.0.1:3000' # GoView域名 VITE_GOVIEW_URL='http://127.0.0.1:3000' \ No newline at end of file diff --git a/src/api/system/maxkb/index.ts b/src/api/system/maxkb/index.ts new file mode 100644 index 0000000..a1b272f --- /dev/null +++ b/src/api/system/maxkb/index.ts @@ -0,0 +1,7 @@ +import request from '@/config/axios' + +// 推送maxkb知识库 +export const pushWeb = async (data:any) => { + return await request.post({ url: '/system/maxkb/pushWeb',data }) +} + diff --git a/src/views/Login/components/QrCodeForm.vue b/src/views/Login/components/QrCodeForm.vue index 9e5d625..b1c6cd0 100644 --- a/src/views/Login/components/QrCodeForm.vue +++ b/src/views/Login/components/QrCodeForm.vue @@ -69,7 +69,10 @@ const getimg =async ()=>{ //开始刷新扫码信息 refaulst(); } - +// 记录定时器开始的时间 +const startTime = Date.now(); +// 10 分钟的毫秒数 +const tenMinutes = 60 * 1000; //定时刷新 判断是否扫码允许 const refaulst = ()=>{ // 先清除之前的定时器,避免重复调用 @@ -79,14 +82,20 @@ const refaulst = ()=>{ // 设置定时器,每 5 秒(可根据实际需求调整)调用一次接口 intervalId.value = setInterval(async () => { try { + + // 检查是否已经过去了 10 分钟 + if (Date.now() - startTime >= tenMinutes) { + clearInterval(intervalId.value); + console.log('定时器已停止,已过去 10 分钟。'); + return; + } + const res = await LoginApi.qrLoginCode({code:uuuid.value}) if(res){ - debugger - + clearInterval(intervalId.value); authUtil.setToken(res) router.push({ path: '/' }) - clearInterval(intervalId.value); } } catch (error) {