Browse Source

我的界面添加退出登录

newMaster
1747191978@qq.com 4 months ago
parent
commit
839e1948c8
  1. BIN
      acupuncture-前台/src/views/bg.png
  2. 22
      acupuncture-前台/src/views/system/user/profile/index.vue

BIN
acupuncture-前台/src/views/bg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 983 KiB

22
acupuncture-前台/src/views/system/user/profile/index.vue

@ -33,6 +33,7 @@
{{ user.dept.deptName }} / {{ postGroup }} {{ user.dept.deptName }} / {{ postGroup }}
</div> </div>
</li> </li>
<!-- <li class="list-group-item"> <!-- <li class="list-group-item">
<svg-icon icon-class="peoples" />所属角色 <svg-icon icon-class="peoples" />所属角色
<div class="pull-right">{{ roleGroup }}</div> <div class="pull-right">{{ roleGroup }}</div>
@ -42,6 +43,14 @@
<div class="pull-right">{{ user.createTime }}</div> <div class="pull-right">{{ user.createTime }}</div>
</li> --> </li> -->
</ul> </ul>
<el-button
type="primary"
size="mini"
@click="logout"
style="width: 100%; height: 48px; font-size: 16px"
>
退出登录
</el-button>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -85,6 +94,19 @@ export default {
this.getUser(); this.getUser();
}, },
methods: { methods: {
async logout() {
this.$confirm("确定注销并退出系统吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = process.env.VUE_APP_PUBLIC_PATH;
});
})
.catch(() => {});
},
getUser() { getUser() {
getUserProfile().then((response) => { getUserProfile().then((response) => {
this.user = response.data; this.user = response.data;

Loading…
Cancel
Save