fuliqi
2024-09-02 8fb7cc0325027caa4ed7574443e24f5bd7a8efb7
src/views/login.vue
@@ -87,8 +87,7 @@
      var regex = /(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[\W_])/;
      if (value.length < 8 || value.length > 10) {
        callback(new Error('请输入8-10位大写字母+小写字母+数字+特殊字符'));
      }
      else if (!regex.test(value)) {
      } else if (!regex.test(value)) {
        callback(new Error("请输入8-10位大写字母+小写字母+数字+特殊字符"));
      } else {
        callback();
@@ -190,11 +189,18 @@
              if (this.loginInfo.firstLogin == 1) {
                // this.$router.push({ path: "/" }).catch(() => { });
                // return;
                this.$router.push({ path: this.redirect || "/screen" }).catch(() => { });
                if (this.loginInfo.roles.includes("admin") || this.loginInfo.roles.includes("city_leader") || this.loginInfo.roles.includes("county_leader")) {
                  this.$router.push({path: this.redirect || "/screen"}).catch(() => {
                  });
                } else {
                  this.$router.push({path: this.redirect || "/index"}).catch(() => {
                  });
                }
              } else {
                localStorage.setItem('firstLogin', 0)
              }
            }).catch(() => { })
            }).catch(() => {
            })
          }).catch(() => {
            this.loading = false;
            if (this.captchaEnabled) {
@@ -210,7 +216,8 @@
        // 修改完成将firstLogin改为1
        localStorage.setItem('firstLogin', 1)
        this.$modal.msgSuccess("修改成功");
        this.$router.push({ path: this.redirect || "/" }).catch(() => { });
        this.$router.push({path: this.redirect || "/"}).catch(() => {
        });
      }).catch((e) => {
        console.info(e)
      });
@@ -319,7 +326,6 @@
    animation-delay: 0.1s;
  }
}
.login-form {