Commit 58f545ae authored by 张俊's avatar 张俊

免登录

parent 32b1394d
Pipeline #75497 passed with stage
......@@ -50,7 +50,7 @@ pipeline:
dns: 223.5.5.5
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod-devops/ui-base:2.0-jzapi
base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5
dockerfile: .beagle/dockerfile
repo: gzgajzapi/apaas-ui
version: v3.0.1
......@@ -65,7 +65,6 @@ pipeline:
when:
branch:
- dev
## 更换dev生成镜像的名称
harbor:
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker-tag:1.0
......
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
ADD ./dist /usr/share/nginx/html
ADD ./build/nginx.conf /etc/nginx/nginx.conf
\ No newline at end of file
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
listen [::]:80;
server_name localhost;
absolute_redirect off; #取消绝对路径的重定向
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location /klmy/ui {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /klmy/ui/index.html;
}
}
# 开启gzip
gzip off;
# 启用gzip压缩的最小文件,小于设置值的文件将不会压缩
gzip_min_length 1k;
# gzip 压缩级别,1-10,数字越大压缩的越好,也越占用CPU时间,后面会有详细说明
gzip_comp_level 6;
# 进行压缩的文件类型。javascript有多种形式。其中的值可以在 mime.types 文件中找到。
# 由于jpg,jpeg,png本来就是压缩格式,再行压缩只会消耗cpu资源,帮助并不大
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/gif;
# 是否在http header中添加Vary: Accept-Encoding,建议开启
gzip_vary on;
#压缩版本(默认1.1,前端如果是squid2.5请使用1.0)
gzip_http_version 1.0;
# 禁用IE 6 gzip
gzip_disable "MSIE [1-6]\.";
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
\ No newline at end of file
......@@ -75,6 +75,20 @@ Vue.use(SuperFlow)
import api from './request/api'
Vue.prototype.$api = api;
function getCurrent(){
api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
store.commit("userInfofun", data.data);
} else {
console.log(data.errMsg);
}
});
}
// getCurrent()
new Vue({
el: "#app",
router,
......@@ -83,3 +97,5 @@ new Vue({
components: { App },
template: "<App/>"
});
import Vue from "vue";
import Router from "vue-router";
import {getCookie} from '../utils/common'
import store from "@/store";
Vue.use(Router);
......@@ -850,10 +851,11 @@ var router = new Router({
],
});
router.beforeEach(async (to, from, next) => {
let _user = getCookie('bgToken')
console.log(window.serviceConfig);
let _path = to.path; // 访问的页面
if (_user) {
if (store.state.userInfo) {
next();
} else if (
_path === "" ||
......
......@@ -3,4 +3,5 @@ window.serviceConfig = {
gisPortalSiteName: "portal",
state: "needLogin", // needLogin / notNeedLogin
cloudServiceRoot: 'https://cloud4.wodcloud.com/awecloud/login/#/',
noNeedLoginUrl:['/','shop']
};
\ No newline at end of file
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