dengjunjie
2024-10-30 680ccbedf08839143215f40dea5273dc2819100c
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSClient/src/extension/system/Sys_User/Sys_UserGridHeader.vue
@@ -15,22 +15,25 @@
      </el-alert>
      <div>
        <el-input
          placeholder="请输入密码"
          placeholder="请输入旧密码"
          v-model="password"
          type="password"
          size="large"
          style="width: 100%; margin-top: 15px"
        />
      </div>
      <div>
        <el-input
          placeholder="请输入新密码"
          v-model="newPwd"
          type="password"
          size="large"
          style="width: 100%; margin-top: 15px"
        />
      </div>
      <template #footer>
        <el-button
          type="primary"
          @click="savePwd()"
          >修改密码</el-button
        >
        <el-button
          @click="model = false"
          >关闭</el-button
        >
        <el-button type="primary" @click="savePwd()">修改密码</el-button>
        <el-button @click="model = false">关闭</el-button>
      </template>
    </vol-box>
  </div>
@@ -39,30 +42,35 @@
import { defineComponent, defineAsyncComponent } from "vue";
export default defineComponent({
  components: {
    VolBox: defineAsyncComponent(() => import("@/components/basic/VolBox.vue"))
    VolBox: defineAsyncComponent(() => import("@/components/basic/VolBox.vue")),
  },
  data() {
    return {
      row: {},
      password: "",
      newPwd: "",
      model: false,
    };
  },
  methods: {
    open(row) {
      this.password = "";
      this.newPwd = "";
      this.row = row;
      this.model = true;
    },
    savePwd() {
      if (!this.password) return this.$Message.error("请输密码");
      if (this.password.length < 6)
      if (!this.password || !this.newPwd)
        return this.$Message.error("请输入密码");
      if (this.password.length < 6 || this.newPwd.length < 6)
        return this.$Message.error("密码长度至少6位");
      let url =
        "/api/user/modifyUserPwd?password=" +
        "/api/user/ModifyPwd?oldPwd=" +
        this.password +
        "&newPwd=" +
        this.newPwd +
        "&userName=" +
        this.row.UserName;
        this.row.userName;
      this.http.post(url, {}, true).then((x) => {
        if (!x.status) {
          return this.$message.error(x.message);
@@ -73,7 +81,7 @@
    },
  },
  created() {},
})
});
</script>
<style lang="less" scoped>
h3 {