Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
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
lanbaoming
jiedao-app-operator-master
Commits
e7e4aa17
Commit
e7e4aa17
authored
Jul 03, 2022
by
dcy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导航栏获取未读消息
parent
3f56be13
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
3 deletions
+37
-3
internalMessage.js
src/api/system/internalMessage.js
+11
-0
Navbar.vue
src/layout/components/Navbar.vue
+8
-1
user.js
src/store/modules/user.js
+18
-2
No files found.
src/api/system/internalMessage.js
View file @
e7e4aa17
...
...
@@ -61,3 +61,14 @@ export function getMyInternalMessagePage(query) {
params
:
query
})
}
//获取个未读消息
export
function
getNotReadInternalMessageTotal
(){
return
request
(
{
url
:
'
ecw/internal-message/getNotReadInternalMessageTotal
'
,
method
:
'
get
'
,
}
)
}
src/layout/components/Navbar.vue
View file @
e7e4aa17
...
...
@@ -8,7 +8,7 @@
<div
class=
"right-menu"
>
<template
v-if=
"device!=='mobile'"
>
<el-badge
:value=
"not
ReadTotal
"
class=
"right-menu-item badge"
>
<el-badge
:value=
"not
Message
"
class=
"right-menu-item badge"
>
<el-image
style=
"width: 22px;height: 20px;"
:src=
"unreadMessage"
></el-image>
</el-badge>
...
...
@@ -79,6 +79,9 @@ export default {
notReadTotal
:
0
,
//要去取VUEX里面的未读数据总数,我不会,登录之后要调得到当前人未读记录总数接口放到VUEX中
}
},
created
()
{
this
.
$store
.
dispatch
(
'
getNotMessage
'
);
},
components
:
{
Breadcrumb
,
TopNav
,
...
...
@@ -110,6 +113,9 @@ export default {
get
()
{
return
this
.
$store
.
state
.
settings
.
topNav
}
},
notMessage
(){
return
this
.
$store
.
state
.
user
.
notMessage
}
},
methods
:
{
...
...
@@ -182,6 +188,7 @@ export default {
.el-badge__content
{
top
:
13px
;
right
:
15px
;
height
:
20px
;
}
}
.right-menu-item
{
...
...
src/store/modules/user.js
View file @
e7e4aa17
import
{
login
,
logout
,
getInfo
,
socialLogin
,
socialLogin2
}
from
'
@/api/login
'
import
{
getToken
,
setToken
,
removeToken
}
from
'
@/utils/auth
'
import
{
getNotReadInternalMessageTotal
}
from
'
@/api/system/internalMessage
'
const
user
=
{
state
:
{
...
...
@@ -8,7 +9,8 @@ const user = {
name
:
''
,
avatar
:
''
,
roles
:
[],
permissions
:
[]
permissions
:
[],
notMessage
:
0
,
},
mutations
:
{
...
...
@@ -29,6 +31,9 @@ const user = {
},
SET_PERMISSIONS
:
(
state
,
permissions
)
=>
{
state
.
permissions
=
permissions
},
NOt_MESSAGE
:(
state
,
notMessage
)
=>
{
state
.
notMessage
=
notMessage
;
}
},
...
...
@@ -146,7 +151,18 @@ const user = {
removeToken
()
resolve
()
})
}
},
// 获取未登录消息
getNotMessage
({
commit
}){
return
new
Promise
((
resolve
,
reject
)
=>
{
getNotReadInternalMessageTotal
().
then
((
r
)
=>
{
commit
(
'
NOt_MESSAGE
'
,
r
.
data
);
resolve
()
}).
catch
(
error
=>
{
reject
(
error
);
})
})
},
}
}
...
...
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