|
|
@@ -0,0 +1,77 @@
|
|
|
+<style lang="scss">
|
|
|
+.add {
|
|
|
+ .el-input,
|
|
|
+ button {
|
|
|
+ width: 300px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<template>
|
|
|
+ <section class="add">
|
|
|
+ <p>系统管理 > 修改密码</p>
|
|
|
+ <div class="content">
|
|
|
+ <el-form label-width="80px">
|
|
|
+ <el-form-item label="新密码">
|
|
|
+ <el-input type="password" placeholder="新密码" v-model="form.password"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="确认密码">
|
|
|
+ <el-input type="password" placeholder="确认密码" v-model="form.repassword"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label=" ">
|
|
|
+ <el-button type="primary" @click="save">保存</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ test: "",
|
|
|
+ form: { name: "", realname: "", password:"",repassword:"",permissions:[],status: 1 },
|
|
|
+ permissions:[],
|
|
|
+ permission:[],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getData() {
|
|
|
+ this.$api.getAccountById({ id: this.form.id }).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ if(res.data.data.permissions){
|
|
|
+ this.permission=res.data.data.permissions.split(',')
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ save() {
|
|
|
+ var parm = this.form;
|
|
|
+ this.$api.resetPwd(parm).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.$message({ message: "修改成功!", type: "success" });
|
|
|
+ this.$api.logout(parm).then(res=>{
|
|
|
+ this.$router.push({ path: "/login" });
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.$api.getPerList().then(res=>{
|
|
|
+ this.permissions=res.data.data;
|
|
|
+ })
|
|
|
+ if (this.$route.query.id) {
|
|
|
+ this.form.id = this.$route.query.id;
|
|
|
+ this.id = this.$route.query.id;
|
|
|
+ this.getData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|