Commit 745f347c authored by 张俊's avatar 张俊

放开登录限制页面

parent 11661c9c
Pipeline #75117 passed with stage
......@@ -50,7 +50,7 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: hub.wodcloud.com/wod/ui-base:2.0-apaasv3
base: registry.cn-qingdao.aliyuncs.com/wod-devops/ui-base:2.0-sjjy
dockerfile: .beagle/dockerfile
repo: gzgajzapi/apaas-ui
version: v3.0.1
......
index: /apaas/ui/
login: /iam/login/#/login
logout: /iam/api/logout
\ No newline at end of file
logout: /iam/api/logout
exts: ["/services_shop","/shop"]
\ No newline at end of file
FROM {{ BASEIMAGE }}
MAINTAINER {{ AUTHOR }}
LABEL Author={{ AUTHOR }} Name={{ PROJECT }} Version={{ VERSION }}
ARG BASE
FROM $BASE
ARG AUTHOR
ARG VERSION
LABEL maintainer=${AUTHOR} version=${VERSION}
ARG TARGETOS
ARG TARGETARCH
ADD ./dist /www
ADD ./build/conf.yaml /www/conf.yaml
\ No newline at end of file
import Vue from "vue";
import Router from "vue-router";
import {getCookie} from '../utils/common'
Vue.use(Router);
......@@ -10,7 +11,7 @@ Router.prototype.push = function push(location, onResolve, onReject) {
return originalPush.call(this, location).catch((err) => err);
};
export default new Router({
var router = new Router({
scrollBehavior (to, from, savedPosition) {
return { x: 0, y: 0 }
},
......@@ -848,3 +849,27 @@ export default new Router({
},
],
});
router.beforeEach(async (to, from, next) => {
let _user = getCookie('bgToken')
let _path = to.path; // 访问的页面
if (_user) {
next();
} else if (
_path === "" ||
_path === "/" ||
_path === "/home" ||
_path === "/search" ||
_path === "/cart" ||
_path.indexOf("/services_shop") === 0 ||
_path.indexOf("/shop") === 0
) {
next();
} else {
// ElementUI.Message.error(`未登录无法访问该页面`);
next("/");
}
}); // 导航守卫
export default router
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment