-- 环境更改

This commit is contained in:
yuping
2022-12-14 21:21:58 +08:00
parent 62253c8be9
commit 12c3a1ce72
9 changed files with 23 additions and 23 deletions

12
.env
View File

@@ -1,8 +1,8 @@
VITE_BASE=/manage VUE_APP_BASE=/manage
VITE_BASE_API=/ VUE_APP_BASE_API=/manageApi
VITE_PROXY_URL=http://111.231.196.214:30001/ VUE_APP_PROXY_URL=http://111.231.196.214:30001/
VITE_LOGIN_URL=https://u-pre.boe.com/web VUE_APP_LOGIN_URL=https://u-pre.boe.com/web
VITE_IFRAME_URL=https://u-pre.boe.com/pc-release/iframe VUE_APP_IFRAME_URL=https://u-pre.boe.com/pc-release/iframe
VITE_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc-release/loading VUE_APP_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc-release/loading

View File

@@ -1,4 +1,4 @@
VITE_BASE=/manage VUE_APP_BASE=/manage
VITE_BASE_API=/manageApi VUE_APP_BASE_API=/manageApi

View File

@@ -1,2 +1,2 @@
VITE_BASE=/manage VUE_APP_BASE=/manage
VITE_BASE_API=/manageApi VUE_APP_BASE_API=/manageApi

View File

@@ -1,7 +1,7 @@
VITE_BASE=/manage-release VUE_APP_BASE=/manage-release
VITE_BASE_API=/manageApi-release VUE_APP_BASE_API=/manageApi-release
VITE_LOGIN_URL=https://u.boe.com/web VUE_APP_LOGIN_URL=https://u.boe.com/web
VITE_IFRAME_URL=https://u-pre.boe.com/pc-release/iframe VUE_APP_IFRAME_URL=https://u-pre.boe.com/pc-release/iframe
VITE_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc-release/loading VUE_APP_IFRAME_STUDENT_URL=https://u-pre.boe.com/pc-release/loading

View File

@@ -1,4 +1,4 @@
VITE_BASE=/manage VUE_APP_BASE=/manage
VITE_BASE_API=/manageApi VUE_APP_BASE_API=/manageApi

View File

@@ -17,7 +17,7 @@ import router from "@/router";
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
const http = axios.create({ const http = axios.create({
baseURL: process.env.VITE_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
timeout: 1000 * 15, timeout: 1000 * 15,
// headers: { "Content-Type": "multipart/form-data" }, // headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
@@ -57,7 +57,7 @@ http.interceptors.response.use(
return response; return response;
} else { } else {
if (code === 1000) { if (code === 1000) {
process.env.NODE_ENV === 'development' ? router.push({ path: 'login' }) : (window.location.href = process.env.VITE_LOGIN_URL) process.env.NODE_ENV === 'development' ? router.push({ path: 'login' }) : (window.location.href = process.env.VUE_APP_LOGIN_URL)
} }
console.log("api %o", msg); console.log("api %o", msg);
} }

View File

@@ -276,9 +276,9 @@ const commonData = {
const organizationalTree = [] const organizationalTree = []
//嵌套页面 //嵌套页面
const iframeUrl = process.env.VITE_IFRAME_URL const iframeUrl = process.env.VUE_APP_IFRAME_URL
//学员端路由 //学员端路由
const studentUrl = process.env.VITE_IFRAME_STUDENT_URL const studentUrl = process.env.VUE_APP_IFRAME_STUDENT_URL
//二维码 //二维码
const codeUrl = "https://u-pre.boe.com" const codeUrl = "https://u-pre.boe.com"

View File

@@ -17,7 +17,7 @@ const routes = [
...routesConfig ...routesConfig
] ]
const router = createRouter({ const router = createRouter({
history: createWebHistory(process.env.VITE_BASE), history: createWebHistory(process.env.VUE_APP_BASE),
routes, routes,
}) })

View File

@@ -15,7 +15,7 @@ module.exports = defineConfig({
port: 8080, port: 8080,
proxy: { proxy: {
"/manageApi": { "/manageApi": {
target: process.env.VITE_PROXY_URL, target: process.env.VUE_APP_PROXY_URL,
changeOrigin: true, //表示是否改变原域名 changeOrigin: true, //表示是否改变原域名
// secure: false, // secure: false,
// ws: false, //表示WebSocket协议 // ws: false, //表示WebSocket协议