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

优化登录和退出流程

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