Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-clew
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit da180228
authored
Jun 29, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
企微敏感信息获取授权同步
1 parent
f34b54d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
src/store/modules/app.js
src/store/modules/app.js
View file @
da18022
...
...
@@ -16,15 +16,15 @@ const state = {
lastPath
:
''
}
const
mutations
=
{
SET_PAGE_META
(
state
,
meta
)
{
SET_PAGE_META
(
state
,
meta
)
{
state
.
pageMeta
=
meta
},
PUSH_KEEP
(
state
,
name
)
{
PUSH_KEEP
(
state
,
name
)
{
if
(
!
state
.
keepAlives
.
includes
(
name
))
{
state
.
keepAlives
.
push
(
name
)
}
},
REMOVE_KEEP
(
state
,
names
)
{
REMOVE_KEEP
(
state
,
names
)
{
state
.
keepAlives
=
state
.
keepAlives
.
reduce
((
arr
,
name
)
=>
{
if
(
!
names
.
includes
(
name
))
{
return
arr
.
push
(
name
)
...
...
@@ -32,28 +32,28 @@ const mutations = {
return
arr
},
[])
},
SET_LAST_PATH
(
state
,
path
)
{
SET_LAST_PATH
(
state
,
path
)
{
state
.
lastPath
=
path
}
}
const
actions
=
{
setPageMeta
({
commit
},
meta
)
{
setPageMeta
({
commit
},
meta
)
{
document
.
title
=
meta
.
title
commit
(
'SET_PAGE_META'
,
meta
)
},
setLoginToken
({
commit
},
val
)
{
setLoginToken
({
commit
},
val
)
{
commit
(
'SET_LOGIN_TOKEN'
,
val
)
},
setAccountList
({
commit
},
list
)
{
setAccountList
({
commit
},
list
)
{
commit
(
'SET_ACCOUNT_LIST'
,
list
)
},
pushKeep
({
commit
},
name
)
{
pushKeep
({
commit
},
name
)
{
commit
(
'PUSH_KEEP'
,
name
)
},
removeKeep
({
commit
},
names
)
{
removeKeep
({
commit
},
names
)
{
commit
(
'REMOVE_KEEP'
,
names
)
},
login
({
dispatch
})
{
login
({
dispatch
})
{
let
[
redirectUrl
]
=
window
.
location
.
href
.
split
(
'?'
)
// 以下是 本地调试
if
(
process
.
env
.
NODE_ENV
==
'development'
)
{
...
...
@@ -121,14 +121,14 @@ const actions = {
window
.
location
.
href
=
`
${
wxUrl
}
?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
redirectUrl
)}
&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
}
}
else
{
const
storage_corpId
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
const
{
corpId
,
agentId
}
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
const
{
baseURL
}
=
window
.
$fetchConfig
.
request
let
url
=
`
${
baseURL
}
/dj-scrm-wx-work-main/#/`
window
.
location
.
href
=
`
${
url
}
?redirect_uri=
${
redirectUrl
}
&corpId=
${
storage_corpId
.
corp
Id
}
`
window
.
location
.
href
=
`
${
url
}
?redirect_uri=
${
encodeURIComponent
(
redirectUrl
)}
&corpId=
${
corpId
}
&agentId=
${
agent
Id
}
`
}
},
navigation
({
dispatch
})
{
let
{
sessionId
,
corpId
,
taskId
}
=
getParams
()
navigation
({
dispatch
})
{
let
{
sessionId
,
corpId
,
taskId
,
agentId
}
=
getParams
()
const
storage_corpId
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
if
(
!
corpId
)
corpId
=
storage_corpId
&&
storage_corpId
.
corpId
if
(
corpId
&&
storage_corpId
)
{
...
...
@@ -137,7 +137,9 @@ const actions = {
util
.
clearSessionId
()
}
}
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
{
corpId
})
let
dj_scrm_storage
=
{
corpId
}
if
(
agentId
)
dj_scrm_storage
.
agentId
=
agentId
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
dj_scrm_storage
)
if
(
taskId
)
{
util
.
setLocalStorage
(
'dj_scrm_taskId'
,
{
taskId
})
}
...
...
@@ -154,7 +156,7 @@ const actions = {
}
state
.
showWindow
=
true
},
registerHttp
({
},
sessionId
=
''
)
{
registerHttp
({
},
sessionId
=
''
)
{
window
.
$HTTP
=
new
Http
({
...
window
.
$fetchConfig
,
alert
:
Notify
,
headers
:
{
token
:
sessionId
}
})
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment