panhui пре 4 година
родитељ
комит
6f79e65a9b
2 измењених фајлова са 29 додато и 4 уклоњено
  1. 28 3
      src/main/comos/src/views/account/Register.vue
  2. 1 1
      src/main/vue/.env.development

+ 28 - 3
src/main/comos/src/views/account/Register.vue

@@ -48,6 +48,21 @@
                     </van-button>
                 </template>
             </van-field>
+            <van-field
+                name="图形验证码"
+                placeholder="请输入图形验证码"
+                v-model="form.captcha"
+                :maxlength="6"
+                :rules="[{ required: true, message: '请输入图形验证码' }]"
+            >
+                <template #left-icon>
+                    <img :src="require('@assets/svgs/login_icon_code.svg')" class="icon" />
+                </template>
+                <template #button>
+                    <van-image @click="getCode" :src="codeImg" width="68" height="32" fit="contain" />
+                </template>
+            </van-field>
+
             <van-field
                 type="password"
                 name="密码"
@@ -103,7 +118,7 @@
                     native-type="submit"
                     :color="`linear-gradient(to right, ${$colors.prim}, ${$colors.warn})`"
                     class="sure"
-                    >登录</van-button
+                    >注册</van-button
                 >
                 <van-button class="del" round block plain @click="$router.replace('/login')"
                     >已有账号,立即登陆</van-button
@@ -139,17 +154,27 @@ export default {
                 password2: '',
                 code: '',
                 inviteCode: this.$store.state.inviteCode || '',
-                invitor: ''
+                invitor: '',
+                captchaKey: '',
+                captcha: ''
             },
-            checked: false
+            checked: false,
+            codeImg: ''
         };
     },
     mounted() {
         if (this.invitor) {
             this.form.invitor = this.invitor;
         }
+        this.getCode();
     },
     methods: {
+        getCode() {
+            this.$http.get('/captcha/get').then(res => {
+                this.form.captchaKey = res.key;
+                this.codeImg = res.image;
+            });
+        },
         sendPhone() {
             this.$refs.form.validate('手机号码').then(() => {
                 this.sendMsg(this.form.phone);

+ 1 - 1
src/main/vue/.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=http://localhost:8080
+VUE_APP_BASE_URL=https://nfttest.9space.vip/