Commit 71e14a04 by maxiaohan

登出

parent d56faf0e
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div style="border: #f6a51a 1px solid" @click="logout"> <div @click="logout">
<img src="../../assets/img/Home/exit.svg" alt="" />安全退出 <img src="../../assets/img/Home/exit.svg" alt="" />安全退出
</div> </div>
</div> </div>
...@@ -118,11 +118,10 @@ export default { ...@@ -118,11 +118,10 @@ export default {
}, },
logout() { logout() {
this.$axios.post("/login/login/userLogout").then(res => { this.$axios.post("/login/login/userLogout").then(res => {
console.info(res); if (res.data.code === 200) {
if (res.data.code === "200") { this.$router.replace("/login1");
localStorage.removeItem("token"); localStorage.removeItem("token");
this.$message.success("退出成功!"); this.$message.success("退出成功!");
this.$router.replace("/login1");
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment