From 6acc2962103c91c3cb44424667a4fb8298fc2d10 Mon Sep 17 00:00:00 2001 From: hubgant Date: Wed, 26 Feb 2025 20:38:39 +0800 Subject: [PATCH] =?UTF-8?q?dev=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 6 +-- .env.local | 6 +-- src/api/login/index.ts | 1 - src/views/Login/components/MobileForm.vue | 2 +- vite.config.ts | 52 +++++++++++++++++------ 5 files changed, 45 insertions(+), 22 deletions(-) diff --git a/.env b/.env index 4b0f5bf6a..6ec48c509 100644 --- a/.env +++ b/.env @@ -20,6 +20,6 @@ VITE_APP_DOCALERT_ENABLE=true VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc # 默认账户密码 -VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码 -VITE_APP_DEFAULT_LOGIN_USERNAME = admin -VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123 +VITE_APP_DEFAULT_LOGIN_TENANT = 橙子联盟 +VITE_APP_DEFAULT_LOGIN_USERNAME = 15068728241 +VITE_APP_DEFAULT_LOGIN_PASSWORD = 123456 diff --git a/.env.local b/.env.local index b04d38876..26993e4d0 100644 --- a/.env.local +++ b/.env.local @@ -5,14 +5,14 @@ VITE_DEV=true # 请求路径 # VITE_BASE_URL='http://localhost:48080' -VITE_BASE_URL = 'http://www.hs365.top' +VITE_BASE_URL = 'https://www.hs365.top' # 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 VITE_UPLOAD_TYPE=server # 接口地址 -# VITE_API_URL=/admin-api -VITE_API_URL=/api +VITE_API_URL=/admin-api +# VITE_API_URL=/api # 是否删除debugger VITE_DROP_DEBUGGER=true diff --git a/src/api/login/index.ts b/src/api/login/index.ts index 8c69d9bc9..5c4831cb1 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -72,7 +72,6 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => { } // 获取验证图片以及 token export const getCode = (data: any) => { - debugger return request.postOriginal({ url: 'system/captcha/get', data }) } diff --git a/src/views/Login/components/MobileForm.vue b/src/views/Login/components/MobileForm.vue index 7f5d9942e..ec4b77643 100644 --- a/src/views/Login/components/MobileForm.vue +++ b/src/views/Login/components/MobileForm.vue @@ -133,7 +133,7 @@ const loginData = reactive({ }, loginForm: { uuid: '', - tenantName: '芋道源码', + tenantName: '橙子联盟', mobileNumber: '', code: '' } diff --git a/vite.config.ts b/vite.config.ts index 7e15f84e2..fd1999fb6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -24,20 +24,44 @@ export default ({command, mode}: ConfigEnv): UserConfig => { base: env.VITE_BASE_PATH, root: root, // 服务端渲染 - server: { - port: env.VITE_PORT, // 端口号 - host: "0.0.0.0", - open: env.VITE_OPEN === 'true', - // 本地跨域代理. 目前注释的原因:暂时没有用途,server 端已经支持跨域 - // proxy: { - // ['/admin-api']: { - // target: env.VITE_BASE_URL, - // ws: false, - // changeOrigin: true, - // rewrite: (path) => path.replace(new RegExp(`^/admin-api`), ''), - // }, - // }, - }, + // server: { + // port: env.VITE_PORT, // 端口号 + // host: "0.0.0.0", + // open: env.VITE_OPEN === 'true', + // // 本地跨域代理. 目前注释的原因:暂时没有用途,server 端已经支持跨域 + // proxy: { + // ['/app-api']: { + // target: env.VITE_BASE_URL, + // ws: true, + // changeOrigin: true, + // rewrite: (path) => path.replace(new RegExp(`^/app-api`), '/admin-api'), + // bypass(req, res, options) { + // const proxyURL = options.target + options?.rewrite(req.url); + // console.log("proxyURL", proxyURL); + // req.headers["x-req-proxyURL"] = proxyURL; // 设置未生效 + // res.setHeader("x-req-proxyURL", proxyURL); // 设置响应头可以看到 + // }, + // }, + // }, + // }, + // server: { + // cors:true, + // // 本地跨域代理. 目前注释的原因:暂时没有用途,server 端已经支持跨域 + // proxy: { + // ['/admin-api']: { + // target: env.VITE_BASE_URL, + // ws: true, + // changeOrigin: true, + // rewrite: (path) => path.replace(new RegExp(`^/admin-api`), '/app-api'), + // bypass(req, res, options) { + // const proxyURL = options.target + options?.rewrite(req.url); + // console.log("proxyURL", proxyURL); + // req.headers["x-req-proxyURL"] = proxyURL; // 设置未生效 + // res.setHeader("x-req-proxyURL", proxyURL); // 设置响应头可以看到 + // }, + // }, + // }, + // }, // 项目使用的vite插件。 单独提取到build/vite/plugin中管理 plugins: createVitePlugins(), css: {