blak-kong 2 years ago
parent fb32c54ff1
commit b175087114

@ -5,7 +5,8 @@
"author": "花至", "author": "花至",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "local": "vue-cli-service serve --mode local",
"dev": "vue-cli-service serve --mode development",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",

@ -43,15 +43,13 @@ router.beforeEach((to, from, next) => {
} }
} }
} else { } else {
next(); if (whiteList.indexOf(to.path) !== -1) {
// 没有token // 在免登录白名单,直接进入
// if (whiteList.indexOf(to.path) !== -1) { next();
// // 在免登录白名单,直接进入 } else {
// next() next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
// } else { NProgress.done();
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 }
// NProgress.done()
// }
} }
}); });

@ -11,6 +11,14 @@ const name = process.env.VUE_APP_TITLE || "花至管理系统"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80; // 端口 const port = process.env.port || process.env.npm_config_port || 80; // 端口
function getTargetUrl() {
if (process.env.NODE_ENV === "local") {
return "http://110.41.134.131:8080";
} else {
return `http://localhost:8080`;
}
}
// vue.config.js 配置说明 // vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档 // 这里只列一部分,具体配置参考文档

Loading…
Cancel
Save