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({
...
@@ -48,6 +48,11 @@ export default defineConfig({
path
:
'/user/forget'
,
path
:
'/user/forget'
,
component
:
'./user/login'
,
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
...
@@ -53,59 +53,11 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// const isLogin = currentUser && currentUser.name;//isLogin为关键点
// 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
;
var
isLogin
=
false
;
// 权限判断
let
auth
=
false
;
if
(
getCookie
(
'token'
).
length
!=
0
)
{
if
(
getCookie
(
'token'
).
length
!=
0
)
{
console
.
log
(
'是否有权限'
);
//
console.log('是否有权限');
isLogin
=
true
;
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
({
const
queryString
=
stringify
({
...
@@ -117,10 +69,9 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
...
@@ -117,10 +69,9 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
return
<
PageLoading
/>;
return
<
PageLoading
/>;
}
}
if
(
!
isLogin
&&
window
.
location
.
pathname
!==
'/user/login'
)
{
if
(
!
isLogin
&&
window
.
location
.
pathname
!==
'/user/login'
)
{
// message.error('Please Re Login!', 3, () => {
message
.
error
(
'Please Re Login!'
,
3
);
console
.
log
(
'未登录返回登录页!'
);
//
console.log('未登录返回登录页!');
return
<
Redirect
to=
{
`/user/login?${queryString}`
}
/>;
return
<
Redirect
to=
{
`/user/login?${queryString}`
}
/>;
// });
}
}
return
children
;
return
children
;
}
}
...
...
src/models/CommunityManagement/CommunityService.ts
View file @
ae9d3590
...
@@ -31,6 +31,7 @@ export default {
...
@@ -31,6 +31,7 @@ export default {
return
{
...
state
,
CurData
};
return
{
...
state
,
CurData
};
},
},
returnCurDataDetail
(
state
:
object
,
{
CurDataDetail
}:
any
)
{
returnCurDataDetail
(
state
:
object
,
{
CurDataDetail
}:
any
)
{
console
.
log
(
state
);
return
{
...
state
,
CurDataDetail
};
return
{
...
state
,
CurDataDetail
};
},
},
returnPage7
(
state
:
object
,
{
Data7
}:
any
)
{
returnPage7
(
state
:
object
,
{
Data7
}:
any
)
{
...
@@ -70,11 +71,9 @@ export default {
...
@@ -70,11 +71,9 @@ export default {
switch
(
playload
.
index
)
{
switch
(
playload
.
index
)
{
case
21
:
case
21
:
{
{
var
tmp
=
resp
.
data
.
rows
[
0
].
tosOwerModel
;
var
tmp
=
resp
.
data
.
tosOwerModel
;
var
tmp2
=
resp
.
data
.
rows
[
0
];
var
tmp2
=
resp
.
data
;
console
.
log
(
resp
);
console
.
log
(
resp
.
data
.
rows
[
0
].
replyImgUrl
);
console
.
log
(
Fromate
(
resp
.
data
.
rows
[
0
].
replyImgUrl
,
[[
'url'
,
null
]]));
var
CurDataDetail
=
{
var
CurDataDetail
=
{
community
:
tmp
.
communityName
,
community
:
tmp
.
communityName
,
address
:
tmp
.
addressAndpostalCode
,
address
:
tmp
.
addressAndpostalCode
,
...
@@ -82,9 +81,9 @@ export default {
...
@@ -82,9 +81,9 @@ export default {
name
:
tmp
.
owerName
,
name
:
tmp
.
owerName
,
phone
:
tmp
.
accountLogin
!=
null
?
tmp
.
accountLogin
:
tmp
.
owerPhone
,
phone
:
tmp
.
accountLogin
!=
null
?
tmp
.
accountLogin
:
tmp
.
owerPhone
,
email
:
tmp
.
owerEmail
,
email
:
tmp
.
owerEmail
,
content
:
resp
.
data
.
rows
[
0
].
serviceContent
,
content
:
resp
.
data
.
serviceContent
,
replyContent
:
resp
.
data
.
r
ows
[
0
].
r
eplyContent
,
replyContent
:
resp
.
data
.
replyContent
,
replyImgUrl
:
Fromate
(
resp
.
data
.
r
ows
[
0
].
r
eplyImgUrl
,
[[
'url'
,
null
]]),
replyImgUrl
:
Fromate
(
resp
.
data
.
replyImgUrl
,
[[
'url'
,
null
]]),
status
:
tmp2
.
handleStatus
,
status
:
tmp2
.
handleStatus
,
pictrues
:
picFromate
(
tmp2
.
imgUrl
),
pictrues
:
picFromate
(
tmp2
.
imgUrl
),
time
:
timestampToTime4
(
tmp2
.
createTime
.
time
),
time
:
timestampToTime4
(
tmp2
.
createTime
.
time
),
...
...
src/models/login.ts
View file @
ae9d3590
...
@@ -67,7 +67,7 @@ const Model: LoginModelType = {
...
@@ -67,7 +67,7 @@ const Model: LoginModelType = {
console
.
log
(
userMessage
);
console
.
log
(
userMessage
);
console
.
log
(
userMessage
.
token
);
console
.
log
(
userMessage
.
token
);
setCookie
(
'token'
,
userMessage
.
token
);
setCookie
(
'token'
,
userMessage
.
token
);
setCookie
(
'permission'
,
userMessage
.
permission
);
localStorage
.
setItem
(
'permission'
,
JSON
.
stringify
(
userMessage
.
permission
)
);
console
.
log
(
'获取到Token:'
+
getCookie
(
'token'
));
console
.
log
(
'获取到Token:'
+
getCookie
(
'token'
));
yield
put
({
yield
put
({
type
:
'saveToken'
,
type
:
'saveToken'
,
...
...
src/pages/CommercialService/Card.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
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
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
...
@@ -21,7 +21,7 @@ let readyData: any = {
...
@@ -21,7 +21,7 @@ let readyData: any = {
const
module
=
'CommunityService'
;
const
module
=
'CommunityService'
;
const
Card
=
(
props
:
any
)
=>
{
const
Card
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data7
,
location
}
=
props
;
const
{
dispatch
,
Data7
,
location
}
=
props
;
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const
apply_status
=
[
const
apply_status
=
[
...
@@ -90,6 +90,10 @@ const Card = (props: any) => {
...
@@ -90,6 +90,10 @@ const Card = (props: any) => {
},
[
Data7
]);
},
[
Data7
]);
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'12'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
,
module
,
dispatch
);
SA
(
values
,
module
,
dispatch
);
history
.
push
(
'./AccessCardApplication/Detail'
);
history
.
push
(
'./AccessCardApplication/Detail'
);
};
};
...
...
src/pages/CommercialService/Detail.tsx
View file @
ae9d3590
...
@@ -222,7 +222,9 @@ const Detail = (props: any) => {
...
@@ -222,7 +222,9 @@ const Detail = (props: any) => {
</
div
>
</
div
>
</
Spin
>
</
Spin
>
</>
</>
)
:
null
}
)
:
(
<></>
)
}
</
div
>
</
div
>
);
);
};
};
...
...
src/pages/CommercialService/PropertyServices.tsx
View file @
ae9d3590
...
@@ -29,6 +29,7 @@ const module = 'CommunityService';
...
@@ -29,6 +29,7 @@ const module = 'CommunityService';
let
pageNum
:
any
=
1
;
let
pageNum
:
any
=
1
;
const
PropertyServices
=
(
props
:
any
)
=>
{
const
PropertyServices
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
{
dispatch
,
location
,
Data
}
=
props
;
const
{
dispatch
,
location
,
Data
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
@@ -74,6 +75,10 @@ const PropertyServices = (props: any) => {
...
@@ -74,6 +75,10 @@ const PropertyServices = (props: any) => {
];
];
const
goToDetail
=
(
value
:
any
,
record
:
any
,
e
:
any
)
=>
{
const
goToDetail
=
(
value
:
any
,
record
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'12'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
//页面递进
//页面递进
history
.
push
(
history
.
push
(
location
.
pathname
+
location
.
pathname
+
...
...
src/pages/CommercialService/Renovation.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
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
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
connect
,
history
}
from
'umi'
;
...
@@ -14,6 +14,7 @@ const module = 'CommunityService';
...
@@ -14,6 +14,7 @@ const module = 'CommunityService';
let
pageNum
:
any
=
1
;
let
pageNum
:
any
=
1
;
const
Renovation
=
(
props
:
any
)
=>
{
const
Renovation
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const
decoration_status
=
[
const
decoration_status
=
[
[
0
,
'Pending'
],
[
0
,
'Pending'
],
...
@@ -101,6 +102,10 @@ const Renovation = (props: any) => {
...
@@ -101,6 +102,10 @@ const Renovation = (props: any) => {
};
};
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'12'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
,
module
,
dispatch
);
SA
(
values
,
module
,
dispatch
);
history
.
push
(
'./RenovationApplication/Detail?id='
+
values
.
id
);
history
.
push
(
'./RenovationApplication/Detail?id='
+
values
.
id
);
};
};
...
...
src/pages/PropertyManagement/ChargeManager.tsx
View file @
ae9d3590
...
@@ -35,6 +35,11 @@ const ChargeManager = (props: any) => {
...
@@ -35,6 +35,11 @@ const ChargeManager = (props: any) => {
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
goToDetail
=
(
values
:
any
)
=>
{
const
goToDetail
=
(
values
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
if
(
permissionArr
.
indexOf
(
'10'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
getById
(
values
);
getById
(
values
);
history
.
push
(
'/PropertyManagementDetail'
);
history
.
push
(
'/PropertyManagementDetail'
);
};
};
...
...
src/pages/UserManagement/LIFEUserManagement/Users.tsx
View file @
ae9d3590
...
@@ -23,6 +23,8 @@ import {
...
@@ -23,6 +23,8 @@ import {
import
PageData
from
'@/models/Common/PageData'
;
import
PageData
from
'@/models/Common/PageData'
;
console
.
log
(
'检查是否有权限'
);
const
module
=
'User'
;
const
module
=
'User'
;
const
module2
=
'History'
;
const
module2
=
'History'
;
const
module3
=
'PageData'
;
const
module3
=
'PageData'
;
...
@@ -40,13 +42,13 @@ let readyData: any = {
...
@@ -40,13 +42,13 @@ let readyData: any = {
owerName
:
''
,
owerName
:
''
,
communityArray
:
[],
communityArray
:
[],
};
};
// 节流阀
// 节流阀
let
flag
:
boolean
=
false
;
let
flag
:
boolean
=
false
;
const
Users
=
(
props
:
any
)
=>
{
const
Users
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
{
formatMessage
}
=
useIntl
();
const
{
formatMessage
}
=
useIntl
();
const
{
dispatch
,
location
,
Data
,
CommunityList
,
pageData
,
history_url
}
=
props
;
const
{
dispatch
,
location
,
Data
,
CommunityList
,
pageData
,
history_url
}
=
props
;
const
SA
=
(
values
:
any
)
=>
{
const
SA
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'User/SA'
,
playload
:
values
});
dispatch
({
type
:
'User/SA'
,
playload
:
values
});
};
};
...
@@ -180,17 +182,29 @@ const Users = (props: any) => {
...
@@ -180,17 +182,29 @@ const Users = (props: any) => {
},
[
Data
]);
},
[
Data
]);
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
const
goToDetail
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'2'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
);
SA
(
values
);
history
.
push
(
location
.
pathname
+
'/Detail'
);
history
.
push
(
location
.
pathname
+
'/Detail'
);
};
};
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'3'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SA
(
values
);
SA
(
values
);
URL
({
pathname
:
location
.
pathname
+
'/Edit'
,
status
:
1
},
module2
,
dispatch
);
URL
({
pathname
:
location
.
pathname
+
'/Edit'
,
status
:
1
},
module2
,
dispatch
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
};
};
const
goToAdd
=
()
=>
{
const
goToAdd
=
()
=>
{
if
(
permissionArr
.
indexOf
(
'4'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
URL
({
pathname
:
location
.
pathname
+
'/Add'
,
status
:
1
},
module2
,
dispatch
);
URL
({
pathname
:
location
.
pathname
+
'/Add'
,
status
:
1
},
module2
,
dispatch
);
history
.
push
(
location
.
pathname
+
'/Add'
);
history
.
push
(
location
.
pathname
+
'/Add'
);
};
};
...
...
src/pages/UserManagement/LIFEUserManagement/UsersDetail.tsx
View file @
ae9d3590
...
@@ -155,6 +155,11 @@ const UsersDetail = (props: any) => {
...
@@ -155,6 +155,11 @@ const UsersDetail = (props: any) => {
};
};
const
deleteUnit
=
(
values
:
any
)
=>
{
const
deleteUnit
=
(
values
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
));
if
(
permissionArr
.
indexOf
(
'5'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
confirm
({
confirm
({
title
:
'Are you sure delete this infomation?'
,
title
:
'Are you sure delete this infomation?'
,
icon
:
<
ExclamationCircleOutlined
/>,
icon
:
<
ExclamationCircleOutlined
/>,
...
...
src/pages/UserManagement/ServiceProviderManagement/AccoutingContent.tsx
View file @
ae9d3590
...
@@ -29,6 +29,11 @@ const AccoutingContent = (props: {
...
@@ -29,6 +29,11 @@ const AccoutingContent = (props: {
},
[]);
},
[]);
const
handleClick
=
(
id
:
string
)
=>
{
const
handleClick
=
(
id
:
string
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
if
(
permissionArr
.
indexOf
(
'9'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
confirm
({
confirm
({
title
:
'Warning'
,
title
:
'Warning'
,
icon
:
<
ExclamationCircleOutlined
/>,
icon
:
<
ExclamationCircleOutlined
/>,
...
...
src/pages/UserManagement/ServiceProviderManagement/Detail.tsx
View file @
ae9d3590
...
@@ -56,6 +56,11 @@ const Detail = (props: any) => {
...
@@ -56,6 +56,11 @@ const Detail = (props: any) => {
];
];
const
handleClick
=
(
id
:
string
)
=>
{
const
handleClick
=
(
id
:
string
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
if
(
permissionArr
.
indexOf
(
'9'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
confirm
({
confirm
({
title
:
'Warning'
,
title
:
'Warning'
,
icon
:
<
ExclamationCircleOutlined
/>,
icon
:
<
ExclamationCircleOutlined
/>,
...
@@ -105,7 +110,7 @@ const Detail = (props: any) => {
...
@@ -105,7 +110,7 @@ const Detail = (props: any) => {
)
}
)
}
<
div
className=
{
styles
.
bigbox
}
>
<
div
className=
{
styles
.
bigbox
}
>
<
div
className=
{
styles
.
box0
}
>
<
div
className=
{
styles
.
box0
}
>
<
div
className=
{
styles
.
box0item1
}
></
div
>
{
/* <div className={styles.box0item1}></div> */
}
{
/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */
}
{
/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */
}
</
div
>
</
div
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1
}
>
...
...
src/pages/UserManagement/ServiceProviderManagement/ServiceProviderManagement.tsx
View file @
ae9d3590
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
styles
from
'./index.less'
;
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
{
LoadingOutlined
}
from
'@ant-design/icons'
;
import
{
urlEncode
,
filterObj
,
filterObjbyTg
,
RA
}
from
'@/utils/method'
;
import
{
urlEncode
,
filterObj
,
filterObjbyTg
,
RA
}
from
'@/utils/method'
;
...
@@ -26,6 +26,8 @@ let readyData: any = {
...
@@ -26,6 +26,8 @@ let readyData: any = {
let
flag
:
boolean
=
false
;
let
flag
:
boolean
=
false
;
const
ServiceProviderManagement
=
(
props
:
any
)
=>
{
const
ServiceProviderManagement
=
(
props
:
any
)
=>
{
const
permissionArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'permission'
)
||
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
dispatch
,
location
,
Data
,
CommunityList
,
DataServices
}
=
props
;
const
{
dispatch
,
location
,
Data
,
CommunityList
,
DataServices
}
=
props
;
...
@@ -35,6 +37,10 @@ const ServiceProviderManagement = (props: any) => {
...
@@ -35,6 +37,10 @@ const ServiceProviderManagement = (props: any) => {
};
};
const
goToDetail
=
(
values
:
any
,
e
:
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
];
values
.
serviceScope
=
options
[
values
.
serviceScopeList
[
0
]][
1
];
SaveChooseData
(
values
);
SaveChooseData
(
values
);
if
(
values
.
serviceScopeList
[
0
]
===
'0'
)
{
if
(
values
.
serviceScopeList
[
0
]
===
'0'
)
{
...
@@ -46,6 +52,10 @@ const ServiceProviderManagement = (props: any) => {
...
@@ -46,6 +52,10 @@ const ServiceProviderManagement = (props: any) => {
}
}
};
};
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
const
goToEdit
=
(
values
:
any
,
e
:
any
)
=>
{
if
(
permissionArr
.
indexOf
(
'7'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SaveChooseData
(
values
);
SaveChooseData
(
values
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
// if (values.serviceScopeList[0] === '0') {
// if (values.serviceScopeList[0] === '0') {
...
@@ -56,6 +66,10 @@ const ServiceProviderManagement = (props: any) => {
...
@@ -56,6 +66,10 @@ const ServiceProviderManagement = (props: any) => {
// }
// }
};
};
const
goToCreate
=
()
=>
{
const
goToCreate
=
()
=>
{
if
(
permissionArr
.
indexOf
(
'8'
)
<
0
)
{
message
.
error
(
'No Permissions!!!'
,
3
);
return
;
}
SaveChooseData
(
null
);
SaveChooseData
(
null
);
history
.
push
(
location
.
pathname
+
'/Edit'
);
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';
...
@@ -3,7 +3,7 @@ import { Alert, Checkbox, Input, message, Form, Button } from 'antd';
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useCallback
}
from
'react'
;
import
{
Link
,
connect
,
Dispatch
,
history
,
Redirect
}
from
'umi'
;
import
{
Link
,
connect
,
Dispatch
,
history
,
Redirect
}
from
'umi'
;
import
{
StateType
}
from
'@/models/login'
;
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
{
ConnectState
}
from
'@/models/connect'
;
import
styles
from
'./style.less'
;
import
styles
from
'./style.less'
;
...
@@ -27,16 +27,21 @@ const Login: React.FC<LoginProps> = (props) => {
...
@@ -27,16 +27,21 @@ const Login: React.FC<LoginProps> = (props) => {
const
handleSubmit
=
(
values
:
LoginParamsType
)
=>
{
const
handleSubmit
=
(
values
:
LoginParamsType
)
=>
{
console
.
log
(
values
);
console
.
log
(
values
);
if
(
forgetflag
)
{
if
(
forgetflag
)
{
console
.
log
(
'验证码!'
);
console
.
log
(
'校验验证码!'
);
}
// ValidateCaptcha({account,code})
if
(
true
)
{
if
(
values
.
userName
&&
values
.
password
)
{
console
.
log
(
'通过跳转到修改密码页面'
);
dispatch
({
history
.
push
(
'login2'
);
type
:
'login/login'
,
}
payload
:
{
...
values
},
});
}
else
{
}
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) => {
...
@@ -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
)
/^
[
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
(
'邮箱正确!'
);
onGetCaptcha
(
'mobile'
);
onGetCaptcha
(
userName
);
}
else
{
}
else
{
message
.
warning
(
'Please enter the correct email address!'
);
message
.
warning
(
'Please enter the correct email address!'
);
}
}
...
@@ -76,10 +81,14 @@ const Login: React.FC<LoginProps> = (props) => {
...
@@ -76,10 +81,14 @@ const Login: React.FC<LoginProps> = (props) => {
}
}
},
[
location
.
pathname
]);
},
[
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
);
console
.
log
(
result
);
return
;
if
(
result
===
false
)
{
if
(
result
===
false
)
{
return
;
return
;
}
}
...
@@ -120,8 +129,8 @@ const Login: React.FC<LoginProps> = (props) => {
...
@@ -120,8 +129,8 @@ const Login: React.FC<LoginProps> = (props) => {
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter email address'
:
'Account Name'
}
{
forgetflag
?
'Please enter email address'
:
'Account Name'
}
</
div
>
</
div
>
<
Form
.
Item
name=
"userName"
>
<
Form
.
Item
name=
"userName"
initialValue=
{
userName
||
''
}
>
<
input
className=
{
styles
.
input
}
defaultValue=
{
userName
||
''
}
onChange=
{
usernameHandle
}
/>
<
input
className=
{
styles
.
input
}
onChange=
{
usernameHandle
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
div
className=
{
styles
.
box1
}
>
<
div
className=
{
styles
.
box1
}
>
{
forgetflag
?
'Please enter a verification code'
:
'Password'
}
{
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 @@
...
@@ -38,92 +38,121 @@
}
}
}
}
.box1{
.box1
{
font-size:20px;
font-size:
20px;
font-family:
"PingFang SC"
;
font-family:
'PingFang SC'
;
font-weight:800;
font-weight:
800;
color:
rgba(129,152,177,
1);
color:
rgba(129, 152, 177,
1);
margin-bottom: 20px;
margin-bottom: 20px;
}
}
.input{
.input
{
border:none;
border:
none;
background:none;
background:
none;
outline: none;
outline: none;
border-bottom: 1px solid rgba(78,
80,105,
1);
border-bottom: 1px solid rgba(78,
80, 105,
1);
width:330px;
width:
330px;
margin-bottom: 20px;
margin-bottom: 20px;
font-size:20px;
font-size:
20px;
font-family:
"PingFang SC"
;
font-family:
'PingFang SC'
;
font-weight:800;
font-weight:
800;
color:
rgba(0,26,84,
1);
color:
rgba(0, 26, 84,
1);
}
}
.input2{
.input2
{
border:none;
border:
none;
background:none;
background:
none;
outline: none;
outline: none;
border-bottom: 1px solid rgba(78,
80,105,
1);
border-bottom: 1px solid rgba(78,
80, 105,
1);
width:330px;
width:
330px;
font-size:20px;
font-size:
20px;
font-family:
"PingFang SC"
;
font-family:
'PingFang SC'
;
font-weight:800;
font-weight:
800;
color:
rgba(0,26,84,
1);
color:
rgba(0, 26, 84,
1);
}
}
.input3{
.input3
{
cursor: pointer;
cursor: pointer;
font-size:20px;
font-size:
20px;
font-family:
"PingFang SC"
;
font-family:
'PingFang SC'
;
font-weight:800;
font-weight:
800;
color:
rgba(0,26,84,
1);
color:
rgba(0, 26, 84,
1);
opacity:0.3;
opacity:
0.3;
}
}
.input4{
.input4
{
width:400px;
width:
400px;
height:20px;
height:
20px;
font-size:20px;
font-size:
20px;
font-family:PingFang SC;
font-family:
PingFang SC;
font-weight:800;
font-weight:
800;
color:
rgba(255,56,56,
1);
color:
rgba(255, 56, 56,
1);
}
}
.button{
.button
{
width:100px;
width:
100px;
height:51px;
height:
51px;
background:
rgba(64,101,224,
1);
background:
rgba(64, 101, 224,
1);
border-radius:26px;
border-radius:
26px;
border: none;
border: none;
}
}
.input5{
.input5
{
border:none;
border:
none;
background:none;
background:
none;
outline: none;
outline: none;
border-bottom: 1px solid rgba(78,
80,105,
1);
border-bottom: 1px solid rgba(78,
80, 105,
1);
width:176px;
width:
176px;
font-size:20px;
font-size:
20px;
font-family:
"PingFang SC"
;
font-family:
'PingFang SC'
;
font-weight:800;
font-weight:
800;
color:
rgba(0,26,84,
1);
color:
rgba(0, 26, 84,
1);
}
}
.button2{
.button2
{
width: 120px;
width: 120px;
height: 34px;
height: 34px;
border-radius:26px;
border-radius:
26px;
background:none;
background:
none;
border: 1px solid rgba(78,
80,105,
1);
border: 1px solid rgba(78,
80, 105,
1);
line-height: 34px;
line-height: 34px;
text-align: center;
text-align: center;
position: absolute;
position: absolute;
cursor: pointer;
cursor: pointer;
top:0;
top:
0;
left: 196px;
left: 196px;
font-size:20px;
font-size: 20px;
font-family:"PingFang SC";
font-family: 'PingFang SC';
font-weight:800;
font-weight: 800;
color:rgba(0,26,84,1);
color: rgba(0, 26, 84, 1);
}
}
.box2{
.box2
{
width: 100%;
width: 100%;
height: 34px;
height: 34px;
position: relative;
position: relative;
margin-bottom: 45px;
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
React
,
{
useState
,
useEffect
}
from
'react'
;
import
styles
from
'./index.less'
;
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'
;
import
{
Link
,
useIntl
,
connect
,
Dispatch
}
from
'umi'
;
const
Login2
=
()
=>
{
const
Login2
=
()
=>
{
return
(
return
(
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
base
}
>
<
div
className=
{
styles
.
box
}
>
<
div
className=
{
styles
.
box
}
>
<
div
>
please input a password
</
div
>
<
div
>
please input a password
</
div
>
<
input
type=
"password"
className=
{
styles
.
input
}
placeholder=
""
/>
<
input
type=
"password"
className=
{
styles
.
input
}
placeholder=
""
/>
<
div
className=
{
styles
.
item1
}
>
<
div
className=
{
styles
.
item1
}
>
<
Button
type=
"primary"
className=
{
styles
.
item2
}
>
提交
</
Button
>
<
Button
type=
"primary"
className=
{
styles
.
item2
}
>
提交
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
);
};
};
export
default
Login2
;
export
default
Login2
;
src/services/login.ts
View file @
ae9d3590
...
@@ -4,7 +4,10 @@ export interface LoginParamsType {
...
@@ -4,7 +4,10 @@ export interface LoginParamsType {
userName
:
string
;
userName
:
string
;
password
:
string
;
password
:
string
;
}
}
export
interface
CodeType
{
account
:
string
;
code
:
string
;
}
// export async function fakeAccountLogin(params: LoginParamsType) {
// export async function fakeAccountLogin(params: LoginParamsType) {
// return request('/api/login/account', {
// return request('/api/login/account', {
// method: 'POST',
// method: 'POST',
...
@@ -12,10 +15,6 @@ export interface LoginParamsType {
...
@@ -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
)
{
export
async
function
AccountLogin
(
params
:
LoginParamsType
)
{
console
.
log
(
'登录请求'
);
console
.
log
(
'登录请求'
);
console
.
log
(
params
);
console
.
log
(
params
);
...
@@ -35,3 +34,19 @@ export async function AccountCheckLogin(params: LoginCheckParamsType) {
...
@@ -35,3 +34,19 @@ export async function AccountCheckLogin(params: LoginCheckParamsType) {
console
.
log
(
'登录确认请求'
);
console
.
log
(
'登录确认请求'
);
return
request
(
'/tos/user/newCurrentUser'
,
{
method
:
'POST'
,
data
:
params
});
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