ruoyi-ui/src/views/register.vue
@@ -2,6 +2,16 @@
  <div class="register">
    <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
      <h3 class="title">RuoYi-Vue-Plus后台管理系统</h3>
      <el-form-item prop="tenantId">
        <el-input
            v-model="loginForm.tenantId"
            type="text"
            auto-complete="off"
            placeholder="租户编号"
        >
          <svg-icon slot="prefix" icon-class="input" class="el-input__icon input-icon" />
        </el-input>
      </el-form-item>
      <el-form-item prop="username">
        <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
          <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@@ -29,7 +39,7 @@
          <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
        </el-input>
      </el-form-item>
      <el-form-item prop="code" v-if="captchaOnOff">
      <el-form-item prop="code" v-if="captchaEnabled">
        <el-input
          v-model="registerForm.code"
          auto-complete="off"
@@ -82,13 +92,18 @@
    return {
      codeUrl: "",
      registerForm: {
        tenantId: "",
        username: "",
        password: "",
        confirmPassword: "",
        code: "",
        uuid: ""
        uuid: "",
        userType: "sys_user"
      },
      registerRules: {
        tenantId: [
          { required: true, trigger: "blur", message: "请输入您的租户编号" }
        ],
        username: [
          { required: true, trigger: "blur", message: "请输入您的账号" },
          { min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
@@ -104,7 +119,7 @@
        code: [{ required: true, trigger: "change", message: "请输入验证码" }]
      },
      loading: false,
      captchaOnOff: true
      captchaEnabled: true
    };
  },
  created() {
@@ -113,8 +128,8 @@
  methods: {
    getCode() {
      getCodeImg().then(res => {
        this.captchaOnOff = res.data.captchaOnOff === undefined ? true : res.data.captchaOnOff;
        if (this.captchaOnOff) {
        this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled;
        if (this.captchaEnabled) {
          this.codeUrl = "data:image/gif;base64," + res.data.img;
          this.registerForm.uuid = res.data.uuid;
        }
@@ -136,7 +151,7 @@
            }).catch(() => {});
          }).catch(() => {
            this.loading = false;
            if (this.captchaOnOff) {
            if (this.captchaEnabled) {
              this.getCode();
            }
          })