|
@@ -10,49 +10,21 @@
|
|
|
<div class="dialog-public-background">
|
|
|
<div class="title">修改密码</div>
|
|
|
<div class="content">
|
|
|
- <el-form
|
|
|
- :model="dataForm"
|
|
|
- :rules="dataRules"
|
|
|
- ref="dataForm"
|
|
|
- class="demo-dataForm"
|
|
|
- >
|
|
|
+ <el-form :model="dataForm" :rules="dataRules" ref="dataForm" class="demo-dataForm">
|
|
|
<el-form-item label="旧密码" prop="old">
|
|
|
- <el-input
|
|
|
- size="medium"
|
|
|
- placeholder="请输入旧密码"
|
|
|
- show-password
|
|
|
- v-model="dataForm.old"
|
|
|
- ></el-input>
|
|
|
+ <el-input size="medium" placeholder="请输入旧密码" show-password v-model="dataForm.old"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="新密码" prop="new">
|
|
|
- <el-input
|
|
|
- size="medium"
|
|
|
- placeholder="请输入新密码"
|
|
|
- show-password
|
|
|
- v-model="dataForm.new"
|
|
|
- ></el-input>
|
|
|
+ <el-input size="medium" placeholder="请输入新密码" show-password v-model="dataForm.new"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="再次确认新密码" prop="again">
|
|
|
- <el-input
|
|
|
- size="medium"
|
|
|
- placeholder="请再次确认新密码"
|
|
|
- show-password
|
|
|
- v-model="dataForm.again"
|
|
|
- ></el-input>
|
|
|
+ <el-input size="medium" placeholder="请再次确认新密码" show-password v-model="dataForm.again"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="foot center t30">
|
|
|
- <el-button
|
|
|
- size="medium"
|
|
|
- type="primary"
|
|
|
- @click="addSubmit('dataForm')"
|
|
|
- class="r24"
|
|
|
- >保存</el-button
|
|
|
- >
|
|
|
- <el-button size="medium" @click="resetForm('dataForm')"
|
|
|
- >取消</el-button
|
|
|
- >
|
|
|
+ <el-button size="medium" type="primary" @click="addSubmit('dataForm')" class="r24">保存</el-button>
|
|
|
+ <el-button size="medium" @click="resetForm('dataForm')">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</Dialog>
|
|
@@ -62,9 +34,7 @@
|
|
|
<div class="flx">退出系统</div>
|
|
|
<div class="content">是否确认退出系统?</div>
|
|
|
<div class="foot right t30" style="margin-top: 24px">
|
|
|
- <el-button size="medium" class="r25 r26" @click="outQd" type="primary"
|
|
|
- >确定</el-button
|
|
|
- >
|
|
|
+ <el-button size="medium" class="r25 r26" @click="outQd" type="primary">确定</el-button>
|
|
|
<el-button size="medium" @click="outQx" class="r26">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -77,6 +47,7 @@ import { Navbar, Sidebar, AppMain } from "./components";
|
|
|
import ResizeMixin from "./mixin/ResizeHandler";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { EditPwd } from "@/api/apiHome";
|
|
|
+import { removeToken } from "@/utils/auth";
|
|
|
import Dialog from "@/layout/components/Dialog";
|
|
|
export default {
|
|
|
name: "Layout",
|
|
@@ -87,7 +58,7 @@ export default {
|
|
|
Dialog,
|
|
|
},
|
|
|
mixins: [ResizeMixin],
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
dataForm: {
|
|
|
//数据项表单
|
|
@@ -109,12 +80,12 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters(["pwdflag", "outflag", "name"]),
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
document.getElementById("sidebar-containers").style.width = "56px";
|
|
|
document.getElementById("main-containers").style.paddingLeft = "56px";
|
|
|
},
|
|
|
methods: {
|
|
|
- leuper(data) {
|
|
|
+ leuper (data) {
|
|
|
if (data) {
|
|
|
document.getElementById("sidebar-containers").style.width = "208px";
|
|
|
document.getElementById("main-containers").style.paddingLeft = "208px";
|
|
@@ -136,7 +107,7 @@ export default {
|
|
|
// // document.getElementById("main-containers").style.paddingLeft = "30px";
|
|
|
// },
|
|
|
//存储数据项-提交
|
|
|
- addSubmit(formName) {
|
|
|
+ addSubmit (formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.dataForm.new !== this.dataForm.again) {
|
|
@@ -151,23 +122,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//存储数据项-取消
|
|
|
- resetForm(formName) {
|
|
|
+ resetForm (formName) {
|
|
|
this.$store.dispatch("app/togglePwdflag", false);
|
|
|
this.$refs[formName].resetFields();
|
|
|
},
|
|
|
//退出系统-取消
|
|
|
- outQx() {
|
|
|
+ outQx () {
|
|
|
this.$store.dispatch("app/toggleOutflag", false);
|
|
|
},
|
|
|
//退出系统-确定
|
|
|
- async outQd() {
|
|
|
- sessionStorage.removeItem("userName");
|
|
|
- this.$store.dispatch("app/toggleOutflag", false);
|
|
|
- await this.$store.dispatch("user/logout");
|
|
|
- this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
|
|
+ async outQd () {
|
|
|
+ if (this.name == '匿名用户') {
|
|
|
+ removeToken();
|
|
|
+ sessionStorage.clear();
|
|
|
+ this.$store.dispatch("app/toggleOutflag", false);
|
|
|
+ this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
|
|
+ location.reload();
|
|
|
+ } else {
|
|
|
+ sessionStorage.removeItem("userName");
|
|
|
+ this.$store.dispatch("app/toggleOutflag", false);
|
|
|
+ await this.$store.dispatch("user/logout");
|
|
|
+ this.$router.push(`/login?redirect=${this.$route.fullPath}`);
|
|
|
+ }
|
|
|
},
|
|
|
//修改密码
|
|
|
- async editPwd() {
|
|
|
+ async editPwd () {
|
|
|
try {
|
|
|
const res = await EditPwd({
|
|
|
LoginName: this.name,
|