1
YM
2024-06-05 c4b8209d92daa8c6e8ec20bdd56fecf4a95d0990
src/pages/changePassword/changePassword.vue
@@ -5,8 +5,8 @@
        class="Ttop flex flex-center flex-wrap"
        style="flex-direction: column"
      >
        <view class=""></view>
        <view class="" ref="Rtop">
        <view ></view>
        <view  ref="Rtop">
          <text class="login"></text>
          <text
            style="
@@ -32,10 +32,10 @@
            align-items: center;
          "
        >
          <!-- <view class="" style="color: #244A7B;padding-bottom: .47rem;font-size: .3rem;font-weight: bold;">用户注册</view> -->
          <!-- <view  style="color: #244A7B;padding-bottom: .47rem;font-size: .3rem;font-weight: bold;">用户注册</view> -->
          <view class="LoginBg"></view>
          <view
            class=""
            @click="BacktoLogin"
            style="
              cursor: pointer;
@@ -264,50 +264,35 @@
    this.getElementWidth();
  },
  methods: {
    // 返回登录
    BacktoLogin() {
      // uni.redirectTo({
      //    url: '/pages/Login/Login'
      // })
      uni.navigateBack();
      this.$router.go(-1);
    },
    getElementWidth() {
      this.$nextTick(() => {
        var width = this.$refs.Rtop.$el.clientWidth;
        this.Rtop1 = width + 50;
        console.log("Element width:", width);
      });
    },
    // 忘记密码
    async Login2(formName) {
    Login2(formName) {
      let Obj = {
        username: this.amendDataPass.loginID,
        password: encryptAES(this.amendDataPass.rawPass),
        newPassword: encryptAES(this.amendDataPass.newPass)
      };
      console.log(Obj);
      this.$refs[formName].validate(async (valid) => {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          // alert('submit!成功');
          await getchangePassword(Obj).then((res) => {
            // console.log(res,'修改密码成功');
          getchangePassword(Obj).then((res) => {
            if (res.success == true) {
              uni.showToast({
                title: res.object,
                icon: "none"
              this.$message.success('修改成功');
              uni.navigateTo({
                url: "/pages/Login/Login"
              });
              uni.navigateBack();
              console.log("修改成功", res);
            } else {
              uni.showToast({
                title: res.errorText,
                icon: "none"
              });
              this.$message.error(res.errorText);
            }
          });
          // uni.redirectTo({ encryptAES
          //    url: '/pages/Login/Login'
          // })
        } else {
          console.log("error submit!!失败");
          return false;