mirror of
https://gitee.com/XiaoLFeng/JSL_OrganizeInternalOA_Web.git
synced 2025-06-08 03:33:03 +08:00
完善注册
This commit is contained in:
parent
edac900c0b
commit
528c086ca6
@ -93,9 +93,9 @@
|
||||
<path fill-rule="evenodd" d="M12 20a8 8 0 0 1-5-1.8v-.6c0-1.8 1.5-3.3 3.3-3.3h3.4c1.8 0 3.3 1.5 3.3 3.3v.6a8 8 0 0 1-5 1.8ZM2 12a10 10 0 1 1 10 10A10 10 0 0 1 2 12Zm10-5a3.3 3.3 0 0 0-3.3 3.3c0 1.7 1.5 3.2 3.3 3.2 1.8 0 3.3-1.5 3.3-3.3C15.3 8.6 13.8 7 12 7Z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</span>
|
||||
<select class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-none rounded-e-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option>男</option>
|
||||
<option>女</option>
|
||||
<select v-model="data.sex" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-none rounded-e-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5">
|
||||
<option value=1>男</option>
|
||||
<option value=2>女</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -114,26 +114,38 @@
|
||||
|
||||
|
||||
<script setup>
|
||||
import axios from 'axios';
|
||||
import getCurrentTimestamp from '../public/methods.js';
|
||||
import Icp from "@/components/MainPage/Icp.vue";
|
||||
import requests from '../public/request.js'
|
||||
import {useRouter} from "vue-router";
|
||||
import message from "view-ui-plus/src/components/message/index.js";
|
||||
|
||||
const data = {
|
||||
username: '',
|
||||
password: '',
|
||||
address: '',
|
||||
sex: '',
|
||||
sex: 0,
|
||||
age: '',
|
||||
email: '',
|
||||
phone: ''
|
||||
}
|
||||
const router = useRouter()
|
||||
|
||||
message.config({
|
||||
background: true
|
||||
})
|
||||
|
||||
function registerUser() {
|
||||
|
||||
data.sex = parseInt(data.sex)
|
||||
console.log("registerData:",data)
|
||||
requests.register(data).then((res) => {
|
||||
console.log("registerData:",data)
|
||||
console.log("registerResult:",res)
|
||||
if (res.data.code === 200) {
|
||||
//注册成功,提示+跳转页面
|
||||
console.log('注册成功')
|
||||
message.success
|
||||
router.push("/login")
|
||||
} else {
|
||||
//注册失败,消息提示
|
||||
console.log('注册失败')
|
||||
@ -141,8 +153,4 @@ function registerUser() {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user