完全重写了后端,现在commit一下以前的更改,开始全新的适配
This commit is contained in:
parent
ac7272d59a
commit
ea20be6058
@ -1,21 +1,58 @@
|
||||
<script setup>
|
||||
import {ref} from 'vue';
|
||||
import { ElInput, ElButton, ElForm, ElFormItem, ElMessage } from 'element-plus';
|
||||
import {ElButton, ElForm, ElFormItem, ElInput, ElMessage} from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
import axios from 'axios';
|
||||
import {useRouter} from 'vue-router';
|
||||
|
||||
const companyName = ref('');
|
||||
const contactInfo = ref('');
|
||||
const password = ref('');
|
||||
const verificationCode = ref('');
|
||||
const router = useRouter();
|
||||
|
||||
const handleRegister = () => {
|
||||
console.log('Registering with', { companyName: companyName.value, contactInfo: contactInfo.value, password: password.value, verificationCode: verificationCode.value });
|
||||
// 处理注册逻辑
|
||||
const handleRegister = async () => {
|
||||
console.log('Registering with', {
|
||||
companyName: companyName.value,
|
||||
contactInfo: contactInfo.value,
|
||||
password: password.value,
|
||||
verificationCode: verificationCode.value
|
||||
});
|
||||
|
||||
try {
|
||||
const response = await axios.post('/api/register', {
|
||||
companyName: companyName.value,
|
||||
contactInfo: contactInfo.value,
|
||||
password: password.value,
|
||||
verificationCode: verificationCode.value,
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
ElMessage.success('注册成功');
|
||||
router.push('/login');
|
||||
} else {
|
||||
ElMessage.error('注册失败,请稍后再试');
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error('注册失败,请稍后再试');
|
||||
}
|
||||
};
|
||||
|
||||
const sendVerificationCode = () => {
|
||||
const sendVerificationCode = async () => {
|
||||
// try {
|
||||
// const response = await axios.post('/api/send-verification-code', {
|
||||
// contactInfo: contactInfo.value,
|
||||
// });
|
||||
//
|
||||
// if (response.status === 200) {
|
||||
// ElMessage.success('验证码已发送');
|
||||
// } else {
|
||||
// ElMessage.error('发送验证码失败,请稍后再试');
|
||||
// }
|
||||
// } catch (error) {
|
||||
// ElMessage.error('发送验证码失败,请稍后再试');
|
||||
// }
|
||||
ElMessage.success('验证码已发送');
|
||||
// 处理发送验证码逻辑
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user