Compare commits
3 Commits
210f9cc44e
...
2d40736a96
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d40736a96 | |||
| 64c1e28f71 | |||
| 97a8dd26e2 |
15
src/App.vue
15
src/App.vue
@ -2,13 +2,17 @@
|
||||
<template>
|
||||
<router-view v-slot="{ Component }" v-if="isRouterAlive">
|
||||
<keep-alive :include="store.getters.keepLiiveRoute">
|
||||
<Component :is="Component"></Component>
|
||||
<Watermark :text="content" :color="'rgba(0, 0, 0, .15)'">
|
||||
<Component :is="Component"></Component>
|
||||
</Watermark>
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, nextTick, provide, onMounted } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import Watermark from "@/components/Watermark.vue";
|
||||
import { timeValidate } from "@/utils/tools.js";
|
||||
import { getItem } from "@/utils/storage";
|
||||
import { qcckPost, qcckGet, qcckPut, qcckDelete } from "@/api/qcckApi.js";
|
||||
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
||||
@ -26,9 +30,16 @@ const reload = () => {
|
||||
provide("reload", reload);
|
||||
onMounted(() => {
|
||||
let dept = getItem("deptId");
|
||||
frashJs()
|
||||
document.title = "林芝";
|
||||
});
|
||||
|
||||
const content=ref([])
|
||||
const frashJs = () => {
|
||||
const sfzh= getItem("idEntityCard")
|
||||
const userName= getItem("USERNAME")
|
||||
const time = timeValidate()
|
||||
content.value=[userName,sfzh,time,"林芝市环林卡口综合管理","禁止泄露公民个人信息和警务工作秘密"]
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
|
||||
@ -603,4 +603,4 @@ export const unifiedLogin = (data) => {
|
||||
method: "POST",
|
||||
data
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
removeAllItem
|
||||
} from "@/utils/storage";
|
||||
// 白名单
|
||||
const whiteList = ['/login','/oatuh_login','/','/StationLevel','/editPassword', '/404', '/401']
|
||||
const whiteList = ['/login', '/oatuh_login', '/', '/StationLevel', '/editPassword', '/404', '/401']
|
||||
/**
|
||||
* 路由前置守卫
|
||||
* to 去哪里
|
||||
@ -16,8 +16,7 @@ const whiteList = ['/login','/oatuh_login','/','/StationLevel','/editPassword',
|
||||
let onRun = true;
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// 存在 token ,进入主页
|
||||
console.log(store.getters.token,'===store.getters.token');
|
||||
|
||||
console.log(store.getters.token, '===store.getters.token');
|
||||
// if (store.state.user.token) {
|
||||
// 快捷访问
|
||||
if (store.getters.token) {
|
||||
@ -47,12 +46,12 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (whiteList.indexOf(to.path) > -1) {
|
||||
next()
|
||||
} else {
|
||||
next('/oatuh_login')
|
||||
// if (isOatuh) {
|
||||
// next('/oatuh_login')
|
||||
// } else {
|
||||
// next('/login')
|
||||
// }
|
||||
if (isOatuh) {
|
||||
const idEntityCard = getItem('idEntityCard')
|
||||
next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`)
|
||||
} else {
|
||||
next('/login')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -21,7 +21,12 @@ export const privateRoutes = [];
|
||||
* 公开路由表
|
||||
*/
|
||||
export const publicRoutes = [
|
||||
{
|
||||
{
|
||||
path: "/oatuh_login",
|
||||
name: "oatuh_login",
|
||||
component: () => import("@/views/login/oatuh_login")
|
||||
},
|
||||
{
|
||||
path: "/oatuh_login",
|
||||
name: "oatuh_login",
|
||||
component: () => import("@/views/login/oatuh_login")
|
||||
@ -421,6 +426,7 @@ export const publicRoutes = [
|
||||
{
|
||||
path: "/checkpoint",
|
||||
name: "checkpoint",
|
||||
redirect: "/checkpoint",
|
||||
meta: {
|
||||
title: "环林卡口管理",
|
||||
icon: "article"
|
||||
@ -441,6 +447,7 @@ export const publicRoutes = [
|
||||
{
|
||||
path: "/forewarning",
|
||||
name: "forewarning",
|
||||
redirect: "/forewarning",
|
||||
meta: {
|
||||
title: "预警管理",
|
||||
icon: "article"
|
||||
|
||||
@ -132,44 +132,37 @@ export default {
|
||||
*单点登录
|
||||
*/
|
||||
oatuhLogin(ctx, userInfo) {
|
||||
const {
|
||||
token,
|
||||
systemId,
|
||||
} = userInfo;
|
||||
const { token, systemId, } = userInfo;
|
||||
return new Promise((resolve, reject) => {
|
||||
unifiedLogin({
|
||||
token,
|
||||
systemId,
|
||||
})
|
||||
.then((data) => {
|
||||
debugger
|
||||
if (data.deptList.length === 1) {
|
||||
this.commit("user/setToken", data.jwtToken);
|
||||
this.commit("user/setDeptId", data.deptList);
|
||||
this.commit("user/setUserName", data.userName);
|
||||
setItem("USERNAME", data.userName);
|
||||
unifiedLogin({ token, systemId }).then((data) => {
|
||||
if (data.deptList.length === 1) {
|
||||
this.commit("user/setToken", data.jwtToken);
|
||||
|
||||
setItem("SFRH", data.sfrh);
|
||||
setItem("USERID", data.userId);
|
||||
setItem("PermissionsInfo", data.permissionsInfo);
|
||||
this.commit("user/setMenuList", data.menuList);
|
||||
setItem("menusPermission", data.menuCodeSet);
|
||||
setItem('isOatuh', 1)
|
||||
setItem("idEntityCard", data.idEntityCard);
|
||||
this.commit("user/setUserInfo", {
|
||||
token: data.jwtToken,
|
||||
permission: {
|
||||
buttonPermission: ["removeTest", "viewTest"],
|
||||
menus: data.menuCodeSet
|
||||
},
|
||||
menuList: data.menuList,
|
||||
deptList: data.deptList
|
||||
});
|
||||
}
|
||||
// 保存登录时间
|
||||
setTimeStamp();
|
||||
resolve(data);
|
||||
})
|
||||
this.commit("user/setDeptId", data.deptList);
|
||||
this.commit("user/setUserName", data.userName);
|
||||
setItem("USERNAME", data.userName);
|
||||
setItem('fzUserId', data.fzUserId)
|
||||
setItem("SFRH", data.sfrh);
|
||||
setItem("USERID", data.userId);
|
||||
setItem("PermissionsInfo", data.permissionsInfo);
|
||||
this.commit("user/setMenuList", data.menuList);
|
||||
setItem("menusPermission", data.menuCodeSet);
|
||||
setItem('isOatuh', 1)
|
||||
setItem("idEntityCard", data.idEntityCard);
|
||||
this.commit("user/setUserInfo", {
|
||||
token: data.jwtToken,
|
||||
permission: {
|
||||
buttonPermission: ["removeTest", "viewTest"],
|
||||
menus: data.menuCodeSet
|
||||
},
|
||||
menuList: data.menuList,
|
||||
deptList: data.deptList
|
||||
});
|
||||
}
|
||||
// 保存登录时间
|
||||
setTimeStamp();
|
||||
resolve(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
|
||||
@ -139,7 +139,6 @@ const pageData = reactive({
|
||||
const Auth = ref(true)
|
||||
onMounted(() => {
|
||||
Auth.value = isAuth()
|
||||
|
||||
tabHeightFn();
|
||||
});
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ const handleLogin = (e) => {
|
||||
store.dispatch("user/oatuhLogin", e).then((res) => {
|
||||
// 登录后操作
|
||||
if (res.deptList.length === 1) {
|
||||
// window.location.hash = "/";
|
||||
window.location.hash = "/";
|
||||
} else {
|
||||
deptList.value = [...res.deptList];
|
||||
loginDialog.value = true;
|
||||
@ -39,4 +39,4 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
<style></style>
|
||||
|
||||
@ -4,8 +4,8 @@ function resolve(dir) {
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
|
||||
// const serverHost = "http://192.192.8.9:8006";
|
||||
const serverHost = "http://192.168.1.32:8066"
|
||||
const serverHost = "http://192.168.8.15:8006"
|
||||
// const serverHost = "http://192.168.1.32:8066"
|
||||
// const serverHost = "http://127.0.0.1:8006"
|
||||
module.exports = {
|
||||
publicPath: "./",
|
||||
|
||||
9
ylth/index.html
Normal file
9
ylth/index.html
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/app.4456a200.css
Normal file
1
ylth/static/css/app.4456a200.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-2cab96f2.99ce350f.css
Normal file
1
ylth/static/css/chunk-2cab96f2.99ce350f.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-339cb81e.ff82e54c.css
Normal file
1
ylth/static/css/chunk-339cb81e.ff82e54c.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-3b6d357a.5a53e376.css
Normal file
1
ylth/static/css/chunk-3b6d357a.5a53e376.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-4f97dd65.95053c02.css
Normal file
1
ylth/static/css/chunk-4f97dd65.95053c02.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-52260baf.0cffe8bb.css
Normal file
1
ylth/static/css/chunk-52260baf.0cffe8bb.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-68f1b5e1.b0ca4c23.css
Normal file
1
ylth/static/css/chunk-68f1b5e1.b0ca4c23.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-7cb0a099.5020444d.css
Normal file
1
ylth/static/css/chunk-7cb0a099.5020444d.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/css/chunk-e7d361ca.e0d0e86d.css
Normal file
1
ylth/static/css/chunk-e7d361ca.e0d0e86d.css
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/app.98a36ec2.js
Normal file
1
ylth/static/js/app.98a36ec2.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-2cab96f2.e49b2b39.js
Normal file
1
ylth/static/js/chunk-2cab96f2.e49b2b39.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-2d22bd3e.c9c7cbcf.js
Normal file
1
ylth/static/js/chunk-2d22bd3e.c9c7cbcf.js
Normal file
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22bd3e"],{f141:function(t,e,n){"use strict";n.r(e);var o=n("7a23"),c=n("5502"),a=n("5d2d"),u={__name:"oatuh_login",setup(t){const e=Object(o["ref"])(!1),n=Object(o["ref"])([]),u=Object(c["b"])();function i(){let t=location.hash.slice(20)||null;null!=t?(t=t.replace(/\ +/g,""),Object(a["c"])("SSOTOKEN",t),l({token:t})):window.location.href="http://155.240.22.102:40992"}const l=t=>{u.dispatch("user/oatuhLogin",t).then(t=>{1===t.deptList.length?window.location.hash="/":(n.value=[...t.deptList],e.value=!0,authorization.value=t.jwtToken)})};return Object(o["onMounted"])(()=>{i()}),(t,e)=>null}};const i=u;e["default"]=i}}]);
|
||||
1
ylth/static/js/chunk-339cb81e.ca2b5549.js
Normal file
1
ylth/static/js/chunk-339cb81e.ca2b5549.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-3b6d357a.696efa08.js
Normal file
1
ylth/static/js/chunk-3b6d357a.696efa08.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-4f97dd65.da75633d.js
Normal file
1
ylth/static/js/chunk-4f97dd65.da75633d.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-52260baf.0912137c.js
Normal file
1
ylth/static/js/chunk-52260baf.0912137c.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-68f1b5e1.fcb039ca.js
Normal file
1
ylth/static/js/chunk-68f1b5e1.fcb039ca.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-7cb0a099.f2aeccd4.js
Normal file
1
ylth/static/js/chunk-7cb0a099.f2aeccd4.js
Normal file
File diff suppressed because one or more lines are too long
1
ylth/static/js/chunk-e7d361ca.009aa460.js
Normal file
1
ylth/static/js/chunk-e7d361ca.009aa460.js
Normal file
File diff suppressed because one or more lines are too long
BIN
ylth/ylth.zip
Normal file
BIN
ylth/ylth.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user