mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 19:36:46 +08:00
-- bug 登出
This commit is contained in:
@@ -29,6 +29,7 @@ import BreadCrumb from "@/components/BreadCrumb";
|
||||
import zhCN from "ant-design-vue/es/locale/zh_CN";
|
||||
import * as api from "./api/index1";
|
||||
import * as api1 from "@/api/index1";
|
||||
import * as api2 from "@/api/index";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@@ -59,6 +60,7 @@ export default defineComponent({
|
||||
|
||||
function init() {
|
||||
console.log(store);
|
||||
getUserInfo();
|
||||
initDict("faceclassPic");
|
||||
initDict("faceclassClass");
|
||||
initDict("faceclassScene");
|
||||
@@ -70,6 +72,11 @@ export default defineComponent({
|
||||
getOrgTree();
|
||||
}
|
||||
|
||||
async function getUserInfo() {
|
||||
const userInfo = await api2.userInfo()
|
||||
store.commit("SET_USER", userInfo);
|
||||
}
|
||||
|
||||
async function initDict(key) {
|
||||
let list = localStorage.getItem(key);
|
||||
if (list) {
|
||||
|
||||
@@ -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 login = (obj) => http.post('/admin/CheckUser/userLogin', obj)
|
||||
export const userInfo = () => http.get('/admin/CheckUser/userInfo')
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
import {reactive, toRefs} from "vue";
|
||||
import DownLoad from "../components/drawers/DownLoad";
|
||||
import * as api from "../api/index1";
|
||||
|
||||
export default {
|
||||
name: "NavTop",
|
||||
components: {
|
||||
@@ -118,6 +119,14 @@ export default {
|
||||
getUser();
|
||||
|
||||
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");
|
||||
};
|
||||
return {
|
||||
@@ -142,9 +151,11 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
|
||||
.navTopRight {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.role {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -154,6 +165,7 @@ export default {
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
.roleArrow {
|
||||
width: 13px;
|
||||
height: 7px;
|
||||
@@ -161,6 +173,7 @@ export default {
|
||||
background-image: url(../assets/images/navtop/down.png);
|
||||
background-size: 100%;
|
||||
}
|
||||
|
||||
.roleItems {
|
||||
width: 109px;
|
||||
height: 90px;
|
||||
@@ -174,22 +187,27 @@ export default {
|
||||
display: none;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.roleItem {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(79, 81, 86, 1);
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.roleItem:hover {
|
||||
color: #4ea6ff;
|
||||
}
|
||||
}
|
||||
|
||||
.role:hover .roleItems {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.role:hover .roleArrow {
|
||||
background-image: url(../assets/images/navtop/up.png);
|
||||
}
|
||||
|
||||
.user {
|
||||
margin-left: 37px;
|
||||
display: flex;
|
||||
@@ -199,12 +217,14 @@ export default {
|
||||
color: #b3bdc4;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.signOutMain {
|
||||
cursor: pointer;
|
||||
margin-right: 29px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.signOut {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
|
||||
@@ -23,6 +23,7 @@ export default createStore({
|
||||
assessmentName: "",
|
||||
routerId: null,
|
||||
projectTemplateId: null,
|
||||
userInfo: {},
|
||||
orgtreeList: [],
|
||||
faceclassPic: null,
|
||||
faceclassClass: [],
|
||||
@@ -54,6 +55,9 @@ export default createStore({
|
||||
SET_DICT(state, {key, data}) {
|
||||
state[key] = data
|
||||
},
|
||||
SET_USER(state, userInfo) {
|
||||
state.userInfo = userInfo
|
||||
},
|
||||
SET_projectTemplateId(state, projectTemplateId) {
|
||||
state.projectTemplateId = projectTemplateId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user