@ -5,7 +5,8 @@
"author": "花至",
"license": "MIT",
"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:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
@ -43,15 +43,13 @@ router.beforeEach((to, from, next) => {
}
} else {
next();
// 没有token
// if (whiteList.indexOf(to.path) !== -1) {
// // 在免登录白名单,直接进入
// next()
// } else {
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
// NProgress.done()
// }
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
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; // 端口
function getTargetUrl() {
if (process.env.NODE_ENV === "local") {
return "http://110.41.134.131:8080";
return `http://localhost:8080`;
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档