mirror of
https://gitee.com/XiaoLFeng/JSL_OrganizeInternalOA_Web.git
synced 2025-06-08 11:43:04 +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"/>
|
<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>
|
</svg>
|
||||||
</span>
|
</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">
|
<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>男</option>
|
<option value=1>男</option>
|
||||||
<option>女</option>
|
<option value=2>女</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -114,26 +114,38 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
|
||||||
import getCurrentTimestamp from '../public/methods.js';
|
|
||||||
import Icp from "@/components/MainPage/Icp.vue";
|
import Icp from "@/components/MainPage/Icp.vue";
|
||||||
import requests from '../public/request.js'
|
import requests from '../public/request.js'
|
||||||
|
import {useRouter} from "vue-router";
|
||||||
|
import message from "view-ui-plus/src/components/message/index.js";
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
address: '',
|
address: '',
|
||||||
sex: '',
|
sex: 0,
|
||||||
age: '',
|
age: '',
|
||||||
email: '',
|
email: '',
|
||||||
phone: ''
|
phone: ''
|
||||||
}
|
}
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
message.config({
|
||||||
|
background: true
|
||||||
|
})
|
||||||
|
|
||||||
function registerUser() {
|
function registerUser() {
|
||||||
|
|
||||||
|
data.sex = parseInt(data.sex)
|
||||||
|
console.log("registerData:",data)
|
||||||
requests.register(data).then((res) => {
|
requests.register(data).then((res) => {
|
||||||
|
console.log("registerData:",data)
|
||||||
|
console.log("registerResult:",res)
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
//注册成功,提示+跳转页面
|
//注册成功,提示+跳转页面
|
||||||
console.log('注册成功')
|
console.log('注册成功')
|
||||||
|
message.success
|
||||||
|
router.push("/login")
|
||||||
} else {
|
} else {
|
||||||
//注册失败,消息提示
|
//注册失败,消息提示
|
||||||
console.log('注册失败')
|
console.log('注册失败')
|
||||||
@ -141,8 +153,4 @@ function registerUser() {
|
|||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user