| | |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 登出 |
| | | */ |
| | | export const logout = () =>{ |
| | | return request({ |
| | | url: '/api/blade-auth/oauth/logout', |
| | | method: 'get', |
| | | params: {} |
| | | }) |
| | | } |
| | |
| | | import { loginByUsername } from "@/api/login/login"; |
| | | import { loginByUsername,logout } from "@/api/login/login"; |
| | | import {Message} from 'element-ui' |
| | | import md5 from "js-md5"; |
| | | import * as auth from '@/utils/auth' |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | //登出 |
| | | LogOut({commit}) { |
| | | return new Promise((resolve, reject) => { |
| | | logout().then(() => { |
| | | commit('SET_TOKEN', ''); |
| | | auth.removeToken(); |
| | | auth.removeUserInfo(); |
| | | resolve(); |
| | | }).catch(error => { |
| | | reject(error) |
| | | }) |
| | | }) |
| | | }, |
| | | }, |
| | | mutations:{ |
| | | SET_TOKEN: (state, token) => { |
| | |
| | | methods: { |
| | | //登出 |
| | | goTOLogout(){ |
| | | //跳转登录页 |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | this.$router.push({ path: "/login" }); |
| | | }); |
| | | }, |
| | | /** |
| | | * @description: 路由跳转的事件 |
| | |
| | | .userIcon.on { |
| | | color: rgba(252, 189, 86, 1); |
| | | } |
| | | |
| | | .userDetail { |
| | | width: 180px; |
| | | height: 92px; |
| | |
| | | border-left-color: transparent; |
| | | border-right-color: transparent; |
| | | } |
| | | |
| | | .userName { |
| | | width: 100%; |
| | | height: 40px; |
| | |
| | | position: absolute; |
| | | top: 0px; |
| | | } |
| | | |
| | | .userBtn { |
| | | width: 100%; |
| | | height: 50px; |
| | |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | line-height: 44px; |
| | | |
| | | img { |
| | | width: 76px; |
| | | height: 20px; |