提交 36873e64 编写于 作者: 杨广俊's avatar 杨广俊

支持环境变量

上级 9462ff57
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"private": true, "private": true,
"license": "GPL", "license": "GPL",
"scripts": { "scripts": {
"dev": "cross-env NODE_ENV=online node build/dev-server.js", "dev": "cross-env NODE_ENV=dev node build/dev-server.js",
"local": "cross-env NODE_ENV=local node build/dev-server.js", "local": "cross-env NODE_ENV=local node build/dev-server.js",
"build": "node build/build.js", "build": "node build/build.js",
"build:dev": "cross-env NODE_ENV=dev node build/build.js", "build:dev": "cross-env NODE_ENV=dev node build/build.js",
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</template> </template>
<script> <script>
import { jumpWebPageUrl } from "@/utils/index"; import { getWebPageUrl } from "@/utils/index";
export default { export default {
data() { data() {
return { return {
...@@ -70,7 +70,7 @@ export default { ...@@ -70,7 +70,7 @@ export default {
}, },
goSearch() { goSearch() {
let _this = this, let _this = this,
url = jumpWebPageUrl; url = getWebPageUrl('sousuo/#/index');
let itemData = { let itemData = {
title: "", title: "",
imageUrl: "", imageUrl: "",
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
paramList: [ paramList: [
{ {
key: "pageUrl", key: "pageUrl",
value: url + 'sousuo/#/index', value: url,
type: 4, type: 4,
seqNo: 1 seqNo: 1
}, },
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
<script> <script>
// import { setEventByModuleCode } from '@/utils/index' // import { setEventByModuleCode } from '@/utils/index'
import { teacher } from '../../utils/buryingPoint'; import { teacher } from '../../utils/buryingPoint';
import { jumpWebPageUrl } from '@/utils/index'
export default { export default {
data() { data() {
return { return {
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
<script> <script>
import { teacher } from '../../utils/buryingPoint'; import { teacher } from '../../utils/buryingPoint';
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { jumpWebPageUrl } from '@/utils/index'
import YqyLecturerOrder from '@/componentsn/business/yqy-lecturer-order'; import YqyLecturerOrder from '@/componentsn/business/yqy-lecturer-order';
export default { export default {
......
...@@ -75,72 +75,74 @@ export function sortParmData(originData, orderCol, index) { ...@@ -75,72 +75,74 @@ export function sortParmData(originData, orderCol, index) {
}) })
} }
//跳转个人评价页面 // // dev地址
export function jumpEvaluatPage(){ // // const baseUrl = 'http://10.177.10.149:8080/'
return evaluatPageUrl // // const baseUrl = 'https://dev-sc.yunqueyi.com/'
} // // const baseUrl = 'http://10.177.15.180:10202/'
// // const baseUrl = 'http://192.168.140.14:10201/'
// // const apiUrl = 'https://dev-api.yunqueyi.com/'
// // test1地址
// const baseUrl = 'https://test1-sc.yunqueyi.com/'
// const apiUrl = 'https://test1-api.yunqueyi.com/'
// // // uat地址
// // const baseUrl = 'https://uat-sc.yunqueyi.com/'
// // const apiUrl = 'https://uat-api.yunqueyi.com/'
// // // pro地址
// // const baseUrl = 'https://sc.yunqueyi.com/'
// // const apiUrl = 'https://api.yunqueyi.com/'
// dev地址
// const baseUrl = 'http://10.177.10.149:8080/'
// const baseUrl = 'https://dev-sc.yunqueyi.com/'
// const baseUrl = 'http://10.177.15.180:10202/'
// const baseUrl = 'http://192.168.140.14:10201/'
// const apiUrl = 'https://dev-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://dev-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://dev-phome.yunqueyi.com/'
// test1地址
const baseUrl = 'https://test1-sc.yunqueyi.com/'
const apiUrl = 'https://test1-api.yunqueyi.com/'
const evaluatPageUrl = 'https://test1-phome.yunqueyi.com/gpr/#/home'
export const jumpWebPageUrl = 'https://test1-phome.yunqueyi.com/'
// // uat地址
// const baseUrl = 'https://uat-sc.yunqueyi.com/'
// const apiUrl = 'https://uat-api.yunqueyi.com/'
// const evaluatPageUrl = 'https://uat-phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://uat-phome.yunqueyi.com/'
// // pro地址
// const baseUrl = 'https://sc.yunqueyi.com/'
// const apiUrl = 'https://api.yunqueyi.com/'
// const evaluatPageUrl = 'https://phome.yunqueyi.com/gpr/#/home'
// export const jumpWebPageUrl = 'https://phome.yunqueyi.com/'
// 为每个URL添加应用校验密钥
export function getBaseUrl(url) { export function getBaseUrl(url) {
return baseUrl + url return getConfigByEvtType('baseUrl') + url
} }
export function getApiUrl(url) { export function getApiUrl(url) {
return apiUrl + url return getConfigByEvtType('apiUrl') + url
} }
console.log('XXXXXXXX: ', process.env.NODE_ENV) export function getWebPageUrl(url) {
const devEvtConfig = { return getConfigByEvtType('webPageUrl') + url
baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.180:10202/',
// baseUrl: 'http://192.168.140.14:10201/',
apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/'
} }
const testEvtConfig = { console.log('XXXXXXXX: ', process.env.NODE_ENV)
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/'
}
const uatEvtConfig = { const evtConfig = {
baseUrl: 'https://uat-sc.yunqueyi.com/', development: {
apiUrl: 'https://uat-api.yunqueyi.com/', baseUrl: 'https://dev-sc.yunqueyi.com/',
webPageUrl: 'https://uat-phome.yunqueyi.com/' // baseUrl: 'http://10.177.15.180:10202/',
// baseUrl: 'http://192.168.140.14:10201/',
apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/'
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.180:10202/',
// baseUrl: 'http://192.168.140.14:10201/',
apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/'
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/'
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/',
webPageUrl: 'https://uat-phome.yunqueyi.com/'
},
pro: {
baseUrl: 'https://sc.yunqueyi.com/',
apiUrl: 'https://api.yunqueyi.com/',
webPageUrl: 'https://phome.yunqueyi.com/'
}
} }
const proEvtConfig = { function getConfigByEvtType(url) {
baseUrl: 'https://sc.yunqueyi.com/', console.log(process.env.NODE_ENV)
apiUrl: 'https://api.yunqueyi.com/', return evtConfig[process.env.NODE_ENV][url]
webPageUrl: 'https://phome.yunqueyi.com/'
} }
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册