RuoYi
2024-03-01 6a10846b6d364219bfa3cff561a47753d3546ea8
src/views/register.vue
@@ -37,7 +37,7 @@
          <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
        </el-input>
      </el-form-item>
      <el-form-item prop="code" v-if="captchaOnOff">
      <el-form-item prop="code" v-if="captchaEnabled">
        <el-input
          size="large" 
          v-model="registerForm.code"
@@ -70,7 +70,7 @@
    </el-form>
    <!--  底部  -->
    <div class="el-register-footer">
      <span>Copyright © 2018-2022 ruoyi.vip All Rights Reserved.</span>
      <span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span>
    </div>
  </div>
</template>
@@ -105,7 +105,8 @@
  ],
  password: [
    { required: true, trigger: "blur", message: "请输入您的密码" },
    { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }
    { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" },
    { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
  ],
  confirmPassword: [
    { required: true, trigger: "blur", message: "请再次输入您的密码" },
@@ -116,7 +117,7 @@
const codeUrl = ref("");
const loading = ref(false);
const captchaOnOff = ref(true);
const captchaEnabled = ref(true);
function handleRegister() {
  proxy.$refs.registerRef.validate(valid => {
@@ -132,7 +133,7 @@
        }).catch(() => {});
      }).catch(() => {
        loading.value = false;
        if (captchaOnOff) {
        if (captchaEnabled) {
          getCode();
        }
      });
@@ -142,8 +143,8 @@
function getCode() {
  getCodeImg().then(res => {
    captchaOnOff.value = res.captchaOnOff === undefined ? true : res.captchaOnOff;
    if (captchaOnOff.value) {
    captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
    if (captchaEnabled.value) {
      codeUrl.value = "data:image/gif;base64," + res.img;
      registerForm.value.uuid = res.uuid;
    }