Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
acacbcc2
Commit
acacbcc2
authored
May 05, 2022
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修复
parent
715c2a17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
25 deletions
+26
-25
global.js
src/models/global.js
+17
-17
user.js
src/models/user.js
+9
-8
No files found.
src/models/global.js
View file @
acacbcc2
...
@@ -7,23 +7,23 @@ const GlobalModel = {
...
@@ -7,23 +7,23 @@ const GlobalModel = {
notices
:
[],
notices
:
[],
},
},
effects
:
{
effects
:
{
*
fetchNotices
(
_
,
{
call
,
put
,
select
})
{
//
*fetchNotices(_, { call, put, select }) {
const
data
=
yield
call
(
queryNotices
);
//
const data = yield call(queryNotices);
yield
put
({
//
yield put({
type
:
'
saveNotices
'
,
//
type: 'saveNotices',
payload
:
data
,
//
payload: data,
});
//
});
const
unreadCount
=
yield
select
(
//
const unreadCount = yield select(
state
=>
state
.
global
.
notices
.
filter
(
item
=>
!
item
.
read
).
length
,
//
state => state.global.notices.filter(item => !item.read).length,
);
//
);
yield
put
({
//
yield put({
type
:
'
user/changeNotifyCount
'
,
//
type: 'user/changeNotifyCount',
payload
:
{
//
payload: {
totalCount
:
data
.
length
,
//
totalCount: data.length,
unreadCount
,
//
unreadCount,
},
//
},
});
//
});
},
//
},
*
clearNotices
({
payload
},
{
put
,
select
})
{
*
clearNotices
({
payload
},
{
put
,
select
})
{
yield
put
({
yield
put
({
...
...
src/models/user.js
View file @
acacbcc2
import
{
queryCurrent
,
queryUsers
,
homeInfo
}
from
'
@/services/user
'
;
// queryUsers
import
{
queryCurrent
,
homeInfo
}
from
'
@/services/user
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
import
localStorage
from
'
@/utils/localStorage
'
;
const
UserModel
=
{
const
UserModel
=
{
...
@@ -8,13 +9,13 @@ const UserModel = {
...
@@ -8,13 +9,13 @@ const UserModel = {
homeInfo
:
{},
homeInfo
:
{},
},
},
effects
:
{
effects
:
{
*
fetch
(
_
,
{
call
,
put
})
{
//
*fetch(_, { call, put }) {
const
response
=
yield
call
(
queryUsers
);
//
const response = yield call(queryUsers);
yield
put
({
//
yield put({
type
:
'
save
'
,
//
type: 'save',
payload
:
response
,
//
payload: response,
});
//
});
},
//
},
*
fetchCurrent
(
_
,
{
call
,
put
})
{
*
fetchCurrent
(
_
,
{
call
,
put
})
{
const
response
=
yield
call
(
queryCurrent
);
const
response
=
yield
call
(
queryCurrent
);
...
...
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