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
d411c48b
Commit
d411c48b
authored
Nov 02, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LIFE用户管理模块测试bug处理
parent
03026ae7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
144 additions
and
104 deletions
+144
-104
User.ts
src/models/CommunityManagement/User.ts
+6
-4
CardAdd.tsx
src/pages/CommercialService/CardAdd.tsx
+1
-3
ChargeManager.tsx
src/pages/PropertyManagement/ChargeManager.tsx
+0
-1
Users.tsx
src/pages/UserManagement/LIFEUserManagement/Users.tsx
+2
-1
UsersAdd.tsx
src/pages/UserManagement/LIFEUserManagement/UsersAdd.tsx
+1
-3
UsersDetail.tsx
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
+13
-8
Template.tsx
src/pages/runTest/Template.tsx
+20
-46
index.tsx
src/pages/user/login/index.tsx
+101
-38
No files found.
src/models/CommunityManagement/User.ts
View file @
d411c48b
...
...
@@ -114,10 +114,12 @@ export default {
}
break
;
// 删除失败的案例
// case 16:{
// Result = resp;
// yield put({ type: 'returnResult', Result });
// } break;
case
16
:
{
Result
=
resp
;
yield
put
({
type
:
'returnResult'
,
Result
});
}
break
;
}
}
else
{
switch
(
playload
.
index
)
{
...
...
src/pages/CommercialService/CardAdd.tsx
View file @
d411c48b
...
...
@@ -57,9 +57,7 @@ const CardAdd = (props: any) => {
if
(
communityInfo
!=
null
)
{
form
.
setFieldsValue
({
zipCode
:
communityInfo
.
data
.
rows
.
residentialAddress
+
' SINGAPORE'
+
communityInfo
.
data
.
rows
.
residentialZipCode
,
communityInfo
.
data
.
rows
.
residentialAddress
+
communityInfo
.
data
.
rows
.
residentialZipCode
,
});
}
},
[
communityInfo
]);
...
...
src/pages/PropertyManagement/ChargeManager.tsx
View file @
d411c48b
...
...
@@ -27,7 +27,6 @@ const ChargeManager = (props: any) => {
const
unit
=
formatMessage
({
id
:
'R.charge.unit'
});
const
submissionTime
=
formatMessage
({
id
:
'R.charge.submissionTime'
});
const
actions
=
formatMessage
({
id
:
'R.charge.actions'
});
const
addaccount
=
formatMessage
({
id
:
'R.charge.addaccount'
});
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
d411c48b
...
...
@@ -132,6 +132,7 @@ const Users = (props: any) => {
// 监听路由变化更新数据
useEffect
(()
=>
{
console
.
log
(
readyData
);
if
(
location
.
query
)
{
readyData
=
{
...
readyData
,
...
...
@@ -262,7 +263,7 @@ const Users = (props: any) => {
pagination=
{
Data
!=
null
?
{
current
:
readyData
.
pageNum
,
defaultCurrent
:
parseInt
(
readyData
.
pageNum
)
,
total
:
Data
.
data
.
page
.
totalRow
,
showSizeChanger
:
false
,
pageSize
:
Data
.
data
.
page
.
curPageSize
,
...
...
src/pages/UserManagement/LIFEUserManagement/UsersAdd.tsx
View file @
d411c48b
...
...
@@ -46,9 +46,7 @@ const UsersAdd = (props: any) => {
if
(
postman
.
extend
!=
null
)
{
formRef
.
current
.
setFieldsValue
({
addressAndpostalCode
:
communityInfo
.
data
.
rows
.
residentialAddress
+
' SINGAPORE'
+
communityInfo
.
data
.
rows
.
residentialZipCode
,
communityInfo
.
data
.
rows
.
residentialAddress
+
communityInfo
.
data
.
rows
.
residentialZipCode
,
});
}
}
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
d411c48b
...
...
@@ -94,13 +94,18 @@ const UsersDetail = (props: any) => {
},
[
Result
]);
useEffect
(()
=>
{
console
.
log
(
returnValue
);
if
(
returnValue
!=
null
)
{
message
.
success
(
'Delete Successfully!'
);
RA
(
13
,
{
id
:
DataSave
.
id
,
owerName
:
DataSave
.
owerName
,
enable
:
DataSave
.
enable
,
});
if
(
returnValue
.
error_code
!==
'0001'
)
{
message
.
success
(
'Delete Successfully!'
,
3
);
RA
(
13
,
{
id
:
DataSave
.
id
,
owerName
:
DataSave
.
owerName
,
enable
:
DataSave
.
enable
,
});
}
else
{
message
.
error
(
returnValue
.
error_msg
,
3
);
}
}
},
[
returnValue
]);
...
...
@@ -192,10 +197,10 @@ const UsersDetail = (props: any) => {
const
checkData
=
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
value
)
{
if
(
/^
\d{11
}
$/g
.
test
(
value
))
{
if
(
/^
1
\d{7}
|1
[
3|5|7|8
]\d{9
}
$/g
.
test
(
value
))
{
callback
();
}
else
{
callback
(
new
Error
(
'
Please enter the correct cell
phone number!'
));
callback
(
new
Error
(
'
Incorrect format of mobile
phone number!'
));
}
}
callback
(
'*it is required!'
);
...
...
src/pages/runTest/Template.tsx
View file @
d411c48b
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
Input
,
Menu
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
,
Form
,
Upload
}
from
'antd'
;
import
{
Input
,
Menu
,
Table
,
Space
,
Pagination
,
Tooltip
,
Button
,
Form
,
Upload
}
from
'antd'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
...
...
@@ -12,62 +12,36 @@ import TableShow from '../../components/TableShow/TableShow';
import
{
getCookie
}
from
'@/utils/method'
;
import
PictureOptions
from
'@/components/PictureOptions/PictureOptions'
;
const
Guard
=
(
props
:
any
)
=>
{
const
Guard
=
(
props
:
any
)
=>
{
const
{
dispatch
,
CommunityList
,
token
}
=
props
;
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
});
};
// const [page, setPage] = useState({ token: '' });
const
{
dispatch
,
CommunityList
,
token
}
=
props
;
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
})
};
const
[
page
,
setPage
]
=
useState
({
token
:
""
})
useEffect
(()
=>
{
tosCommunityget
(
null
)
setPage
({
token
:
getCookie
(
"token"
)
});
},
[]);
tosCommunityget
(
null
)
;
// setPage({ token: getCookie('token'
) });
},
[]);
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
)
}
const
uploadButton
=
(
<
div
>
<
div
className=
"ant-upload-text"
>
Upload
</
div
>
</
div
>
);
return
(
<
div
className=
{
styles
.
base
}
>
<
TitleGet
title=
{
"Version 1.2.4"
}
/>
<
p
>
token:
{
page
.
token
}
name:
{
getCookie
(
"name"
)
}
phone:
{
getCookie
(
"phone"
)
}
</
p
>
{
/* <Form name="basic" onFinish={onFinish}>
<Form.Item name="">
<PictureOptions
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: "extend",
}} />
</Form.Item>
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form> */
}
{
/* <TableShow /> */
}
{
/* <div>{token}</div>
<Line /> */
}
<
TitleGet
title=
{
'Version 1.2.4'
}
/>
{
/* <p>
token:{page.token}
name:{getCookie('name')}
phone:{getCookie('phone')}
</p> */
}
</
div
>
);
};
function
mapStateToProps
(
state
:
any
)
{
const
{
CommunityList
}
=
state
.
Init
;
const
{
token
}
=
state
.
login
;
function
mapStateToProps
(
state
:
any
)
{
const
{
CommunityList
}
=
state
.
Init
;
const
{
token
}
=
state
.
login
;
return
{
CommunityList
,
token
token
,
};
}
...
...
src/pages/user/login/index.tsx
View file @
d411c48b
...
...
@@ -4,7 +4,7 @@ import {
WeiboCircleOutlined
,
ArrowLeftOutlined
,
}
from
'@ant-design/icons'
;
import
{
Alert
,
Checkbox
,
Input
}
from
'antd'
;
import
{
Alert
,
Checkbox
,
Input
,
message
,
Form
,
Button
}
from
'antd'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Link
,
connect
,
Dispatch
,
history
,
Redirect
}
from
'umi'
;
import
{
StateType
}
from
'@/models/login'
;
...
...
@@ -27,22 +27,31 @@ const Login: React.FC<LoginProps> = (props) => {
const
{
status
,
type
:
loginType
}
=
userLogin
;
const
[
type
,
setType
]
=
useState
<
string
>
(
'account'
);
const
[
userName
,
setUsername
]
=
useState
(
''
);
const
[
password
,
setPasswd
]
=
useState
(
''
);
// const [userName, setUsername] = useState('');
// const [password, setPasswd] = useState('');
const
[
forgetflag
,
setForgetFlag
]
=
useState
(
false
);
const
{
dispatch
}
=
props
;
const
handleSubmit
=
(
values
:
LoginParamsType
)
=>
{
const
{
dispatch
}
=
props
;
dispatch
({
type
:
'login/login'
,
payload
:
{
userName
,
password
},
});
};
const
usernameHandle
=
(
e
:
any
)
=>
{
setUsername
(
e
.
target
.
value
);
};
const
passwdHandle
=
(
e
:
any
)
=>
{
setPasswd
(
e
.
target
.
value
);
console
.
log
(
values
);
if
(
forgetflag
)
{
console
.
log
(
'验证码!'
);
}
if
(
values
.
userName
!==
''
&&
values
.
password
!==
''
)
{
dispatch
({
type
:
'login/login'
,
payload
:
{
...
values
},
});
}
else
{
message
.
error
(
'The username or password cannot be empty!'
);
}
};
// const usernameHandle = (e: any) => {
// setUsername(e.target.value);
// };
// const passwdHandle = (e: any) => {
// setPasswd(e.target.value);
// };
const
returnHandle
=
(
e
:
any
)
=>
{
history
.
push
(
'/user/login'
);
...
...
@@ -52,20 +61,18 @@ const Login: React.FC<LoginProps> = (props) => {
};
const
handleSend
=
(
e
:
any
)
=>
{
console
.
log
(
'触发了发送事件'
,
e
);
console
.
log
(
password
);
console
.
log
(
userName
);
if
(
password
!==
''
&&
/^
[
a-z0-9
]
+
([
._
\\
-
]
*
[
a-z0-9
])
*@
([
a-z0-9
]
+
[
-a-z0-9
]
*
[
a-z0-9
]
+.
){1,63}[
a-z0-9
]
+$/
.
test
(
password
)
userName
!==
''
&&
/^
[
a-z0-9
]
+
([
._
\\
-
]
*
[
a-z0-9
])
*@
([
a-z0-9
]
+
[
-a-z0-9
]
*
[
a-z0-9
]
+.
){1,63}[
a-z0-9
]
+$/
.
test
(
userName
)
)
{
console
.
log
(
'邮箱正确!'
);
console
.
log
(
Captcha
);
}
else
{
console
.
log
(
'邮箱格式错误
!'
);
message
.
warning
(
'Please enter the correct email address
!'
);
}
};
const
{
location
}
=
props
;
const
[
forgetflag
,
setForgetFlag
]
=
useState
(
false
);
useEffect
(()
=>
{
if
(
location
.
pathname
==
'/user/forget'
)
{
setForgetFlag
(
true
);
...
...
@@ -76,17 +83,21 @@ const Login: React.FC<LoginProps> = (props) => {
return
(
<
div
>
{
forgetflag
?
(
{
/* {
forgetflag ? (
<div style={{ position: 'absolute', top: -50, cursor: 'pointer' }} onClick={returnHandle}>
<ArrowLeftOutlined style={{ fontSize: '28px' }} />
</div>
) : (
<
div
/>
)
}
<div />
)}
<LoginForm activeKey={type} onTabChange={setType} onSubmit={handleSubmit}>
<
div
className=
{
styles
.
box1
}
>
Account Number
</
div
>
<div className={styles.box1}>
{forgetflag ? 'Please enter email address' : 'Account Name'}
</div>
<input className={styles.input} onChange={usernameHandle} />
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter email address'
:
'Password'
}
</
div
>
<div className={styles.box1}>
{forgetflag ? 'Please enter a verification code' : 'Password'}
</div>
{forgetflag ? (
<div className={styles.box2}>
<input className={styles.input5} onChange={passwdHandle} />
...
...
@@ -95,24 +106,76 @@ const Login: React.FC<LoginProps> = (props) => {
</div>
</div>
) : (
<div>
<input className={styles.input2} onChange={passwdHandle} type="password" />
<div>
<
input
className=
{
styles
.
input2
}
onChange=
{
passwdHandle
}
type=
"password"
/>
<
div
>
<
div
className=
{
styles
.
input3
}
onClick=
{
gotoForgetHandle
}
>
Forget Password
<div className={styles.input3} onClick={gotoForgetHandle}>
Forget Password
</div>
<
div
className=
{
styles
.
input4
}
>
{
status
===
'error'
&&
loginType
===
'account'
&&
!
submitting
&&
(
<
div
>
Wrong account or password
</
div
>
)
}
</
div
>
<div className={styles.input4}>
{status === 'error' && loginType === 'account' && !submitting && (
<div>Wrong account or password</div>
)}
</div>
</div>
)
}
</div>
)}
<Submit className={styles.button} loading={submitting} style={{ width: 330 }}>
{forgetflag ? 'Next' : '登录'}
</Submit>
</
LoginForm
>
</LoginForm> */
}
{
forgetflag
?
(
<
div
style=
{
{
position
:
'absolute'
,
top
:
-
50
,
cursor
:
'pointer'
}
}
onClick=
{
returnHandle
}
>
<
ArrowLeftOutlined
style=
{
{
fontSize
:
'28px'
}
}
/>
</
div
>
)
:
(
<
div
/>
)
}
<
Form
onFinish=
{
handleSubmit
}
>
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter email address'
:
'Account Name'
}
</
div
>
<
Form
.
Item
name=
"userName"
>
<
input
className=
{
styles
.
input
}
/>
</
Form
.
Item
>
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter a verification code'
:
'Password'
}
</
div
>
{
forgetflag
?
(
<
div
className=
{
styles
.
box2
}
>
<
input
className=
{
styles
.
input5
}
/>
<
div
className=
{
styles
.
button2
}
style=
{
{
float
:
'right'
}
}
onClick=
{
handleSend
}
>
Send
</
div
>
</
div
>
)
:
(
<
div
>
<
Form
.
Item
name=
"password"
>
<
input
className=
{
styles
.
input2
}
type=
"password"
/>
</
Form
.
Item
>
<
div
>
<
div
className=
{
styles
.
input3
}
onClick=
{
gotoForgetHandle
}
>
Forget Password
</
div
>
<
div
className=
{
styles
.
input4
}
>
{
status
===
'error'
&&
loginType
===
'account'
&&
!
submitting
&&
(
<
div
>
Wrong account or password
</
div
>
)
}
</
div
>
</
div
>
</
div
>
)
}
<
Form
.
Item
>
<
Button
style=
{
{
width
:
330
,
height
:
50
,
fontSize
:
20
}
}
type=
"primary"
htmlType=
"submit"
shape=
"round"
>
{
forgetflag
?
'Next'
:
'Submit'
}
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
...
...
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