Commit c3b23dc9 authored by GuanHua's avatar GuanHua

feat:update

parent 3131198a
...@@ -116,11 +116,11 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) { ...@@ -116,11 +116,11 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
return url === pathname && selfQuery.page_type === query.page_type return url === pathname && selfQuery.page_type === query.page_type
})) { })) {
// 深度匹配成功, 可正常访问 // 深度匹配成功, 可正常访问
return ; return;
} }
// 是否在路由权限列表里 // 是否在路由权限列表里
if (routeAuthUrls.includes(pathname)) { if (routeAuthUrls.includes(pathname)) {
return ; return;
} }
// 无权限访问时 // 无权限访问时
history.replace('/memberCenter/noAuth') history.replace('/memberCenter/noAuth')
......
...@@ -14,8 +14,9 @@ const LoginWrap: React.FC = () => { ...@@ -14,8 +14,9 @@ const LoginWrap: React.FC = () => {
const [validFrame, setValidFrame] = useState(false) const [validFrame, setValidFrame] = useState(false)
const [validButton, setValidButton] = useState(false) const [validButton, setValidButton] = useState(false)
const finish = (value:any) => { const finish = (value: any) => {
PublicApi.postMemberLogin(value).then(res => { PublicApi.postMemberLogin(value).then(res => {
if (res.code === 1000) {
const { data } = res const { data } = res
setAuth({ setAuth({
memberId: data.memberId, memberId: data.memberId,
...@@ -25,6 +26,7 @@ const LoginWrap: React.FC = () => { ...@@ -25,6 +26,7 @@ const LoginWrap: React.FC = () => {
setRouters(data.urls) setRouters(data.urls)
// 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验 // 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验
window.location.href = '/memberCenter/home' window.location.href = '/memberCenter/home'
}
}) })
} }
...@@ -34,9 +36,9 @@ const LoginWrap: React.FC = () => { ...@@ -34,9 +36,9 @@ const LoginWrap: React.FC = () => {
{ {
validFrame ? validFrame ?
<> <>
<Row gutter={[0,80]}> <Row gutter={[0, 80]}>
<Col span={16}> <Col span={16}>
<Input size='large'/> <Input size='large' />
</Col> </Col>
<Col offset={1} span={7}> <Col offset={1} span={7}>
<Button type='default' size='large'>获取验证码</Button> <Button type='default' size='large'>获取验证码</Button>
...@@ -58,12 +60,12 @@ const LoginWrap: React.FC = () => { ...@@ -58,12 +60,12 @@ const LoginWrap: React.FC = () => {
[ [
{ {
required: true, required: true,
message: <><ExclamationCircleFilled style={{marginRight: 6}}/><span>请输入正确的用户名</span></> message: <><ExclamationCircleFilled style={{ marginRight: 6 }} /><span>请输入正确的用户名</span></>
} }
] ]
} }
> >
<Input prefix={<UserOutlined />} placeholder='用户名/手机号' size='large'/> <Input prefix={<UserOutlined />} placeholder='用户名/手机号' size='large' />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name='password' name='password'
...@@ -71,14 +73,14 @@ const LoginWrap: React.FC = () => { ...@@ -71,14 +73,14 @@ const LoginWrap: React.FC = () => {
[ [
{ {
required: true, required: true,
message: <><ExclamationCircleFilled style={{marginRight: 6}}/><span>请输入正确的密码</span></> message: <><ExclamationCircleFilled style={{ marginRight: 6 }} /><span>请输入正确的密码</span></>
} }
] ]
} }
> >
<Input.Password prefix={<LockOutlined />} placeholder='请输入密码' size='large'/> <Input.Password prefix={<LockOutlined />} placeholder='请输入密码' size='large' />
</Form.Item> </Form.Item>
{ validButton && (<Form.Item {validButton && (<Form.Item
className={styles.loginVerBtn} className={styles.loginVerBtn}
> >
<Button ghost type='primary' block size='large'>点击进行验证</Button> <Button ghost type='primary' block size='large'>点击进行验证</Button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment