Merge branch 'develop' of https://gitee.com/licuizhu/bamboo-map-web into develop
This commit is contained in:
commit
e00d00f4b4
@ -16,6 +16,14 @@ export function registerSms( params ) {
|
||||
});
|
||||
}
|
||||
|
||||
// 用户注册
|
||||
export function registerUser( data ) {
|
||||
return request('/api/user/register', {
|
||||
method: 'POST',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取导航栏
|
||||
export function queryUserMenu() {
|
||||
return request('/api/user/queryUserMenu', {
|
||||
|
@ -16,7 +16,7 @@ function Login (e) {
|
||||
// } catch {
|
||||
// message.error('登录失败')
|
||||
// }
|
||||
passwordLogin({username: values.username, password: values.password}).then((e) => {
|
||||
passwordLogin({phone: values.phone, password: values.password}).then((e) => {
|
||||
if (!e.success) {
|
||||
message.error(e.message);
|
||||
} else {
|
||||
@ -51,18 +51,18 @@ function Login (e) {
|
||||
autoComplete="off"
|
||||
>
|
||||
<Form.Item
|
||||
label="账户"
|
||||
name="username"
|
||||
label="手机号"
|
||||
name="phone"
|
||||
className='formItemStyle'
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '账户名称不能为空!',
|
||||
message: '手机号不能为空!',
|
||||
},
|
||||
]}
|
||||
style={{marginBottom: '45px'}}
|
||||
>
|
||||
<Input placeholder='请输入账户'/>
|
||||
<Input placeholder='请输入手机号'/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
|
@ -2,7 +2,7 @@ import { useState } from 'react';
|
||||
import { Form, Input, Button, Checkbox, message, Col, Row, Tag, Tabs } from 'antd';
|
||||
import '../../index.less';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { registerSms } from '../../api';
|
||||
import { registerSms, registerUser } from '../../api';
|
||||
|
||||
function Register(e) {
|
||||
|
||||
@ -41,7 +41,9 @@ function Register(e) {
|
||||
}
|
||||
}
|
||||
let onFinish = async (values) => {
|
||||
register({
|
||||
registerUser({
|
||||
phone: values.mobile,
|
||||
verification: values.verificationCode,
|
||||
username: values.username,
|
||||
password: values.password
|
||||
}).then((e) => {
|
||||
@ -122,7 +124,7 @@ function Register(e) {
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.Password placeholder='请输入用户名' bordered={false} />
|
||||
<Input placeholder='请输入用户名' bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="密码"
|
||||
@ -148,7 +150,7 @@ function Register(e) {
|
||||
|
||||
<Form.Item style={{ marginTop: '68px' }}>
|
||||
<Button type="primary" htmlType="submit" style={{ height: '72px' }} block>立即注册</Button>
|
||||
<a className='new-user'>前往登录</a>
|
||||
<a className='new-user' href='/login'>前往登录</a>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Tabs.TabPane>
|
||||
|
Loading…
Reference in New Issue
Block a user