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
5ae180bd
Commit
5ae180bd
authored
Jul 07, 2023
by
毛线
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接tk
parent
0e7dadb3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
3 deletions
+70
-3
auth.js
middleware/auth.js
+1
-1
goToGame.vue
pages/goToGame.vue
+52
-0
index.vue
pages/index.vue
+5
-1
index.vue
pages/loading/index.vue
+12
-1
No files found.
middleware/auth.js
View file @
5ae180bd
import
{
Message
}
from
'element-ui'
import
{
getToken
}
from
'@/utils/auth'
// 验权
const
whiteList
=
[
'/loading'
,
'/login'
,
'/test'
,
'/index/test'
]
// 不重定向白名单
const
whiteList
=
[
'/loading'
,
'/login'
,
'/test'
,
'/index/test'
,
'/goToGame'
]
// 不重定向白名单
export
default
({
app
,
redirect
,
route
})
=>
{
const
{
fullPath
,
path
}
=
route
...
...
pages/goToGame.vue
0 → 100644
View file @
5ae180bd
<
template
>
<div/>
</
template
>
<
script
>
import
{
setToken
,
setImToken
,
setUserData
,
}
from
'@/utils/auth'
// 验权
export
default
{
data
()
{
return
{}
},
created
()
{
// https://app-dev.eslotsys.com/goToGame?ticket=a079fbdf3ac4463f9dd67632d990c940
const
{
ticket
}
=
this
.
$route
.
query
if
(
ticket
)
{
this
.
network
().
getInfo
(
ticket
)
}
},
methods
:
{
network
()
{
return
{
getInfo
:
(
ticket
)
=>
{
const
params
=
{
ticket
,
}
this
.
$request
({
url
:
'/api/gaming/getGagingInfoByTicket'
,
method
:
'get'
,
params
,
}).
then
(({
data
})
=>
{
const
{
deviceId
,
imToken
,
redirectUrl
,
token
}
=
data
setUserData
({
token
,
openImToken
:
imToken
})
const
query
=
{
redirectUrl
,
deviceId
,
}
console
.
log
(
'query'
,
query
)
this
.
$request
({
url
:
'/api/gaming'
,
method
:
'post'
,
data
:
{
deviceId
,
},
}).
then
(({
data
})
=>
{
this
.
$router
.
replace
({
path
:
'/loading'
,
query
,
})
})
})
},
}
},
},
}
</
script
>
pages/index.vue
View file @
5ae180bd
...
...
@@ -195,7 +195,11 @@ export default {
break
case
10004
:
// 退出设备成功
case
10015
:
// 后台提出游戏
this
.
$router
.
replace
(
'/device'
)
if
(
this
.
$route
.
query
.
redirectUrl
)
{
location
.
replace
(
this
.
$route
.
query
.
redirectUrl
)
}
else
{
this
.
$router
.
replace
(
'/device'
)
}
break
case
10002
:
// 即将超出最大未操作时长,60秒后将踢出游戏
Message
({
...
...
pages/loading/index.vue
View file @
5ae180bd
...
...
@@ -123,7 +123,18 @@ export default {
const
token
=
getToken
()
if
(
token
)
{
this
.
GetBaseInfo
().
then
(()
=>
{
this
.
$router
.
replace
(
'/device'
)
const
{
redirectUrl
,
deviceId
}
=
this
.
$route
.
query
if
(
deviceId
)
{
const
params
=
{
id
:
deviceId
,
}
const
query
=
{
redirectUrl
,
}
this
.
$router
.
replace
({
path
:
`/game/
${
deviceId
}
`
,
params
,
query
})
}
else
{
this
.
$router
.
replace
(
'/device'
)
}
}).
catch
(()
=>
{
this
.
$router
.
replace
(
'/login'
)
})
...
...
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