From ba622ba174be6d5c115ba2a1a41dcf3c6f76402d Mon Sep 17 00:00:00 2001 From: daihh Date: Fri, 3 Jun 2022 11:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=8E=AF=E5=A2=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.preview | 2 +- .env.production | 2 +- .env.testing | 26 ++++++++++++++++++++++++++ .gitignore | 1 + package.json | 2 ++ src/utils/tools.js | 14 -------------- src/views/Index.vue | 5 ++--- src/views/Login.vue | 3 +-- 8 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 .env.testing diff --git a/.env.preview b/.env.preview index c1e3d4d3..1bfad93f 100644 --- a/.env.preview +++ b/.env.preview @@ -8,7 +8,7 @@ VUE_APP_BASE_API = '/systemapi' VUE_APP_BOE_BASE_API = '/uboeApi' # BOE系统网址 -VUE_APP_BOE_WEB_URL = 'https://u.boe.com' +VUE_APP_BOE_WEB_URL = 'https://u.boe.com/preview' # BOE 移动端url VUE_APP_BOE_MOBILE_URL = 'http://u.boe.com' diff --git a/.env.production b/.env.production index 003beda1..e55f5aa8 100644 --- a/.env.production +++ b/.env.production @@ -8,7 +8,7 @@ VUE_APP_BASE_API = '/systemapi' VUE_APP_BOE_BASE_API = '/uboeApi' # BOE系统网址 -VUE_APP_BOE_WEB_URL = 'https://u.boe.com' +VUE_APP_BOE_WEB_URL = 'https://u.boe.com/production' # BOE 移动端url VUE_APP_BOE_MOBILE_URL = 'http://u.boe.com' diff --git a/.env.testing b/.env.testing new file mode 100644 index 00000000..41401462 --- /dev/null +++ b/.env.testing @@ -0,0 +1,26 @@ +# 生产环境配置 +ENV = 'testing' + +# 管理系统/生产环境 +VUE_APP_BASE_API = '/systemapi' + +# BOE管理系统/开发环境 +VUE_APP_BOE_BASE_API = '/uboeApi' + +# BOE系统网址 +VUE_APP_BOE_WEB_URL = 'https://u-pre.boe.com/testing' + +# BOE 移动端url +VUE_APP_BOE_MOBILE_URL = 'http://u-pre.boe.com' + +# File路径的基础url +VUE_APP_FILE_BASE_URL='http://u-pre.boe.com/upload' + +# File路径的基础url的相对路径,加此项是为了不影响之前的路径配置 +VUE_APP_FILE_RELATIVE_PATH = '/upload' + +# 虚拟目录的变量,结尾的/在vue.config.js中添加 +VUE_APP_PUBLIC_PATH='/pc' + +# 登录地址 +VUE_APP_LOGIN_URL='https://u-pre.boe.com/web/' diff --git a/.gitignore b/.gitignore index 4e637713..acd58038 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules node_modules +/dist diff --git a/package.json b/package.json index d5212c4a..09f69ff6 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "scripts": { "dev": "vue-cli-service serve", "serve": "vue-cli-service serve", + "serve:testing": "vue-cli-service serve --mode testing", + "serve:preview": "vue-cli-service serve --mode preview", "build": "vue-cli-service build", "build:development": "vue-cli-service build --mode development", "build:preview": "vue-cli-service build --mode preview", diff --git a/src/utils/tools.js b/src/utils/tools.js index 227d92f7..dc7642ae 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -5,20 +5,6 @@ export const deepCopy = (obj) => { return JSON.parse(JSON.stringify(obj)); }; -/**文件的基础路径*/ -export function getFileBaseUrl() { - let protocol=window.location.protocol; - let configPath=process.env.VUE_APP_FILE_BASE_URL; - let baseUrl=''; - if(configPath.startsWith('http')){ - baseUrl = configPath; - }else{ - let domain = window.location.host; - baseUrl = protocol+'//'+domain+configPath; - } - return baseUrl; -} - /** * 获取url协议 * @param {Object} type diff --git a/src/views/Index.vue b/src/views/Index.vue index 14fd4d49..786fb40c 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -293,7 +293,7 @@ import ad from '@/components/Portal/adFloat.vue'; import interactRowBar from '@/components/Portal/interactRowBar.vue'; import courseImage from '@/components/Course/courseImage.vue'; import articleImage from '@/components/Article/articleImage.vue'; -import { toScore,getFileBaseUrl} from '@/utils/tools.js'; +import { toScore} from '@/utils/tools.js'; export default { name: 'index', components: { portalHeader,ad, portalFooter, articleImage, portalFloatTools, authorInfo, interactRowBar, interactBar, courseImage }, @@ -331,8 +331,7 @@ export default { }; }, mounted() { - //console.log(getFileBaseUrl(),'getFileBaseUrl') - console.log(this.$Constants.fileBaseUrl,'fileBaseUrl地址'); + //console.log(this.$Constants.fileBaseUrl,'fileBaseUrl地址'); this.getCourseData(1); this.getCaseData(); this.getArticleData(); diff --git a/src/views/Login.vue b/src/views/Login.vue index 61c691c0..bd96328b 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -35,7 +35,6 @@