-- bug 登出

This commit is contained in:
yuping
2022-12-03 18:53:38 +08:00
parent 16aec52764
commit db610d81c1
4 changed files with 151 additions and 119 deletions

View File

@@ -29,6 +29,7 @@ import BreadCrumb from "@/components/BreadCrumb";
import zhCN from "ant-design-vue/es/locale/zh_CN"; import zhCN from "ant-design-vue/es/locale/zh_CN";
import * as api from "./api/index1"; import * as api from "./api/index1";
import * as api1 from "@/api/index1"; import * as api1 from "@/api/index1";
import * as api2 from "@/api/index";
export default defineComponent({ export default defineComponent({
components: { components: {
@@ -59,6 +60,7 @@ export default defineComponent({
function init() { function init() {
console.log(store); console.log(store);
getUserInfo();
initDict("faceclassPic"); initDict("faceclassPic");
initDict("faceclassClass"); initDict("faceclassClass");
initDict("faceclassScene"); initDict("faceclassScene");
@@ -70,6 +72,11 @@ export default defineComponent({
getOrgTree(); getOrgTree();
} }
async function getUserInfo() {
const userInfo = await api2.userInfo()
store.commit("SET_USER", userInfo);
}
async function initDict(key) { async function initDict(key) {
let list = localStorage.getItem(key); let list = localStorage.getItem(key);
if (list) { if (list) {

View File

@@ -76,4 +76,5 @@ export const getTemplateDetail = (obj) => http.get('/admin/project/template/deta
export const getProjectCount = (projectId) => http.get('/admin/project/projectCount', {params: {projectId: projectId}}) export const getProjectCount = (projectId) => http.get('/admin/project/projectCount', {params: {projectId: projectId}})
export const login = (obj) => http.post('/admin/CheckUser/userLogin', obj) export const login = (obj) => http.post('/admin/CheckUser/userLogin', obj)
export const userInfo = () => http.get('/admin/CheckUser/userInfo')

View File

@@ -61,6 +61,7 @@
import {reactive, toRefs} from "vue"; import {reactive, toRefs} from "vue";
import DownLoad from "../components/drawers/DownLoad"; import DownLoad from "../components/drawers/DownLoad";
import * as api from "../api/index1"; import * as api from "../api/index1";
export default { export default {
name: "NavTop", name: "NavTop",
components: { components: {
@@ -118,6 +119,14 @@ export default {
getUser(); getUser();
const logOut = () => { const logOut = () => {
localStorage.removeItem('faceclassPic');
localStorage.removeItem('faceclassClass');
localStorage.removeItem('faceclassScene');
localStorage.removeItem('projectLevel');
localStorage.removeItem('projectSys');
localStorage.removeItem('pathmapPic');
localStorage.removeItem('projectClass');
localStorage.removeItem('projectPic');
window.open("https://u-pre.boe.com/web/", "_self"); window.open("https://u-pre.boe.com/web/", "_self");
}; };
return { return {
@@ -142,9 +151,11 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
.navTopRight { .navTopRight {
display: flex; display: flex;
} }
.role { .role {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -154,6 +165,7 @@ export default {
line-height: 36px; line-height: 36px;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
.roleArrow { .roleArrow {
width: 13px; width: 13px;
height: 7px; height: 7px;
@@ -161,6 +173,7 @@ export default {
background-image: url(../assets/images/navtop/down.png); background-image: url(../assets/images/navtop/down.png);
background-size: 100%; background-size: 100%;
} }
.roleItems { .roleItems {
width: 109px; width: 109px;
height: 90px; height: 90px;
@@ -174,22 +187,27 @@ export default {
display: none; display: none;
z-index: 100; z-index: 100;
} }
.roleItem { .roleItem {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: rgba(79, 81, 86, 1); color: rgba(79, 81, 86, 1);
line-height: 36px; line-height: 36px;
} }
.roleItem:hover { .roleItem:hover {
color: #4ea6ff; color: #4ea6ff;
} }
} }
.role:hover .roleItems { .role:hover .roleItems {
display: block; display: block;
} }
.role:hover .roleArrow { .role:hover .roleArrow {
background-image: url(../assets/images/navtop/up.png); background-image: url(../assets/images/navtop/up.png);
} }
.user { .user {
margin-left: 37px; margin-left: 37px;
display: flex; display: flex;
@@ -199,12 +217,14 @@ export default {
color: #b3bdc4; color: #b3bdc4;
line-height: 36px; line-height: 36px;
} }
.signOutMain { .signOutMain {
cursor: pointer; cursor: pointer;
margin-right: 29px; margin-right: 29px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.signOut { .signOut {
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;

View File

@@ -23,6 +23,7 @@ export default createStore({
assessmentName: "", assessmentName: "",
routerId: null, routerId: null,
projectTemplateId: null, projectTemplateId: null,
userInfo: {},
orgtreeList: [], orgtreeList: [],
faceclassPic: null, faceclassPic: null,
faceclassClass: [], faceclassClass: [],
@@ -54,6 +55,9 @@ export default createStore({
SET_DICT(state, {key, data}) { SET_DICT(state, {key, data}) {
state[key] = data state[key] = data
}, },
SET_USER(state, userInfo) {
state.userInfo = userInfo
},
SET_projectTemplateId(state, projectTemplateId) { SET_projectTemplateId(state, projectTemplateId) {
state.projectTemplateId = projectTemplateId; state.projectTemplateId = projectTemplateId;
} }