Browse Source

Merge branch 'feature_voluntary_mall' into test

feature
wxz 11 months ago
parent
commit
1e400f8b4f
  1. 19
      .env.localhost
  2. 1
      package.json
  3. 20
      src/router/index.js

19
.env.localhost

@ -0,0 +1,19 @@
NODE_ENV=development
# VUE_APP_API_SERVER = https://epmet-preview.elinkservice.cn/api
# VUE_APP_API_SERVER = http://192.168.1.60:8080/api
VUE_APP_API_SERVER = http://localhost:8080/api
# VUE_APP_API_SERVER = http://219.146.91.110:30801/api219.146.91.110:30801
# VUE_APP_API_SERVER = https://epmet-yantai.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-cloud.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn:41080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_BIPASS_API_SERVER = /linkdata/linkdata-gateway/route
# VUE_APP_NODE_ENV=dev_sdtdt
VUE_APP_NODE_ENV=dev
#项目根路径
VUE_APP_PUBLIC_PATH=epmet-oper

1
package.json

@ -3,6 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"localhost": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve --mode localhost",
"dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve", "dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",

20
src/router/index.js

@ -942,9 +942,21 @@ const router = new Router({
}), }),
routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes, dataBoardRoutes), routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes, dataBoardRoutes),
}); });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 添加动态(菜单)路由 // 添加动态(菜单)路由
// 已添加或者当前路由为页面路由, 可直接访问 // 已添加或者当前路由为页面路由, 可直接访问
let toUrl = to.meta.iframeURL
console.log("=====", toUrl)
if (toUrl && toUrl.indexOf("ticket=") != -1) {
// 此处请求后端,获取一个ticket票据
http.get("/auth/sso/getTicket")
.then(({data: res}) => {
let ticket = res.data
window.open(toUrl + ticket)
})
return null;
}
if (to.name === "caiji") { if (to.name === "caiji") {
return next(); return next();
} }
@ -982,7 +994,7 @@ router.beforeEach((to, from, next) => {
}); });
return next({ return next({
name: "login", name: "login",
query: { redirect: to.fullPath } query: { redirect: to.fullPath }
}); });
} }
window.SITE_CONFIG["menuShujuList"] = res.data; window.SITE_CONFIG["menuShujuList"] = res.data;
@ -996,7 +1008,7 @@ router.beforeEach((to, from, next) => {
console.log(err); console.log(err);
next({ next({
name: "login", name: "login",
query: { redirect: to.fullPath } query: { redirect: to.fullPath }
}); });
}); });
http http
@ -1013,7 +1025,7 @@ router.beforeEach((to, from, next) => {
}); });
return next({ return next({
name: "login", name: "login",
query: { redirect: to.fullPath } query: { redirect: to.fullPath }
}); });
} }
window.SITE_CONFIG["menuList"] = res.data window.SITE_CONFIG["menuList"] = res.data
@ -1031,7 +1043,7 @@ router.beforeEach((to, from, next) => {
console.log(err); console.log(err);
next({ next({
name: "login", name: "login",
query: { redirect: to.fullPath } query: { redirect: to.fullPath }
}); });
}); });
}); });

Loading…
Cancel
Save