Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdsf-wx-app
Project
Overview
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
姜雷
cdsf-wx-app
Commits
e40e259b
Commit
e40e259b
authored
Sep 29, 2018
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统一传递userId
parent
6a02cfe6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
fetch.js
src/api/fetch.js
+1
-0
App.js
src/containers/App.js
+2
-0
Index.js
src/containers/Home/Index.js
+2
-2
PublicCarApply.js
src/containers/PublicCar/PublicCarApply.js
+0
-1
ReprtRepair.js
src/containers/Repair/ReprtRepair.js
+2
-3
index.js
src/containers/RepairDeal/index.js
+0
-1
No files found.
src/api/fetch.js
View file @
e40e259b
...
...
@@ -14,6 +14,7 @@ const service = axios.create({
service
.
interceptors
.
request
.
use
(
conf
=>
{
let
userId
=
store
.
getUserId
();
if
(
/post/
.
test
(
conf
.
method
.
toLocaleLowerCase
()))
{
let
data
=
userId
?
{
...
...
src/containers/App.js
View file @
e40e259b
...
...
@@ -15,6 +15,7 @@ import NoMatch from './NoMatch';
import
{
wxAuth
}
from
'../api/index'
;
import
{
Toast
}
from
'antd-mobile'
;
import
store
from
'../store/index'
;
class
App
extends
Component
{
constructor
(
props
)
{
...
...
@@ -72,6 +73,7 @@ class App extends Component {
console
.
log
(
res
);
const
{
firstLogin
,
user
,
author
}
=
res
.
data
;
this
.
updateUserInfo
({
...
user
,
login
:
true
,
author
});
store
.
updateUserId
(
user
.
userId
);
if
(
firstLogin
)
{
history
.
replace
(
'/login'
);
}
else
{
...
...
src/containers/Home/Index.js
View file @
e40e259b
...
...
@@ -43,7 +43,7 @@ export class Index extends React.Component {
}
export
default
props
=>
(
<
UserInfoContext
>
<
UserInfoContext
.
Consumer
>
{({
userinfo
})
=>
<
Index
userinfo
=
{
userinfo
}
{...
props
}
/>
}
<
/UserInfoContext
>
<
/UserInfoContext
.Consumer
>
);
src/containers/PublicCar/PublicCarApply.js
View file @
e40e259b
...
...
@@ -72,7 +72,6 @@ class PublicCarApply extends Component {
}))
);
const
entity
=
{
userId
:
this
.
state
.
userId
,
department
:
this
.
state
.
department
,
name
:
this
.
state
.
name
,
categoryName
:
categoryName
,
...
...
src/containers/Repair/ReprtRepair.js
View file @
e40e259b
...
...
@@ -13,6 +13,7 @@ import Select from '../../components/Input/Select/Select';
import
{
fetchRepairArea
,
fetchRepairTerm
}
from
'../../api/index'
;
import
{
reportRepair
}
from
'../../api/repairAdd'
;
import
Perview
from
'../../components/Perview/Perview'
;
import
store
from
'../../store/index'
;
class
ReprtRepair
extends
Component
{
constructor
(
props
)
{
...
...
@@ -22,7 +23,6 @@ class ReprtRepair extends Component {
termList
:
[],
applyForm
:
{
name
:
''
,
userId
:
''
,
repairCellphone
:
''
,
applyIdentity
:
'学生'
,
area
:
''
,
...
...
@@ -72,7 +72,6 @@ class ReprtRepair extends Component {
this
.
setState
({
applyForm
:
{
name
:
''
,
userId
:
''
,
repairCellphone
:
''
,
applyIdentity
:
'学生'
,
area
:
''
,
...
...
@@ -167,7 +166,7 @@ class ReprtRepair extends Component {
let
term
=
this
.
state
.
termList
.
find
(
i
=>
i
.
value
===
this
.
state
.
applyForm
.
termId
[
0
]
).
label
;
formData
.
append
(
'userId'
,
'1'
);
formData
.
append
(
'userId'
,
store
.
getUserId
()
);
// product 需要登陆后的用户ID
formData
.
append
(
'applyIdentity'
,
this
.
state
.
applyForm
.
applyIdentity
);
formData
.
append
(
'area'
,
area
);
...
...
src/containers/RepairDeal/index.js
View file @
e40e259b
...
...
@@ -100,7 +100,6 @@ class RepairDeal extends Component {
onPress
:
()
=>
dealRepair
({
id
:
id
,
userId
:
''
,
})
.
then
(
res
=>
{
Toast
.
fail
(
res
.
msg
||
'处理成功!'
);
...
...
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