Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_front_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
fns_front_2
Commits
f5e7e4f4
Commit
f5e7e4f4
authored
Nov 03, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复客服经理在聊天页面时,其他地方登录该账号,结果该处提示的错误不符合当前场景的bug
parent
154f1e5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
index.ts
src/router/index.ts
+6
-4
authCheck.ts
src/utils/authCheck.ts
+8
-5
No files found.
src/router/index.ts
View file @
f5e7e4f4
...
...
@@ -243,12 +243,14 @@ router.beforeEach((to, from, next) => {
()
=>
{
next
()
},
()
=>
{
Toast
(
'由于您现在是不在岗状态所以无法进入聊天!'
)
(
mark
:
boolean
|
undefined
)
=>
{
/* 如果有mark为false,则表示检查聊天权限的逻辑走到了调用接口,但是返回auth为false */
mark
===
false
&&
Toast
(
'由于您现在是不在岗状态所以无法进入聊天!'
)
},
)
}
else
{
next
()
;
}
else
{
next
()
}
}
}
else
{
...
...
src/utils/authCheck.ts
View file @
f5e7e4f4
...
...
@@ -12,18 +12,21 @@ export function authCheck(cb: Function) {
}
}
/**
*
* @param cb 有权限时回调
* @param cb2 没有权限时回调 什么时候没有权限?本地无token,用户在其他地方登录,不在岗或被禁用了
*/
export
async
function
chatAuthCheck
(
cb
:
Function
,
cb2
?:
Function
)
{
const
msg
=
getUserMsg
()
if
(
msg
?.
role
===
eRole
.
user
)
{
cb
();
}
else
if
(
msg
?.
role
===
eRole
.
staff
)
{
cb
()
}
else
if
(
msg
?.
role
===
eRole
.
staff
)
{
const
ret
=
await
getStaffOnDutyStatus
()
if
(
ret
.
code
===
200
&&
ret
.
data
)
{
console
.
log
(
'cb'
);
cb
()
}
else
{
cb2
&&
cb2
()
cb2
&&
cb2
(
ret
.
data
)
}
}
else
{
cb2
&&
cb2
()
...
...
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