提交 7eb9a827 authored 作者: 龙菲's avatar 龙菲

优化登录和退出流程

上级 8d606fe5
......@@ -65,6 +65,7 @@
v-loading="loading"
element-loading-background="rgba(0, 0, 0, 0.5)"
:element-loading-text="loadingText"
:before-close="handleCloseLogin"
>
<div slot="title" class="login-title">
<div
......@@ -361,15 +362,18 @@ export default {
.dispatch("user/login", params)
.then((res) => {
if (res.code == "0") {
this.$message.success("登录成功");
// console.log('this.$route',this.$route);
// console.log('this.$route.query',this.$route.query);
// console.log('this.$route.query.redirect',this.$route.query.redirect);
this.handleCloseLogin();
if (this.$route.name !== "home") {
this.$router.push({
path: this.$route.query.redirect || "/",
});
}
}
// if (this.$route.name !== "home") {
// this.$router.push({
// path: this.$route.query.redirect || "/",
// });
// }
this.loading = false;
this.$message.success("登录成功");
}
})
.catch((err) => {
console.log(err);
......@@ -385,6 +389,9 @@ export default {
handleCloseLogin() {
this.loginVisible = false;
this.$refs["loginForm"].resetFields;
if (this.showLoginDialog) {
this.$store.commit("app/OPEN_LOGIN_DIALOG", null);
}
},
handleGetCaptcha() {
......
......@@ -48,7 +48,9 @@
<span>读者功能需登录进行使用,是否去登录?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="loginDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleToLogin">确 定</el-button>
<el-button type="primary" @click.native="handleToLogin"
>确 定</el-button
>
</span>
</el-dialog>
......@@ -147,7 +149,7 @@ export default {
};
},
computed: {
...mapGetters(["token"]),
...mapGetters(["token", "showLoginDialog"]),
},
methods: {
handleCollect: debounce(function () {
......@@ -205,7 +207,10 @@ export default {
},
handleToLogin() {
this.loginDialogVisible = false;
if (!this.showLoginDialog) {
this.$store.commit("app/OPEN_LOGIN_DIALOG", true);
}
// this.$router.push(`/login?redirect=${this.$route.fullPath}`);
},
......@@ -274,4 +279,14 @@ export default {
::v-deep .el-input-group__append {
padding: 0 40px;
}
::v-deep .dialog-footer {
.el-button {
border-radius: 0;
}
.el-button--primary {
border: none;
background-color: #2069c4;
}
}
</style>
\ No newline at end of file
......@@ -14,8 +14,8 @@
<div class="intro" v-if="list.length > 0">
<div class="name">{{ list[0].name }}</div>
<div class="deptName">{{ list[0].deptName }}</div>
<div class="intro-content">
{{ list[0].intro }}
<div class="intro-content" v-html="list[0].intro">
</div>
<EntranceIcon color="#fff" @click.native="handleClick(list[0])" />
</div>
......@@ -127,6 +127,7 @@ $blue: #2069c4;
margin-bottom: 60px;
width: 258px;
overflow: hidden;
font-size: 14px;
-webkit-line-clamp: 4;
text-overflow: ellipsis;
display: -webkit-box;
......
......@@ -2,10 +2,10 @@
<template>
<div class="museum-detail">
<div class="wrapper">
<!-- <div class="back" @click="handleBack">
<div class="back" @click="handleBack">
<svg-icon icon-class="mz-fh"></svg-icon>
<span>返回上页 </span>
</div> -->
</div>
<el-row class="detail-container" :gutter="10">
<el-col class="cr-images" :span="24">
<el-image
......
......@@ -220,6 +220,7 @@ export default {
handleTypeChange(value) {
this.type = value;
this.list.current = 1;
this.loadData();
},
handleKeyWordChange(value) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论