杨磊
2024-07-26 2b06902e25978254f39bef49ed3cf6b1cab1c033
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="
@@ -16,7 +16,7 @@
              font-family: cursive;
              font-weight: bold;
            "
            >中国医学人物知识库</text
            >中国历代医学人物知识库</text
          >
        </view>
        <view></view>
@@ -30,21 +30,24 @@
            justify-content: space-between;
            margin-bottom: 0.47rem;
            align-items: center;
            padding-top: 0.6rem;
          "
        >
          <!-- <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;
              font-size: 0.14rem;
              color: #244a7b;
              font-weight: normal;
              position: absolute;
              left: 0.1rem;
              top: 0.1rem;
            "
          >
            返回
            < 返回
          </view>
        </view>
        <el-form
@@ -230,25 +233,29 @@
      // 书籍数据
      listData: [
        {
          name: "中医人物数据库",
          name: "历代人物",
          id: 1
        },
        {
          name: "世医医家数据库",
          name: "家学传承",
          id: 2
        },
        {
          name: "中医学术流派",
          name: "学术图谱",
          id: 6
        },
        {
          name: "学术流派",
          id: 3
        },
        {
          name: "中医地域医谱",
          name: "地域图谱",
          id: 4
        },
        {
          name: "中医医事制度",
          id: 5
        }
        // {
        //   name: "中医医事制度",
        //   id: 5
        // }
      ]
    };
  },
@@ -264,50 +271,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;