|
@@ -2,12 +2,32 @@
|
|
|
<div id="heads">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-col :span="18" class="title">
|
|
|
+ <el-col :span="15" class="title">
|
|
|
吉林省小微企业金融管理后台
|
|
|
</el-col>
|
|
|
+ <el-col :span="3" class="admin"> </el-col>
|
|
|
+ <el-dialog title="修改密码" :visible.sync="dialogFormVisible">
|
|
|
+ <el-form :model="form" :rules="rules">
|
|
|
+ <el-form-item label="旧密码" :label-width="formLabelWidth" prop="oldpasswd">
|
|
|
+ <el-input type="password" v-model="form.oldpasswd" autocomplete="off" placeholder="请输入旧密码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="新密码" :label-width="formLabelWidth" prop="newpasswd">
|
|
|
+ <el-input type="password" v-model="form.newpasswd" autocomplete="off" placeholder="请输入新密码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <div class="ccc">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="onsave(form)">确 定</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
<el-col :span="6" class="admin">
|
|
|
+ <el-tooltip class="item" effect="dark" content="修改密码" placement="bottom">
|
|
|
+ <el-button type="text" @click="dialogFormVisible = true"><i class="el-icon-share"></i></el-button>
|
|
|
+ </el-tooltip>
|
|
|
<i class="el-icon-user icon"></i>
|
|
|
- <span class="name">管理员:{{ user.name }}</span>
|
|
|
+ <span class="name"> 管理员:{{ user.name }}</span>
|
|
|
<span class="shu">|</span>
|
|
|
<el-link :underline="false" class="out" @click="toLogout()">退出</el-link>
|
|
|
</el-col>
|
|
@@ -18,11 +38,21 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: otheruser } = createNamespacedHelpers('otheruser');
|
|
|
export default {
|
|
|
name: 'heads',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
- data: () => ({}),
|
|
|
+ data: () => ({
|
|
|
+ rules: {
|
|
|
+ oldpasswd: [{ required: true, message: '请输入旧密码', trigger: 'blur' }],
|
|
|
+ newpasswd: [{ required: true, message: '请输入新密码', trigger: 'blur' }],
|
|
|
+ },
|
|
|
+ dialogTableVisible: false,
|
|
|
+ dialogFormVisible: false,
|
|
|
+ form: {},
|
|
|
+ formLabelWidth: '120px',
|
|
|
+ }),
|
|
|
created() {},
|
|
|
watch: {},
|
|
|
computed: {
|
|
@@ -30,6 +60,8 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['deleteUser']),
|
|
|
+ ...otheruser(['query', 'fetch', 'updates', 'create']),
|
|
|
+
|
|
|
async toLogout() {
|
|
|
this.deleteUser();
|
|
|
this.$message({
|
|
@@ -41,6 +73,20 @@ export default {
|
|
|
async toLogin() {
|
|
|
this.$router.push({ name: 'login' });
|
|
|
},
|
|
|
+
|
|
|
+ async onsave(form) {
|
|
|
+ this.form.uid = this.user.uid;
|
|
|
+ console.log(form);
|
|
|
+ let res = await this.updates(form);
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ this.$router.push({ path: '/login' });
|
|
|
+ this.$message({
|
|
|
+ message: '修改密码成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // this.dialogFormVisible = false;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -77,4 +123,7 @@ export default {
|
|
|
font-weight: 400;
|
|
|
color: rgba(233, 2, 29, 1);
|
|
|
}
|
|
|
+.ccc {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|