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
Hide 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'
import
api
from
'./api'
import
{
fetchConfig
,
cfg
}
from
'@/config'
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
'components'
import
{
components
}
from
'@/plugins/vant'
...
...
@@ -49,7 +49,9 @@ fetchConfig(!isMock).then(res => {
window
.
$fetchConfig
=
res
/**登录过期 重新登录 */
window
.
reLogin
=
()
=>
{
console
.
log
(
123
)
console
.
log
(
'重新登录'
)
util
.
clearSessionId
()
store
.
dispatch
(
'navigation'
)
}
window
.
vm
=
new
Vue
({
el
:
'#app'
,
...
...
src/router/router.js
View file @
7828812
...
...
@@ -10,7 +10,6 @@ import Vue from 'vue'
import
Router
from
'vue-router'
import
routes
from
'./routes'
import
store
from
'@/store'
import
util
from
'@/utils/util'
// hack router push callback
const
originalPush
=
Router
.
prototype
.
push
Router
.
prototype
.
push
=
function
push
(
location
,
onResolve
,
onReject
)
{
...
...
@@ -40,6 +39,7 @@ router.beforeEach((to, from, next) => {
}
else
{
store
.
dispatch
(
'setPageMeta'
,
{
title
:
'客户跟进'
})
}
store
.
commit
(
'SET_LAST_PATH'
,
to
.
name
)
if
(
to
.
matched
.
some
(
recode
=>
recode
.
meta
.
noAuth
))
{
store
.
state
.
app
.
showWindow
=
true
}
else
{
...
...
src/store/modules/app.js
View file @
7828812
...
...
@@ -13,6 +13,7 @@ import { Notify } from 'vant'
const
state
=
{
pageMeta
:
''
,
keepAlives
:
[],
lastPath
:
''
}
const
mutations
=
{
SET_PAGE_META
(
state
,
meta
)
{
...
...
@@ -31,6 +32,10 @@ const mutations = {
return
arr
},
[])
},
SET_LAST_PATH
(
state
,
path
)
{
state
.
lastPath
=
path
}
}
const
actions
=
{
...
...
src/utils/util.js
View file @
7828812
...
...
@@ -85,6 +85,9 @@ const setSessionId = val => {
const
getSessionId
=
()
=>
{
return
window
.
localStorage
.
getItem
(
'dj_scrm_session_id'
)
}
const
clearSessionId
=
()
=>
{
window
.
localStorage
.
removeItem
(
'dj_scrm_session_id'
)
}
const
setLocalStorage
=
(
key
,
item
)
=>
{
window
.
localStorage
.
setItem
(
key
,
JSON
.
stringify
(
item
))
}
...
...
@@ -167,6 +170,7 @@ const utils = {
jumpChildrenPage
,
setLocalStorage
,
getLocalStorage
,
clearSessionId
,
makePhoneCall
,
isFullSucreen
,
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