分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-01-16 5884c9023393061afbe6d3d6e709e53e672ddde8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<template>
  <div>
    <vol-box :model.sync="model" :padding="30" title="修改密码" :width="450" :height="200">
      <Alert type="info">
        <h3>
          <span>帐号:{{row.UserName}}</span>
          <span>用户:{{row.UserTrueName}}</span>
        </h3>
      </Alert>
      <div>
        <Input
          placeholder="请输入密码"
          v-model="password"
          size="large"
          style="  width: 100%;margin-top: 15px;"
        >
          <Icon type="ios-lock" slot="prefix" />
        </Input>
      </div>
      <div slot="footer">
        <Button type="info" size="large" icon="md-checkmark-circle" @click="savePwd()">修改密码</Button>
        <Button type="info" size="large" icon="md-close" @click="()=>{this.model=false}">关闭</Button>
      </div>
    </vol-box>
  </div>
</template>
<script>
export default {
  components: {
    VolBox: () => import("@/components/basic/VolBox.vue"),
  },
  data() {
    return {
      row: {},
      password: "",
      model: false,
    };
  },
  methods: {
    open(row) {
      this.password = "";
      this.row = row;
      this.model = true;
    },
    savePwd() {
      if (!this.password) return this.$Message.error("请输密码");
      if (this.password.length < 6)
        return this.$Message.error("密码长度至少6位");
      let url =
        "/api/user/modifyUserPwd?password=" +
        this.password +
        "&userName=" +
        this.row.UserName;
      this.http.post(url, {}, true).then((x) => {
        if (!x.status) {
          return this.$message.error(x.message);
        }
        this.model = false;
        this.$Message.success(x.message);
      });
    },
  },
  created() {},
};
</script>
<style lang="less" scoped>
h3 {
  font-weight: 500;
  > span:last-child {
    margin-left: 30px;
  }
}
</style>