Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
ae9d3590
Commit
ae9d3590
authored
Nov 11, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加权限,修改测试发现的bug
parent
96206495
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
297 additions
and
159 deletions
+297
-159
config.ts
config/config.ts
+5
-0
SecurityLayout.tsx
src/layouts/SecurityLayout.tsx
+4
-53
CommunityService.ts
src/models/CommunityManagement/CommunityService.ts
+7
-8
login.ts
src/models/login.ts
+1
-1
Card.tsx
src/pages/CommercialService/Card.tsx
+6
-2
Detail.tsx
src/pages/CommercialService/Detail.tsx
+3
-1
PropertyServices.tsx
src/pages/CommercialService/PropertyServices.tsx
+5
-0
Renovation.tsx
src/pages/CommercialService/Renovation.tsx
+6
-1
ChargeManager.tsx
src/pages/PropertyManagement/ChargeManager.tsx
+5
-0
Users.tsx
src/pages/UserManagement/LIFEUserManagement/Users.tsx
+16
-2
UsersDetail.tsx
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
+5
-0
AccoutingContent.tsx
...Management/ServiceProviderManagement/AccoutingContent.tsx
+5
-0
Detail.tsx
...pages/UserManagement/ServiceProviderManagement/Detail.tsx
+6
-1
ServiceProviderManagement.tsx
...t/ServiceProviderManagement/ServiceProviderManagement.tsx
+15
-1
index.tsx
src/pages/user/login/index.tsx
+24
-15
login2.tsx
src/pages/user/login/login2.tsx
+69
-0
style.less
src/pages/user/login/style.less
+91
-62
index.tsx
src/pages/user/login2/index.tsx
+4
-7
login.ts
src/services/login.ts
+20
-5
No files found.
config/config.ts
View file @
ae9d3590
...
...
@@ -48,6 +48,11 @@ export default defineConfig({
path
:
'/user/forget'
,
component
:
'./user/login'
,
},
{
name
:
'login'
,
path
:
'/user/login2'
,
component
:
'./user/login/login2'
,
},
],
},
{
...
...
src/layouts/SecurityLayout.tsx
View file @
ae9d3590
...
...
@@ -53,59 +53,11 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// const isLogin = currentUser && currentUser.name;//isLogin为关键点
const
routeAuth
=
[
[
1
,
'/manager/data/lookUp'
],
[
2
,
'/manager/account/lookUp'
],
[
3
,
'/manager/account/edit'
],
[
4
,
'/manager/account/addProfile'
],
[
5
,
'/manager/account/logOutProfile'
],
[
6
,
'/manager/vps/lookUp'
],
[
7
,
'/manager/vps/edit'
],
[
8
,
'/manager/vps/add'
],
[
9
,
'/manager/vps/logOut'
],
[
10
,
'/manager/tosMoney/lookUp'
],
[
11
,
'/manager/tosMoney/add'
],
[
12
,
'/manager/tosServices/lookUp'
],
[
13
,
'/manager/tosServices/edit'
],
[
14
,
'/manager/tosServices/logOut'
],
[
15
,
'/manager/order/lookUp'
],
[
16
,
'/manager/order/edit'
],
[
17
,
'/manager/contract/lookUp'
],
[
18
,
'/manager/contract/edit'
],
[
19
,
'/manager/contract/add'
],
[
20
,
'/manager/village/lookUp'
],
[
21
,
'/manager/village/edit'
],
[
22
,
'/manager/village/add'
],
[
23
,
'/manager/notice/lookUp'
],
[
24
,
'/manager/notice/edit'
],
[
25
,
'/manager/notice/add'
],
[
26
,
'/manager/visitor/lookUp'
],
[
27
,
'/manager/bookingService/lookUp'
],
[
28
,
'/manager/bookingService/edit'
],
[
29
,
'/manager/bookingService/add'
],
[
30
,
'/manager/backgroundAccount/lookUp'
],
[
31
,
'/manager/backgroundAccount/edit'
],
[
32
,
'/manager/lifeAccount/lookUp'
],
[
33
,
'/manager/lifeAccount/edit'
],
[
34
,
'/manager/lifeAccount/add'
],
[
35
,
'/manager/lifeAccount/logOut'
],
[
36
,
'/manager/lifeAccount/familyMembers/add'
],
[
37
,
'/manager/lifeAccount/familyMembers/logOut'
],
];
var
isLogin
=
false
;
// 权限判断
let
auth
=
false
;
if
(
getCookie
(
'token'
).
length
!=
0
)
{
console
.
log
(
'是否有权限'
);
//
console.log('是否有权限');
isLogin
=
true
;
// console.log(currentUser?.permission);
// console.log(location.pathname);
// const flag = routeAuth.some((v) => {
// return v[1] === location.pathname;
// });
// console.log(flag);
}
const
queryString
=
stringify
({
...
...
@@ -117,10 +69,9 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
return
<
PageLoading
/>;
}
if
(
!
isLogin
&&
window
.
location
.
pathname
!==
'/user/login'
)
{
// message.error('Please Re Login!', 3, () => {
console
.
log
(
'未登录返回登录页!'
);
message
.
error
(
'Please Re Login!'
,
3
);
//
console.log('未登录返回登录页!');
return
<
Redirect
to=
{
`/user/login?${queryString}`
}
/>;
// });
}
return
children
;
}
...
...
src/models/CommunityManagement/CommunityService.ts
View file @
ae9d3590
...
...
@@ -31,6 +31,7 @@ export default {
return
{
...
state
,
CurData
};
},
returnCurDataDetail
(
state
:
object
,
{
CurDataDetail
}:
any
)
{
console
.
log
(
state
);
return
{
...
state
,
CurDataDetail
};
},
returnPage7
(
state
:
object
,
{
Data7
}:
any
)
{
...
...
@@ -70,11 +71,9 @@ export default {
switch
(
playload
.
index
)
{
case
21
:
{
var
tmp
=
resp
.
data
.
rows
[
0
].
tosOwerModel
;
var
tmp2
=
resp
.
data
.
rows
[
0
];
console
.
log
(
resp
.
data
.
rows
[
0
].
replyImgUrl
);
console
.
log
(
Fromate
(
resp
.
data
.
rows
[
0
].
replyImgUrl
,
[[
'url'
,
null
]]));
var
tmp
=
resp
.
data
.
tosOwerModel
;
var
tmp2
=
resp
.
data
;
console
.
log
(
resp
);
var
CurDataDetail
=
{
community
:
tmp
.
communityName
,
address
:
tmp
.
addressAndpostalCode
,
...
...
@@ -82,9 +81,9 @@ export default {
name
:
tmp
.
owerName
,
phone
:
tmp
.
accountLogin
!=
null
?
tmp
.
accountLogin
:
tmp
.
owerPhone
,
email
:
tmp
.
owerEmail
,
content
:
resp
.
data
.
rows
[
0
].
serviceContent
,
replyContent
:
resp
.
data
.
r
ows
[
0
].
r
eplyContent
,
replyImgUrl
:
Fromate
(
resp
.
data
.
r
ows
[
0
].
r
eplyImgUrl
,
[[
'url'
,
null
]]),
content
:
resp
.
data
.
serviceContent
,
replyContent
:
resp
.
data
.
replyContent
,
replyImgUrl
:
Fromate
(
resp
.
data
.
replyImgUrl
,
[[
'url'
,
null
]]),
status
:
tmp2
.
handleStatus
,
pictrues
:
picFromate
(
tmp2
.
imgUrl
),
time
:
timestampToTime4
(
tmp2
.
createTime
.
time
),
...
...
src/models/login.ts
View file @
ae9d3590
...
...
@@ -67,7 +67,7 @@ const Model: LoginModelType = {
console
.
log
(
userMessage
);
console
.
log
(
userMessage
.
token
);
setCookie
(
'token'
,
userMessage
.
token
);
setCookie
(
'permission'
,
userMessage
.
permission
);
localStorage
.
setItem
(
'permission'
,
JSON
.
stringify
(
userMessage
.
permission
)
);
console
.
log
(
'获取到Token:'
+
getCookie
(
'token'
));
yield
put
({
type
:
'saveToken'
,
...
...
src/pages/CommercialService/Card.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
}
from
'antd'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
,
message
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
...
...
@@ -21,7 +21,7 @@ let readyData: any = {
const
module
=
'CommunityService'
;
const
Card
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data7
,
location
}
=
props
;
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const
apply_status
=
[
...
...
@@ -90,6 +90,10 @@ const Card = (props: any) => {
},
[
Data7
]);
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'12'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
,
module
,
dispatch
);
history
.
push
(
'./AccessCardApplication/Detail'
);
};
...
...
src/pages/CommercialService/Detail.tsx
View file @
ae9d3590
...
...
@@ -222,7 +222,9 @@ const Detail = (props: any) => {
</
div
>
</
Spin
>
</>
)
:
null
}
)
:
(
<></>
)
}
</
div
>
);
};
...
...
src/pages/CommercialService/PropertyServices.tsx
View file @
ae9d3590
...
...
@@ -29,6 +29,7 @@ const module = 'CommunityService';
let
pageNum
:
any
=
1
;
const
PropertyServices
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
{
dispatch
,
location
,
Data
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
@@ -74,6 +75,10 @@ const PropertyServices = (props: any) => {
];
const
goToDetail
=
(
value
:
any
,
record
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'12'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
//页面递进
history
.
push
(
location
.
pathname
+
...
...
src/pages/CommercialService/Renovation.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
}
from
'antd'
;
import
{
Input
,
Tabs
,
Table
,
Space
,
Button
,
message
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
...
...
@@ -14,6 +14,7 @@ const module = 'CommunityService';
let
pageNum
:
any
=
1
;
const
Renovation
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const
decoration_status
=
[
[
0
,
'Pending'
],
...
...
@@ -101,6 +102,10 @@ const Renovation = (props: any) => {
};
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'12'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
,
module
,
dispatch
);
history
.
push
(
'./RenovationApplication/Detail?id='
+
values
.
id
);
};
...
...
src/pages/PropertyManagement/ChargeManager.tsx
View file @
ae9d3590
...
...
@@ -35,6 +35,11 @@ const ChargeManager = (props: any) => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
goToDetail
=
(
values
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
if
(
permissionArr
.
indexOf
(
'10'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
getById
(
values
);
history
.
push
(
'/PropertyManagementDetail'
);
};
...
...
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
ae9d3590
...
...
@@ -23,6 +23,8 @@ import {
import
PageData
from
'@/models/Common/PageData'
;
console
.
log
(
'检查是否有权限'
);
const
module
=
'User'
;
const
module2
=
'History'
;
const
module3
=
'PageData'
;
...
...
@@ -40,13 +42,13 @@ let readyData: any = {
owerName
:
''
,
communityArray
:
[],
};
// 节流阀
let
flag
:
boolean
=
false
;
const
Users
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
{
formatMessage
}
=
useIntl
();
const
{
dispatch
,
location
,
Data
,
CommunityList
,
pageData
,
history_url
}
=
props
;
const
SA
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'User/SA'
,
playload
:
values
});
};
...
...
@@ -180,17 +182,29 @@ const Users = (props: any) => {
},
[
Data
]);
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'2'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
);
history
.
push
(
location
.
pathname
+
'/Detail'
);
};
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'3'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
);
URL
({
pathname
:
location
.
pathname
+
'/Edit'
,
status
:
1
},
module2
,
dispatch
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
};
const
goToAdd
=
()
=>
{
if
(
permissionArr
.
indexOf
(
'4'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
URL
({
pathname
:
location
.
pathname
+
'/Add'
,
status
:
1
},
module2
,
dispatch
);
history
.
push
(
location
.
pathname
+
'/Add'
);
};
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
ae9d3590
...
...
@@ -155,6 +155,11 @@ const UsersDetail = (props: any) => {
};
const
deleteUnit
=
(
values
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
));
if
(
permissionArr
.
indexOf
(
'5'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
confirm
({
title
:
'Are you sure delete this infomation?'
,
icon
:
<
ExclamationCircleOutlined
/>,
...
...
src/pages/UserManagement/ServiceProviderManagement/AccoutingContent.tsx
View file @
ae9d3590
...
...
@@ -29,6 +29,11 @@ const AccoutingContent = (props: {
},
[]);
const
handleClick
=
(
id
:
string
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
if
(
permissionArr
.
indexOf
(
'9'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
confirm
({
title
:
'Warning'
,
icon
:
<
ExclamationCircleOutlined
/>,
...
...
src/pages/UserManagement/ServiceProviderManagement/Detail.tsx
View file @
ae9d3590
...
...
@@ -56,6 +56,11 @@ const Detail = (props: any) => {
];
const
handleClick
=
(
id
:
string
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
if
(
permissionArr
.
indexOf
(
'9'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
confirm
({
title
:
'Warning'
,
icon
:
<
ExclamationCircleOutlined
/>,
...
...
@@ -105,7 +110,7 @@ const Detail = (props: any) => {
)
}
<
div
className=
{
styles
.
bigbox
}
>
<
div
className=
{
styles
.
box0
}
>
<
div
className=
{
styles
.
box0item1
}
></
div
>
{
/* <div className={styles.box0item1}></div> */
}
{
/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */
}
</
div
>
<
div
className=
{
styles
.
box1
}
>
...
...
src/pages/UserManagement/ServiceProviderManagement/ServiceProviderManagement.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
Form
,
Input
,
Spin
,
Table
,
Space
,
Button
}
from
'antd'
;
import
{
Form
,
Input
,
Spin
,
Table
,
Space
,
Button
,
message
}
from
'antd'
;
import
{
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
urlEncode
,
filterObj
,
filterObjbyTg
,
RA
}
from
'@/utils/method'
;
...
...
@@ -26,6 +26,8 @@ let readyData: any = {
let
flag
:
boolean
=
false
;
const
ServiceProviderManagement
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
dispatch
,
location
,
Data
,
CommunityList
,
DataServices
}
=
props
;
...
...
@@ -35,6 +37,10 @@ const ServiceProviderManagement = (props: any) => {
};
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'6'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
values
.
serviceScope
=
options
[
values
.
serviceScopeList
[
0
]][
1
];
SaveChooseData
(
values
);
if
(
values
.
serviceScopeList
[
0
]
===
'0'
)
{
...
...
@@ -46,6 +52,10 @@ const ServiceProviderManagement = (props: any) => {
}
};
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'7'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SaveChooseData
(
values
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
// if (values.serviceScopeList[0] === '0') {
...
...
@@ -56,6 +66,10 @@ const ServiceProviderManagement = (props: any) => {
// }
};
const
goToCreate
=
()
=>
{
if
(
permissionArr
.
indexOf
(
'8'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SaveChooseData
(
null
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
};
...
...
src/pages/user/login/index.tsx
View file @
ae9d3590
...
...
@@ -3,7 +3,7 @@ import { Alert, Checkbox, Input, message, Form, Button } from 'antd';
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
{
Link
,
connect
,
Dispatch
,
history
,
Redirect
}
from
'umi'
;
import
{
StateType
}
from
'@/models/login'
;
import
{
LoginParamsType
,
getFakeCaptcha
}
from
'@/services/login'
;
import
{
LoginParamsType
,
getFakeCaptcha
,
getCaptcha
,
ValidateCaptcha
}
from
'@/services/login'
;
import
{
ConnectState
}
from
'@/models/connect'
;
import
styles
from
'./style.less'
;
...
...
@@ -27,16 +27,21 @@ const Login: React.FC<LoginProps> = (props) => {
const
handleSubmit
=
(
values
:
LoginParamsType
)
=>
{
console
.
log
(
values
);
if
(
forgetflag
)
{
console
.
log
(
'验证码!'
);
}
if
(
values
.
userName
&&
values
.
password
)
{
dispatch
({
type
:
'login/login'
,
payload
:
{
...
values
},
});
console
.
log
(
'校验验证码!'
);
// ValidateCaptcha({account,code})
if
(
true
)
{
console
.
log
(
'通过跳转到修改密码页面'
);
history
.
push
(
'login2'
);
}
}
else
{
message
.
error
(
'The username or password cannot be empty!'
);
if
(
values
.
userName
&&
values
.
password
)
{
dispatch
({
type
:
'login/login'
,
payload
:
{
...
values
},
});
}
else
{
message
.
error
(
'The username or password cannot be empty!'
);
}
}
};
...
...
@@ -61,7 +66,7 @@ const Login: React.FC<LoginProps> = (props) => {
/^
[
a-z0-9
]
+
([
._
\\
-
]
*
[
a-z0-9
])
*@
([
a-z0-9
]
+
[
-a-z0-9
]
*
[
a-z0-9
]
+.
){1,63}[
a-z0-9
]
+$/
.
test
(
userName
)
)
{
console
.
log
(
'邮箱正确!'
);
onGetCaptcha
(
'mobile'
);
onGetCaptcha
(
userName
);
}
else
{
message
.
warning
(
'Please enter the correct email address!'
);
}
...
...
@@ -76,10 +81,14 @@ const Login: React.FC<LoginProps> = (props) => {
}
},
[
location
.
pathname
]);
const
onGetCaptcha
=
useCallback
(
async
(
mobile
:
string
)
=>
{
const
result
=
await
getFakeCaptcha
(
mobile
);
// 获取验证码
const
onGetCaptcha
=
useCallback
(
async
(
email
:
string
)
=>
{
// getFakeCaptcha
// getCaptcha
const
result
=
await
getCaptcha
({
account
:
email
});
console
.
log
(
result
);
return
;
if
(
result
===
false
)
{
return
;
}
...
...
@@ -120,8 +129,8 @@ const Login: React.FC<LoginProps> = (props) => {
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter email address'
:
'Account Name'
}
</
div
>
<
Form
.
Item
name=
"userName"
>
<
input
className=
{
styles
.
input
}
defaultValue=
{
userName
||
''
}
onChange=
{
usernameHandle
}
/>
<
Form
.
Item
name=
"userName"
initialValue=
{
userName
||
''
}
>
<
input
className=
{
styles
.
input
}
onChange=
{
usernameHandle
}
/>
</
Form
.
Item
>
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter a verification code'
:
'Password'
}
...
...
src/pages/user/login/login2.tsx
0 → 100644
View file @
ae9d3590
import
React
from
'react'
;
import
{
message
,
Form
,
Input
,
Button
}
from
'antd'
;
import
styles
from
'./style.less'
;
interface
Password
{
password
:
stirng
;
}
const
Login2
=
(
props
:
any
)
=>
{
const
{
history
}
=
props
;
// 修改密码
const
onFinish
=
(
values
:
Password
)
=>
{
console
.
log
(
'修改密码'
);
message
.
success
(
'modify successfully!'
,
3
);
history
.
push
(
'/user/login'
);
};
return
(
<
div
>
<
Form
layout=
"vertical"
onFinish=
{
onFinish
}
requiredMark=
{
false
}
>
<
Form
.
Item
name=
"password"
label=
"Password"
rules=
{
[
{
required
:
true
,
message
:
'Please input your password!'
,
},
]
}
hasFeedback
className=
{
styles
.
passStyle
}
>
<
Input
.
Password
bordered=
{
false
}
/>
</
Form
.
Item
>
<
Form
.
Item
name=
"confirm"
label=
"Confirm Password"
dependencies=
{
[
'password'
]
}
hasFeedback
className=
{
styles
.
passStyle
}
rules=
{
[
{
required
:
true
,
message
:
'Please confirm your password!'
,
},
({
getFieldValue
})
=>
({
validator
(
rule
,
value
)
{
if
(
!
value
||
getFieldValue
(
'password'
)
===
value
)
{
return
Promise
.
resolve
();
}
return
Promise
.
reject
(
'The two passwords that you entered do not match!'
);
},
}),
]
}
>
<
Input
.
Password
bordered=
{
false
}
/>
</
Form
.
Item
>
<
Form
.
Item
className=
{
styles
.
passBtn
}
>
<
Button
size=
"large"
type=
"primary"
shape=
"round"
htmlType=
{
'submit'
}
>
Accomplish
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
export
default
Login2
;
src/pages/user/login/style.less
View file @
ae9d3590
...
...
@@ -38,92 +38,121 @@
}
}
.box1{
font-size:20px;
font-family:
"PingFang SC"
;
font-weight:800;
color:
rgba(129,152,177,
1);
.box1
{
font-size:
20px;
font-family:
'PingFang SC'
;
font-weight:
800;
color:
rgba(129, 152, 177,
1);
margin-bottom: 20px;
}
.input{
border:none;
background:none;
.input
{
border:
none;
background:
none;
outline: none;
border-bottom: 1px solid rgba(78,
80,105,
1);
width:330px;
border-bottom: 1px solid rgba(78,
80, 105,
1);
width:
330px;
margin-bottom: 20px;
font-size:20px;
font-family:
"PingFang SC"
;
font-weight:800;
color:
rgba(0,26,84,
1);
font-size:
20px;
font-family:
'PingFang SC'
;
font-weight:
800;
color:
rgba(0, 26, 84,
1);
}
.input2{
border:none;
background:none;
.input2
{
border:
none;
background:
none;
outline: none;
border-bottom: 1px solid rgba(78,
80,105,
1);
width:330px;
font-size:20px;
font-family:
"PingFang SC"
;
font-weight:800;
color:
rgba(0,26,84,
1);
border-bottom: 1px solid rgba(78,
80, 105,
1);
width:
330px;
font-size:
20px;
font-family:
'PingFang SC'
;
font-weight:
800;
color:
rgba(0, 26, 84,
1);
}
.input3{
.input3
{
cursor: pointer;
font-size:20px;
font-family:
"PingFang SC"
;
font-weight:800;
color:
rgba(0,26,84,
1);
opacity:0.3;
font-size:
20px;
font-family:
'PingFang SC'
;
font-weight:
800;
color:
rgba(0, 26, 84,
1);
opacity:
0.3;
}
.input4{
width:400px;
height:20px;
font-size:20px;
font-family:PingFang SC;
font-weight:800;
color:
rgba(255,56,56,
1);
.input4
{
width:
400px;
height:
20px;
font-size:
20px;
font-family:
PingFang SC;
font-weight:
800;
color:
rgba(255, 56, 56,
1);
}
.button{
width:100px;
height:51px;
background:
rgba(64,101,224,
1);
border-radius:26px;
.button
{
width:
100px;
height:
51px;
background:
rgba(64, 101, 224,
1);
border-radius:
26px;
border: none;
}
.input5{
border:none;
background:none;
.input5
{
border:
none;
background:
none;
outline: none;
border-bottom: 1px solid rgba(78,
80,105,
1);
width:176px;
font-size:20px;
font-family:
"PingFang SC"
;
font-weight:800;
color:
rgba(0,26,84,
1);
border-bottom: 1px solid rgba(78,
80, 105,
1);
width:
176px;
font-size:
20px;
font-family:
'PingFang SC'
;
font-weight:
800;
color:
rgba(0, 26, 84,
1);
}
.button2{
.button2
{
width: 120px;
height: 34px;
border-radius:26px;
background:none;
border: 1px solid rgba(78,
80,105,
1);
border-radius:
26px;
background:
none;
border: 1px solid rgba(78,
80, 105,
1);
line-height: 34px;
text-align: center;
position: absolute;
cursor: pointer;
top:0;
top:
0;
left: 196px;
font-size:20px;
font-family:"PingFang SC";
font-weight:800;
color:rgba(0,26,84,1);
font-size: 20px;
font-family: 'PingFang SC';
font-weight: 800;
color: rgba(0, 26, 84, 1);
}
.box2{
.box2
{
width: 100%;
height: 34px;
position: relative;
margin-bottom: 45px;
}
\ No newline at end of file
}
.passStyle {
:global {
.ant-form-item-required {
font-size: 20px;
font-family: 'PingFang SC';
font-weight: 800;
color: rgba(129, 152, 177, 1);
}
.ant-form-item-control-input {
width: 330px;
border-bottom: 1px solid rgba(78, 80, 105, 1);
box-shadow: none;
}
.ant-input-affix-wrapper-focused {
box-shadow: none;
}
}
}
.passBtn {
:global {
.ant-btn {
width: 330px;
height: 51px;
font-size: 20px;
}
}
}
src/pages/user/login2/index.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
Input
,
Menu
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
}
from
'antd'
;
import
{
Input
,
Menu
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
const
Login2
=
()
=>
{
return
(
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
box
}
>
<
div
>
please input a password
</
div
>
<
input
type=
"password"
className=
{
styles
.
input
}
placeholder=
""
/>
<
div
className=
{
styles
.
item1
}
>
<
Button
type=
"primary"
className=
{
styles
.
item2
}
>
提交
</
Button
>
<
Button
type=
"primary"
className=
{
styles
.
item2
}
>
提交
</
Button
>
</
div
>
</
div
>
</
div
>
);
};
export
default
Login2
;
src/services/login.ts
View file @
ae9d3590
...
...
@@ -4,7 +4,10 @@ export interface LoginParamsType {
userName
:
string
;
password
:
string
;
}
export
interface
CodeType
{
account
:
string
;
code
:
string
;
}
// export async function fakeAccountLogin(params: LoginParamsType) {
// return request('/api/login/account', {
// method: 'POST',
...
...
@@ -12,10 +15,6 @@ export interface LoginParamsType {
// });
// }
export
async
function
getFakeCaptcha
(
mobile
:
string
)
{
return
request
(
`/api/login/captcha?mobile=
${
mobile
}
`
);
}
export
async
function
AccountLogin
(
params
:
LoginParamsType
)
{
console
.
log
(
'登录请求'
);
console
.
log
(
params
);
...
...
@@ -35,3 +34,19 @@ export async function AccountCheckLogin(params: LoginCheckParamsType) {
console
.
log
(
'登录确认请求'
);
return
request
(
'/tos/user/newCurrentUser'
,
{
method
:
'POST'
,
data
:
params
});
}
export
async
function
getFakeCaptcha
(
mobile
:
string
)
{
return
request
(
`/api/login/captcha?mobile=
${
mobile
}
`
);
}
export
async
function
getCaptcha
(
email
:
object
)
{
console
.
log
(
'获取验证码'
);
console
.
log
(
email
);
return
request
(
'/tos/send/code'
,
{
method
:
'POST'
,
data
:
email
});
}
export
async
function
ValidateCaptcha
(
params
:
CodeType
)
{
console
.
log
(
'校验验证码'
);
console
.
log
(
params
);
return
request
(
'/tos/validate/code'
,
{
method
:
'POST'
,
data
:
params
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment