Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eslotsys-game-nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
毛线
eslotsys-game-nuxt
Commits
cc8adcc1
Commit
cc8adcc1
authored
Dec 28, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退出游戏逻辑优化
parent
cfa4a516
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
index.vue
components/common/header/index.vue
+10
-4
goToGameList.vue
pages/goToGameList.vue
+5
-4
index.vue
pages/loading/index.vue
+2
-2
index.js
store/index.js
+4
-0
No files found.
components/common/header/index.vue
View file @
cc8adcc1
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
import
dayjs
from
'dayjs'
import
dayjs
from
'dayjs'
import
screenfull
from
'screenfull'
import
screenfull
from
'screenfull'
import
{
mapState
}
from
'vuex'
import
{
mapState
,
mapMutations
,
}
from
'vuex'
import
Confirm
from
'@/components/dialog/confirm'
import
Confirm
from
'@/components/dialog/confirm'
import
CenterBox
from
'./components/center-box'
import
CenterBox
from
'./components/center-box'
import
{
redirectBDUrl
}
from
'@/utils/tool'
import
{
redirectBDUrl
}
from
'@/utils/tool'
...
@@ -96,12 +96,16 @@ export default {
...
@@ -96,12 +96,16 @@ export default {
'device'
,
'device'
,
'hideHeader'
,
'hideHeader'
,
'device'
,
'device'
,
'homeRedirectUrl'
,
]),
]),
},
},
created
()
{
created
()
{
this
.
initTime
()
this
.
initTime
()
},
},
methods
:
{
methods
:
{
...
mapMutations
([
'SetHomeRedirectUrl'
,
]),
initTime
()
{
initTime
()
{
this
.
time
=
new
Date
()
this
.
time
=
new
Date
()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -144,14 +148,16 @@ export default {
...
@@ -144,14 +148,16 @@ export default {
network
()
{
network
()
{
return
{
return
{
quitAccount
:
()
=>
{
quitAccount
:
()
=>
{
const
{
redirectUrl
}
=
this
.
$route
.
query
console
.
log
(
'退出登录接口'
)
console
.
log
(
'退出登录接口'
)
const
homeRedirectUrl
=
this
.
homeRedirectUrl
this
.
$request
({
this
.
$request
({
url
:
'/api/player/logout'
,
url
:
'/api/player/logout'
,
method
:
'post'
,
method
:
'post'
,
}).
then
(()
=>
{
}).
then
(()
=>
{
if
(
redirectUrl
)
{
console
.
log
(
'homeRedirectUrl'
,
this
.
homeRedirectUrl
)
redirectBDUrl
(
this
.
$route
.
query
.
redirectUrl
)
if
(
this
.
homeRedirectUrl
)
{
this
.
SetHomeRedirectUrl
(
''
)
// 清空回调缓存
redirectBDUrl
(
homeRedirectUrl
)
}
else
{
}
else
{
this
.
$router
.
replace
({
path
:
'/login'
})
this
.
$router
.
replace
({
path
:
'/login'
})
}
}
...
...
pages/goToGameList.vue
View file @
cc8adcc1
...
@@ -22,6 +22,7 @@ export default {
...
@@ -22,6 +22,7 @@ export default {
...
mapMutations
([
...
mapMutations
([
'SetImToken'
,
'SetImToken'
,
'SetShowSlot'
,
'SetShowSlot'
,
'SetHomeRedirectUrl'
,
]),
]),
network
()
{
network
()
{
return
{
return
{
...
@@ -36,12 +37,12 @@ export default {
...
@@ -36,12 +37,12 @@ export default {
}).
then
(({
data
})
=>
{
}).
then
(({
data
})
=>
{
console
.
log
(
'登录成功'
)
console
.
log
(
'登录成功'
)
const
{
imToken
,
redirectUrl
,
token
}
=
data
const
{
imToken
,
redirectUrl
,
token
}
=
data
const
query
=
{
redirectUrl
,
}
setUserData
({
token
,
openImToken
:
imToken
})
setUserData
({
token
,
openImToken
:
imToken
})
this
.
SetImToken
(
imToken
)
this
.
SetImToken
(
imToken
)
this
.
$router
.
replace
({
path
:
'/loading'
,
query
,
})
this
.
SetHomeRedirectUrl
(
redirectUrl
)
console
.
log
(
'设置redirectUrl'
,
redirectUrl
)
this
.
$router
.
replace
({
path
:
'/loading'
,
})
})
})
},
},
}
}
...
...
pages/loading/index.vue
View file @
cc8adcc1
...
@@ -128,7 +128,7 @@ export default {
...
@@ -128,7 +128,7 @@ export default {
const
token
=
getToken
()
const
token
=
getToken
()
if
(
token
)
{
if
(
token
)
{
this
.
GetBaseInfo
().
then
(()
=>
{
this
.
GetBaseInfo
().
then
(()
=>
{
const
{
redirectUrl
,
deviceId
}
=
this
.
$route
.
query
const
{
redirectUrl
,
deviceId
,
homeRedirectUrl
}
=
this
.
$route
.
query
if
(
deviceId
)
{
if
(
deviceId
)
{
const
query
=
{
const
query
=
{
redirectUrl
,
redirectUrl
,
...
@@ -137,7 +137,7 @@ export default {
...
@@ -137,7 +137,7 @@ export default {
this
.
$router
.
replace
({
path
:
`/game`
,
query
})
this
.
$router
.
replace
({
path
:
`/game`
,
query
})
}
else
{
}
else
{
const
query
=
{
const
query
=
{
r
edirectUrl
,
homeR
edirectUrl
,
}
}
this
.
$router
.
replace
({
path
:
`/device`
,
query
})
this
.
$router
.
replace
({
path
:
`/device`
,
query
})
}
}
...
...
store/index.js
View file @
cc8adcc1
...
@@ -54,6 +54,7 @@ export const state = () => ({
...
@@ -54,6 +54,7 @@ export const state = () => ({
},
// 阿里云配置
},
// 阿里云配置
jackpot
:
[],
// jackpot信息
jackpot
:
[],
// jackpot信息
showSlot
:
false
,
// 是否显示品牌logo等内容
showSlot
:
false
,
// 是否显示品牌logo等内容
homeRedirectUrl
:
''
,
// 大厅退出返回url
})
})
export
const
getters
=
{
export
const
getters
=
{
...
@@ -204,6 +205,9 @@ export const mutations = {
...
@@ -204,6 +205,9 @@ export const mutations = {
SetShowSlot
(
state
,
data
)
{
SetShowSlot
(
state
,
data
)
{
state
.
showSlot
=
data
state
.
showSlot
=
data
},
},
SetHomeRedirectUrl
(
state
,
data
)
{
state
.
homeRedirectUrl
=
data
},
}
}
export
const
actions
=
{
export
const
actions
=
{
...
...
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