From db5c0ed41822d4c73f74c469a005da520a89ecd7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 27 Dec 2022 09:34:03 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
---
src/store/modules/user.js | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index b914dc7..dbd99d5 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,4 +1,4 @@
-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'
@@ -41,6 +41,19 @@
});
});
},
+ //登出
+ 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) => {
--
Gitblit v1.9.3