|
|
|
@ -37,6 +37,17 @@
|
|
|
|
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
|
|
|
|
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
|
|
|
|
</el-input>
|
|
|
|
</el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item prop="email">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="registerForm.email"
|
|
|
|
|
|
|
|
type="email"
|
|
|
|
|
|
|
|
size="large"
|
|
|
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
|
|
|
placeholder="邮箱"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<template #prefix><svg-icon icon-class="email" class="el-input__icon input-icon" /></template>
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item prop="code" v-if="captchaEnabled">
|
|
|
|
<el-form-item prop="code" v-if="captchaEnabled">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
size="large"
|
|
|
|
size="large"
|
|
|
|
@ -49,7 +60,12 @@
|
|
|
|
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
|
|
|
|
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
|
|
|
|
</el-input>
|
|
|
|
</el-input>
|
|
|
|
<div class="register-code">
|
|
|
|
<div class="register-code">
|
|
|
|
<img :src="codeUrl" @click="getCode" class="register-code-img"/>
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
size="large"
|
|
|
|
|
|
|
|
@click.prevent="getCode"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
获取邮箱验证码
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item style="width:100%;">
|
|
|
|
<el-form-item style="width:100%;">
|
|
|
|
@ -63,7 +79,7 @@
|
|
|
|
<span v-if="!loading">注 册</span>
|
|
|
|
<span v-if="!loading">注 册</span>
|
|
|
|
<span v-else>注 册 中...</span>
|
|
|
|
<span v-else>注 册 中...</span>
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<div style="float: right;">
|
|
|
|
<div style="float: right;font-size: 14px;padding-top:10px;">
|
|
|
|
<router-link class="link-type" :to="'/login'">使用已有账户登录</router-link>
|
|
|
|
<router-link class="link-type" :to="'/login'">使用已有账户登录</router-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
@ -76,8 +92,8 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
import { ElAlert, ElMessageBox } from "element-plus";
|
|
|
|
import { getCodeImg, register } from "@/api/login";
|
|
|
|
import { getCodeMail, register } from "@/api/login";
|
|
|
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
const router = useRouter();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
@ -87,6 +103,7 @@ const registerForm = ref({
|
|
|
|
password: "",
|
|
|
|
password: "",
|
|
|
|
confirmPassword: "",
|
|
|
|
confirmPassword: "",
|
|
|
|
code: "",
|
|
|
|
code: "",
|
|
|
|
|
|
|
|
email: "",
|
|
|
|
uuid: ""
|
|
|
|
uuid: ""
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@ -98,6 +115,7 @@ const equalToPassword = (rule, value, callback) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const registerRules = {
|
|
|
|
const registerRules = {
|
|
|
|
username: [
|
|
|
|
username: [
|
|
|
|
{ required: true, trigger: "blur", message: "请输入您的账号" },
|
|
|
|
{ required: true, trigger: "blur", message: "请输入您的账号" },
|
|
|
|
@ -111,6 +129,9 @@ const registerRules = {
|
|
|
|
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
|
|
|
|
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
|
|
|
|
{ required: true, validator: equalToPassword, trigger: "blur" }
|
|
|
|
{ required: true, validator: equalToPassword, trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
email: [
|
|
|
|
|
|
|
|
{ required: true, trigger: "blur", message: "请输入正确的邮箱地址" }
|
|
|
|
|
|
|
|
],
|
|
|
|
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
|
|
|
|
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@ -132,25 +153,19 @@ function handleRegister() {
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {
|
|
|
|
}).catch(() => {
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
if (captchaEnabled) {
|
|
|
|
|
|
|
|
getCode();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getCode() {
|
|
|
|
function getCode() {
|
|
|
|
getCodeImg().then(res => {
|
|
|
|
getCodeMail(registerForm.value.email).then(res => {
|
|
|
|
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
|
|
|
proxy.$modal.msgSuccess("邮件发送成功");
|
|
|
|
if (captchaEnabled.value) {
|
|
|
|
registerForm.value.uuid = res.uuid;
|
|
|
|
codeUrl.value = "data:image/gif;base64," + res.img;
|
|
|
|
})
|
|
|
|
registerForm.value.uuid = res.uuid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getCode();
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
|