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
f8dd3d06
Commit
f8dd3d06
authored
Nov 13, 2020
by
张烨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
03d16e7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
index.js
src/containers/App/store/index.js
+6
-2
index.js
src/services/index.js
+7
-1
api.js
src/services/user/api.js
+3
-7
No files found.
src/containers/App/store/index.js
View file @
f8dd3d06
import
{
connect
}
from
'react-redux'
;
import
{
isImmutable
}
from
'immutable'
;
import
*
as
actionCreators
from
'./actions'
;
import
*
as
constants
from
'./constants'
;
import
reducer
from
'./reducer'
;
import
*
as
selectors
from
'./selectors'
;
const
mapState
=
store
=>
{
const
storeObj
=
store
.
toJS
()
;
const
storeObj
=
isImmutable
(
store
)
?
store
.
toJS
()
:
store
;
return
{
global
:
storeObj
.
global
,
auth
:
storeObj
.
global
.
auth
,
...
...
@@ -14,7 +15,10 @@ const mapState = store => {
};
const
mapDispatch
=
dispatch
=>
({
setAuth
:
auth
=>
dispatch
(
actionCreators
.
setAuth
(
auth
)),
logout
:
()
=>
dispatch
(
actionCreators
.
setAuth
([])),
logout
:
()
=>
{
localStorage
.
setItem
(
'token'
,
''
);
dispatch
(
actionCreators
.
setAuth
([]));
},
setUserMode
:
userMode
=>
dispatch
(
actionCreators
.
setUserMode
(
userMode
)),
});
...
...
src/services/index.js
View file @
f8dd3d06
...
...
@@ -18,4 +18,10 @@ const post = async (url, params, options = {}) =>
...
options
,
});
export
{
get
,
post
};
const
postForm
=
async
(
url
,
params
=
{},
options
=
{})
=>
{
const
formData
=
new
FormData
();
Object
.
keys
(
params
).
forEach
(
k
=>
formData
.
append
(
k
.
trim
(),
params
[
k
]));
return
post
(
url
,
formData
,
options
);
};
export
{
get
,
post
,
postForm
};
src/services/user/api.js
View file @
f8dd3d06
// import sha from 'sha1';
import
{
CITY_SERVICE
,
get
,
post
,
PUBLISH_SERVICE
}
from
'../index'
;
import
{
CITY_SERVICE
,
get
,
post
,
postForm
,
PUBLISH_SERVICE
}
from
'../index'
;
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
)
=>
{
const
formData
=
new
FormData
();
formData
.
append
(
'userName'
,
loginName
);
formData
.
append
(
'password'
,
password
);
return
post
(
`
${
PUBLISH_SERVICE
}
/OMSLogin`
,
formData
);
};
export
const
OMSLogin
=
(
loginName
,
password
)
=>
postForm
({
loginName
,
password
});
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