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 78288122
authored
Nov 09, 2021
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
439ea737
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
3 deletions
src/main.js
src/router/router.js
src/store/modules/app.js
src/utils/util.js
src/main.js
View file @
7828812
...
@@ -17,7 +17,7 @@ import store from './store'
...
@@ -17,7 +17,7 @@ import store from './store'
import
api
from
'./api'
import
api
from
'./api'
import
{
fetchConfig
,
cfg
}
from
'@/config'
import
{
fetchConfig
,
cfg
}
from
'@/config'
import
'@/assets/css/index.scss'
import
'@/assets/css/index.scss'
import
{
bus
,
tools
,
store
as
local
}
from
'./utils'
import
{
bus
,
tools
,
store
as
local
,
util
}
from
'./utils'
import
'./utils/util'
import
'./utils/util'
import
'components'
import
'components'
import
{
components
}
from
'@/plugins/vant'
import
{
components
}
from
'@/plugins/vant'
...
@@ -49,7 +49,9 @@ fetchConfig(!isMock).then(res => {
...
@@ -49,7 +49,9 @@ fetchConfig(!isMock).then(res => {
window
.
$fetchConfig
=
res
window
.
$fetchConfig
=
res
/**登录过期 重新登录 */
/**登录过期 重新登录 */
window
.
reLogin
=
()
=>
{
window
.
reLogin
=
()
=>
{
console
.
log
(
123
)
console
.
log
(
'重新登录'
)
util
.
clearSessionId
()
store
.
dispatch
(
'navigation'
)
}
}
window
.
vm
=
new
Vue
({
window
.
vm
=
new
Vue
({
el
:
'#app'
,
el
:
'#app'
,
...
...
src/router/router.js
View file @
7828812
...
@@ -10,7 +10,6 @@ import Vue from 'vue'
...
@@ -10,7 +10,6 @@ import Vue from 'vue'
import
Router
from
'vue-router'
import
Router
from
'vue-router'
import
routes
from
'./routes'
import
routes
from
'./routes'
import
store
from
'@/store'
import
store
from
'@/store'
import
util
from
'@/utils/util'
// hack router push callback
// hack router push callback
const
originalPush
=
Router
.
prototype
.
push
const
originalPush
=
Router
.
prototype
.
push
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
...
@@ -40,6 +39,7 @@ router.beforeEach((to, from, next) => {
...
@@ -40,6 +39,7 @@ router.beforeEach((to, from, next) => {
}
else
{
}
else
{
store
.
dispatch
(
'setPageMeta'
,
{
title
:
'客户跟进'
})
store
.
dispatch
(
'setPageMeta'
,
{
title
:
'客户跟进'
})
}
}
store
.
commit
(
'SET_LAST_PATH'
,
to
.
name
)
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 @
7828812
...
@@ -13,6 +13,7 @@ import { Notify } from 'vant'
...
@@ -13,6 +13,7 @@ import { Notify } from 'vant'
const
state
=
{
const
state
=
{
pageMeta
:
''
,
pageMeta
:
''
,
keepAlives
:
[],
keepAlives
:
[],
lastPath
:
''
}
}
const
mutations
=
{
const
mutations
=
{
SET_PAGE_META
(
state
,
meta
)
{
SET_PAGE_META
(
state
,
meta
)
{
...
@@ -31,6 +32,10 @@ const mutations = {
...
@@ -31,6 +32,10 @@ const mutations = {
return
arr
return
arr
},
[])
},
[])
},
},
SET_LAST_PATH
(
state
,
path
)
{
state
.
lastPath
=
path
}
}
}
const
actions
=
{
const
actions
=
{
...
...
src/utils/util.js
View file @
7828812
...
@@ -85,6 +85,9 @@ const setSessionId = val => {
...
@@ -85,6 +85,9 @@ const setSessionId = val => {
const
getSessionId
=
()
=>
{
const
getSessionId
=
()
=>
{
return
window
.
localStorage
.
getItem
(
'dj_scrm_session_id'
)
return
window
.
localStorage
.
getItem
(
'dj_scrm_session_id'
)
}
}
const
clearSessionId
=
()
=>
{
window
.
localStorage
.
removeItem
(
'dj_scrm_session_id'
)
}
const
setLocalStorage
=
(
key
,
item
)
=>
{
const
setLocalStorage
=
(
key
,
item
)
=>
{
window
.
localStorage
.
setItem
(
key
,
JSON
.
stringify
(
item
))
window
.
localStorage
.
setItem
(
key
,
JSON
.
stringify
(
item
))
}
}
...
@@ -167,6 +170,7 @@ const utils = {
...
@@ -167,6 +170,7 @@ const utils = {
jumpChildrenPage
,
jumpChildrenPage
,
setLocalStorage
,
setLocalStorage
,
getLocalStorage
,
getLocalStorage
,
clearSessionId
,
makePhoneCall
,
makePhoneCall
,
isFullSucreen
,
isFullSucreen
,
watchPageBack
,
watchPageBack
,
...
...
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