Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-customer
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 e37d693f
authored
Nov 26, 2021
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
223d5108
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
21 deletions
src/main.js
src/router/router.js
src/store/modules/app.js
src/main.js
View file @
e37d693
...
@@ -39,7 +39,7 @@ Vue.prototype.to = function (name, params) {
...
@@ -39,7 +39,7 @@ Vue.prototype.to = function (name, params) {
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
import
VConsole
from
'vconsole'
import
VConsole
from
'vconsole'
const
vConsole
=
new
VConsole
()
//
const vConsole = new VConsole()
const
isMock
=
true
const
isMock
=
true
fetchConfig
(
!
isMock
).
then
(
res
=>
{
fetchConfig
(
!
isMock
).
then
(
res
=>
{
...
@@ -47,7 +47,7 @@ fetchConfig(!isMock).then(res => {
...
@@ -47,7 +47,7 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn
// 设置 js中可以访问 $cdn
Vue
.
use
(
cfg
)
Vue
.
use
(
cfg
)
window
.
$fetchConfig
=
res
window
.
$fetchConfig
=
res
/**登录过期 重新登录 */
/**登录过期 重新登录 */
window
.
reLogin
=
()
=>
{
window
.
reLogin
=
()
=>
{
console
.
log
(
'重新登录'
)
console
.
log
(
'重新登录'
)
util
.
clearSessionId
()
util
.
clearSessionId
()
...
@@ -59,4 +59,4 @@ fetchConfig(!isMock).then(res => {
...
@@ -59,4 +59,4 @@ fetchConfig(!isMock).then(res => {
store
,
store
,
render
:
h
=>
h
(
App
)
render
:
h
=>
h
(
App
)
})
})
})
})
\ No newline at end of file
\ No newline at end of file
src/router/router.js
View file @
e37d693
...
@@ -40,6 +40,8 @@ router.beforeEach((to, from, next) => {
...
@@ -40,6 +40,8 @@ router.beforeEach((to, from, next) => {
store
.
dispatch
(
'setPageMeta'
,
{
title
:
'客户跟进'
})
store
.
dispatch
(
'setPageMeta'
,
{
title
:
'客户跟进'
})
}
}
store
.
commit
(
'SET_LAST_PATH'
,
to
.
name
)
store
.
commit
(
'SET_LAST_PATH'
,
to
.
name
)
/* 路由发生变化修改页面背景色 */
document
.
documentElement
.
style
.
backgroundColor
=
to
.
meta
.
backgroundColor
||
'#fff'
if
(
to
.
matched
.
some
(
recode
=>
recode
.
meta
.
noAuth
))
{
if
(
to
.
matched
.
some
(
recode
=>
recode
.
meta
.
noAuth
))
{
store
.
state
.
app
.
showWindow
=
true
store
.
state
.
app
.
showWindow
=
true
}
else
{
}
else
{
...
...
src/store/modules/app.js
View file @
e37d693
...
@@ -37,11 +37,6 @@ const mutations = {
...
@@ -37,11 +37,6 @@ const mutations = {
}
}
}
}
const
actions
=
{
const
actions
=
{
// 设置name
setUserInfo
({
commit
},
user
)
{
commit
(
'SET_USER_INFO'
,
user
)
store
.
set
(
store
.
consts
.
USER_KEY
,
user
)
},
setPageMeta
({
commit
},
meta
)
{
setPageMeta
({
commit
},
meta
)
{
document
.
title
=
meta
.
title
document
.
title
=
meta
.
title
commit
(
'SET_PAGE_META'
,
meta
)
commit
(
'SET_PAGE_META'
,
meta
)
...
@@ -52,9 +47,6 @@ const actions = {
...
@@ -52,9 +47,6 @@ const actions = {
setAccountList
({
commit
},
list
)
{
setAccountList
({
commit
},
list
)
{
commit
(
'SET_ACCOUNT_LIST'
,
list
)
commit
(
'SET_ACCOUNT_LIST'
,
list
)
},
},
setSessionId
({
commit
},
id
)
{
commit
(
'SET_SESSION_ID'
,
id
)
},
pushKeep
({
commit
},
name
)
{
pushKeep
({
commit
},
name
)
{
commit
(
'PUSH_KEEP'
,
name
)
commit
(
'PUSH_KEEP'
,
name
)
},
},
...
@@ -74,10 +66,6 @@ const actions = {
...
@@ -74,10 +66,6 @@ const actions = {
corpId
corpId
})
})
.
then
(({
code
,
data
,
message
})
=>
{
.
then
(({
code
,
data
,
message
})
=>
{
console
.
log
(
data
)
// const { baseURL } = window.$fetchConfig.request
const
[
baseURL
]
=
redirectUrl
.
split
(
'/dj-scrm-wx-work-main/'
)
let
url
=
`
${
baseURL
}
/dj-scrm-wx-work-main/#/`
let
route
=
state
.
lastPath
==
'coupon'
?
''
:
state
.
lastPath
||
''
let
route
=
state
.
lastPath
==
'coupon'
?
''
:
state
.
lastPath
||
''
route
=
route
.
replace
(
'.'
,
'/'
)
route
=
route
.
replace
(
'.'
,
'/'
)
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
...
@@ -95,13 +83,11 @@ const actions = {
...
@@ -95,13 +83,11 @@ const actions = {
loginType
:
3
loginType
:
3
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
util
.
removeLocalStorage
(
'dj_scrm_loginToken'
)
util
.
removeLocalStorage
(
'dj_scrm_accountList'
)
util
.
setLocalStorage
(
'dj_scrm_userInfo'
,
res
.
data
)
util
.
setLocalStorage
(
'dj_scrm_userInfo'
,
res
.
data
)
util
.
setSessionId
(
res
.
data
.
sessionId
)
util
.
setSessionId
(
res
.
data
.
sessionId
)
dispatch
(
'registerHttp'
,
res
.
data
.
sessionId
)
dispatch
(
'registerHttp'
,
res
.
data
.
sessionId
)
state
.
showWindow
=
true
state
.
showWindow
=
true
window
.
location
.
replace
(
`
${
url
}
${
route
}
`
)
window
.
location
.
replace
(
`
${
redirectUrl
}
#/
${
route
}
`
)
})
})
}
else
{
}
else
{
let
[
userInfo
]
=
data
.
loginList
let
[
userInfo
]
=
data
.
loginList
...
@@ -111,7 +97,7 @@ const actions = {
...
@@ -111,7 +97,7 @@ const actions = {
// 只有一个账号 history.back()
// 只有一个账号 history.back()
console
.
log
(
`
${
redirectUrl
}${
route
}
`
)
console
.
log
(
`
${
redirectUrl
}${
route
}
`
)
state
.
showWindow
=
true
state
.
showWindow
=
true
window
.
location
.
replace
(
`
${
redirectUrl
}${
route
}
`
)
window
.
location
.
replace
(
`
${
redirectUrl
}
#/
${
route
}
`
)
}
}
}
else
{
}
else
{
/**没有账号 */
/**没有账号 */
...
@@ -129,7 +115,6 @@ const actions = {
...
@@ -129,7 +115,6 @@ const actions = {
let
appid
=
getParams
(
'corpId'
)
//从链接获取
let
appid
=
getParams
(
'corpId'
)
//从链接获取
let
dj_scrm
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
let
dj_scrm
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
if
(
!
appid
)
appid
=
(
dj_scrm
&&
dj_scrm
.
corpId
)
||
'ww7ee69c648ae1b7e6'
if
(
!
appid
)
appid
=
(
dj_scrm
&&
dj_scrm
.
corpId
)
||
'ww7ee69c648ae1b7e6'
//
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
{
corpId
:
appid
})
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
{
corpId
:
appid
})
// 'ww657a2d4ae89a4424'
// 'ww657a2d4ae89a4424'
const
wxUrl
=
'https://open.weixin.qq.com/connect/oauth2/authorize'
const
wxUrl
=
'https://open.weixin.qq.com/connect/oauth2/authorize'
...
@@ -146,7 +131,7 @@ const actions = {
...
@@ -146,7 +131,7 @@ const actions = {
let
{
sessionId
,
corpId
}
=
getParams
()
let
{
sessionId
,
corpId
}
=
getParams
()
const
storage_sessionId
=
util
.
getSessionId
()
const
storage_sessionId
=
util
.
getSessionId
()
const
storage_corpId
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
const
storage_corpId
=
util
.
getLocalStorage
(
'dj_scrm_corpId'
)
if
(
!
corpId
)
corpId
=
(
storage_corpId
&&
storage_corpId
.
corpId
)
||
'ww7ee69c648ae1b7e6'
if
(
!
corpId
)
corpId
=
storage_corpId
&&
storage_corpId
.
corpId
||
'ww7ee69c648ae1b7e6'
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
{
corpId
})
util
.
setLocalStorage
(
'dj_scrm_corpId'
,
{
corpId
})
if
(
sessionId
||
storage_sessionId
)
{
if
(
sessionId
||
storage_sessionId
)
{
state
.
showWindow
=
true
state
.
showWindow
=
true
...
...
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