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>
|
<template>
|
||||||
<router-view v-slot="{ Component }" v-if="isRouterAlive">
|
<router-view v-slot="{ Component }" v-if="isRouterAlive">
|
||||||
<keep-alive :include="store.getters.keepLiiveRoute">
|
<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>
|
</keep-alive>
|
||||||
</router-view>
|
</router-view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, nextTick, provide, onMounted } from "vue";
|
import { ref, nextTick, provide, onMounted } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
import Watermark from "@/components/Watermark.vue";
|
||||||
|
import { timeValidate } from "@/utils/tools.js";
|
||||||
import { getItem } from "@/utils/storage";
|
import { getItem } from "@/utils/storage";
|
||||||
import { qcckPost, qcckGet, qcckPut, qcckDelete } from "@/api/qcckApi.js";
|
import { qcckPost, qcckGet, qcckPut, qcckDelete } from "@/api/qcckApi.js";
|
||||||
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
||||||
@ -26,9 +30,16 @@ const reload = () => {
|
|||||||
provide("reload", reload);
|
provide("reload", reload);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let dept = getItem("deptId");
|
let dept = getItem("deptId");
|
||||||
|
frashJs()
|
||||||
document.title = "林芝";
|
document.title = "林芝";
|
||||||
});
|
});
|
||||||
|
const content=ref([])
|
||||||
|
const frashJs = () => {
|
||||||
|
const sfzh= getItem("idEntityCard")
|
||||||
|
const userName= getItem("USERNAME")
|
||||||
|
const time = timeValidate()
|
||||||
|
content.value=[userName,sfzh,time,"林芝市环林卡口综合管理","禁止泄露公民个人信息和警务工作秘密"]
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./styles/index.scss";
|
@import "./styles/index.scss";
|
||||||
|
|||||||
@ -603,4 +603,4 @@ export const unifiedLogin = (data) => {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
removeAllItem
|
removeAllItem
|
||||||
} from "@/utils/storage";
|
} from "@/utils/storage";
|
||||||
// 白名单
|
// 白名单
|
||||||
const whiteList = ['/login','/oatuh_login','/','/StationLevel','/editPassword', '/404', '/401']
|
const whiteList = ['/login', '/oatuh_login', '/', '/StationLevel', '/editPassword', '/404', '/401']
|
||||||
/**
|
/**
|
||||||
* 路由前置守卫
|
* 路由前置守卫
|
||||||
* to 去哪里
|
* to 去哪里
|
||||||
@ -16,8 +16,7 @@ const whiteList = ['/login','/oatuh_login','/','/StationLevel','/editPassword',
|
|||||||
let onRun = true;
|
let onRun = true;
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
// 存在 token ,进入主页
|
// 存在 token ,进入主页
|
||||||
console.log(store.getters.token,'===store.getters.token');
|
console.log(store.getters.token, '===store.getters.token');
|
||||||
|
|
||||||
// if (store.state.user.token) {
|
// if (store.state.user.token) {
|
||||||
// 快捷访问
|
// 快捷访问
|
||||||
if (store.getters.token) {
|
if (store.getters.token) {
|
||||||
@ -47,12 +46,12 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
if (whiteList.indexOf(to.path) > -1) {
|
if (whiteList.indexOf(to.path) > -1) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
next('/oatuh_login')
|
if (isOatuh) {
|
||||||
// if (isOatuh) {
|
const idEntityCard = getItem('idEntityCard')
|
||||||
// next('/oatuh_login')
|
next(`/oatuh_login?token=${Base64.encode(idEntityCard)}`)
|
||||||
// } else {
|
} else {
|
||||||
// next('/login')
|
next('/login')
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -21,7 +21,12 @@ export const privateRoutes = [];
|
|||||||
* 公开路由表
|
* 公开路由表
|
||||||
*/
|
*/
|
||||||
export const publicRoutes = [
|
export const publicRoutes = [
|
||||||
{
|
{
|
||||||
|
path: "/oatuh_login",
|
||||||
|
name: "oatuh_login",
|
||||||
|
component: () => import("@/views/login/oatuh_login")
|
||||||
|
},
|
||||||
|
{
|
||||||
path: "/oatuh_login",
|
path: "/oatuh_login",
|
||||||
name: "oatuh_login",
|
name: "oatuh_login",
|
||||||
component: () => import("@/views/login/oatuh_login")
|
component: () => import("@/views/login/oatuh_login")
|
||||||
@ -421,6 +426,7 @@ export const publicRoutes = [
|
|||||||
{
|
{
|
||||||
path: "/checkpoint",
|
path: "/checkpoint",
|
||||||
name: "checkpoint",
|
name: "checkpoint",
|
||||||
|
redirect: "/checkpoint",
|
||||||
meta: {
|
meta: {
|
||||||
title: "环林卡口管理",
|
title: "环林卡口管理",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
@ -441,6 +447,7 @@ export const publicRoutes = [
|
|||||||
{
|
{
|
||||||
path: "/forewarning",
|
path: "/forewarning",
|
||||||
name: "forewarning",
|
name: "forewarning",
|
||||||
|
redirect: "/forewarning",
|
||||||
meta: {
|
meta: {
|
||||||
title: "预警管理",
|
title: "预警管理",
|
||||||
icon: "article"
|
icon: "article"
|
||||||
|
|||||||
@ -132,44 +132,37 @@ export default {
|
|||||||
*单点登录
|
*单点登录
|
||||||
*/
|
*/
|
||||||
oatuhLogin(ctx, userInfo) {
|
oatuhLogin(ctx, userInfo) {
|
||||||
const {
|
const { token, systemId, } = userInfo;
|
||||||
token,
|
|
||||||
systemId,
|
|
||||||
} = userInfo;
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
unifiedLogin({
|
unifiedLogin({ token, systemId }).then((data) => {
|
||||||
token,
|
if (data.deptList.length === 1) {
|
||||||
systemId,
|
this.commit("user/setToken", data.jwtToken);
|
||||||
})
|
|
||||||
.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);
|
|
||||||
|
|
||||||
setItem("SFRH", data.sfrh);
|
this.commit("user/setDeptId", data.deptList);
|
||||||
setItem("USERID", data.userId);
|
this.commit("user/setUserName", data.userName);
|
||||||
setItem("PermissionsInfo", data.permissionsInfo);
|
setItem("USERNAME", data.userName);
|
||||||
this.commit("user/setMenuList", data.menuList);
|
setItem('fzUserId', data.fzUserId)
|
||||||
setItem("menusPermission", data.menuCodeSet);
|
setItem("SFRH", data.sfrh);
|
||||||
setItem('isOatuh', 1)
|
setItem("USERID", data.userId);
|
||||||
setItem("idEntityCard", data.idEntityCard);
|
setItem("PermissionsInfo", data.permissionsInfo);
|
||||||
this.commit("user/setUserInfo", {
|
this.commit("user/setMenuList", data.menuList);
|
||||||
token: data.jwtToken,
|
setItem("menusPermission", data.menuCodeSet);
|
||||||
permission: {
|
setItem('isOatuh', 1)
|
||||||
buttonPermission: ["removeTest", "viewTest"],
|
setItem("idEntityCard", data.idEntityCard);
|
||||||
menus: data.menuCodeSet
|
this.commit("user/setUserInfo", {
|
||||||
},
|
token: data.jwtToken,
|
||||||
menuList: data.menuList,
|
permission: {
|
||||||
deptList: data.deptList
|
buttonPermission: ["removeTest", "viewTest"],
|
||||||
});
|
menus: data.menuCodeSet
|
||||||
}
|
},
|
||||||
// 保存登录时间
|
menuList: data.menuList,
|
||||||
setTimeStamp();
|
deptList: data.deptList
|
||||||
resolve(data);
|
});
|
||||||
})
|
}
|
||||||
|
// 保存登录时间
|
||||||
|
setTimeStamp();
|
||||||
|
resolve(data);
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -139,7 +139,6 @@ const pageData = reactive({
|
|||||||
const Auth = ref(true)
|
const Auth = ref(true)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
Auth.value = isAuth()
|
Auth.value = isAuth()
|
||||||
|
|
||||||
tabHeightFn();
|
tabHeightFn();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ const handleLogin = (e) => {
|
|||||||
store.dispatch("user/oatuhLogin", e).then((res) => {
|
store.dispatch("user/oatuhLogin", e).then((res) => {
|
||||||
// 登录后操作
|
// 登录后操作
|
||||||
if (res.deptList.length === 1) {
|
if (res.deptList.length === 1) {
|
||||||
// window.location.hash = "/";
|
window.location.hash = "/";
|
||||||
} else {
|
} else {
|
||||||
deptList.value = [...res.deptList];
|
deptList.value = [...res.deptList];
|
||||||
loginDialog.value = true;
|
loginDialog.value = true;
|
||||||
@ -39,4 +39,4 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|||||||
@ -4,8 +4,8 @@ function resolve(dir) {
|
|||||||
return path.join(__dirname, dir);
|
return path.join(__dirname, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const serverHost = "http://192.192.8.9:8006";
|
const serverHost = "http://192.168.8.15:8006"
|
||||||
const serverHost = "http://192.168.1.32:8066"
|
// const serverHost = "http://192.168.1.32:8066"
|
||||||
// const serverHost = "http://127.0.0.1:8006"
|
// const serverHost = "http://127.0.0.1:8006"
|
||||||
module.exports = {
|
module.exports = {
|
||||||
publicPath: "./",
|
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