Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
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
ReactWeb5
CivManage
Commits
6b83c760
Commit
6b83c760
authored
Nov 13, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix login api
parent
b1d50659
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
14 deletions
+23
-14
index.js
src/pages/user/login/index.js
+10
-6
siteConfigDrawer.js
src/pages/webConfig/components/siteConfigDrawer.js
+1
-0
api.js
src/services/user/api.js
+6
-5
api.js
src/services/userCenter/userManage/api.js
+1
-1
index.js
src/utils/request/index.js
+5
-2
No files found.
src/pages/user/login/index.js
View file @
6b83c760
...
...
@@ -32,11 +32,12 @@ const Login = props => {
const
{
userName
:
loginName
,
password
}
=
values
;
OMSLogin
(
loginName
,
password
)
.
then
(
result
=>
{
// login({ loginName, password }).then(result => {
console
.
log
(
result
);
if
(
result
.
success
===
true
&&
result
.
pass
===
true
)
{
const
{
userMode
}
=
result
;
// localStorage.setItem('userMode', userMode);
const
{
data
:
{
pass
,
userMode
,
token
},
msg
,
}
=
result
;
if
(
pass
===
true
)
{
localStorage
.
setItem
(
'token'
,
token
?.
access_token
);
setUserMode
(
userMode
);
if
(
userMode
===
USER_MODE
.
ADMIN
||
userMode
===
USER_MODE
.
SUPER
)
{
const
authority
=
[
AUTHORITY
.
LOGIN
,
AUTHORITY
[
userMode
]];
...
...
@@ -52,11 +53,14 @@ const Login = props => {
}
}
else
{
notification
.
warning
({
message
:
'没有权限!'
,
message
:
msg
||
'没有权限!'
,
});
}
})
.
then
(
e
=>
{
notification
.
error
({
message
:
e
.
message
||
'没有权限!'
,
});
console
.
error
(
e
);
});
};
...
...
src/pages/webConfig/components/siteConfigDrawer.js
View file @
6b83c760
...
...
@@ -118,6 +118,7 @@ const defaultKeyMap = ({ hasIntegerate }) => ({
theme
:
{
label
:
'系统皮肤'
,
formType
:
ITEM_TYPE
.
SINGLE_RADIO
,
initialValue
:
'a'
,
options
:
[
{
value
:
'a'
,
...
...
src/services/user/api.js
View file @
6b83c760
...
...
@@ -6,8 +6,9 @@ export const getUserInfo = param => get('/cityinterface/getUserinfo', param);
export
const
login
=
param
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/L_GetCheckUser`
,
param
);
export
const
OMSLogin
=
(
loginName
,
password
)
=>
post
(
`
${
PUBLISH_SERVICE
}
/OMSLogin`
,
{
UserName
:
loginName
,
PassWord
:
password
,
// sha(password).toUpperCase(),
});
export
const
OMSLogin
=
(
loginName
,
password
)
=>
{
const
formData
=
new
FormData
();
formData
.
append
(
'userName'
,
loginName
);
formData
.
append
(
'password'
,
password
);
return
post
(
`
${
PUBLISH_SERVICE
}
/OMSLogin`
,
formData
);
};
src/services/userCenter/userManage/api.js
View file @
6b83c760
...
...
@@ -21,7 +21,7 @@ export const getOneOUUserListNew = OUID =>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GroupUserList`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
G
roupId
:
OUID
,
g
roupId
:
OUID
,
});
/**
...
...
src/utils/request/index.js
View file @
6b83c760
...
...
@@ -24,9 +24,12 @@ const getMatchedConfig = requestConfig => {
return
null
;
}
};
axios
.
defaults
.
withCredentials
=
false
axios
.
interceptors
.
request
.
use
(
function
(
request
){
request
.
headers
.
token
=
'token123'
const
token
=
localStorage
.
getItem
(
'token'
)
if
(
token
){
request
.
headers
.
token
=
token
}
return
request
},
function
(
error
)
{
// Any status codes that falls outside the range of 2xx cause this function to trigger
...
...
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