Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fc-minigame
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈冲
fc-minigame
Commits
983ba494
Commit
983ba494
authored
Jun 02, 2026
by
陈冲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'更新path'
parent
e59fcc94
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
13 deletions
+34
-13
index.html
frontend-h5/index.html
+1
-1
Login.vue
frontend-h5/src/pages/Login.vue
+1
-1
vite.config.ts
frontend-h5/vite.config.ts
+6
-5
useAdminGameSocket.ts
frontend-large/src/composables/useAdminGameSocket.ts
+1
-1
Login.vue
frontend-large/src/pages/Login.vue
+1
-1
Game1.vue
frontend-large/src/pages/game1/Game1.vue
+1
-1
vite.config.ts
frontend-large/vite.config.ts
+23
-3
No files found.
frontend-h5/index.html
View file @
983ba494
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, viewport-fit=cover"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, viewport-fit=cover"
>
<title>
小游戏-H5
</title>
<title>
小游戏-H5
</title>
<style>body
{
background
:
#FA6047
;}
</style>
<style>body
{
background
:
#FA6047
;}
</style>
<script>
localStorage
.
setItem
(
'domain'
,
'
https://hddpserver.guocai365.org.cn
'
);
</script>
<script>
localStorage
.
setItem
(
'domain'
,
''
);
</script>
</head>
</head>
<body>
<body>
<div
id=
"app"
></div>
<div
id=
"app"
></div>
...
...
frontend-h5/src/pages/Login.vue
View file @
983ba494
...
@@ -40,7 +40,7 @@ const loginHandler = async () => {
...
@@ -40,7 +40,7 @@ const loginHandler = async () => {
telephone
:
'13111223344'
,
telephone
:
'13111223344'
,
avatar
:
'13111223344'
,
avatar
:
'13111223344'
,
});
});
await
router
.
replace
(
'/game1'
)
await
router
.
replace
(
'/
h5/
game1'
)
}
}
</
script
>
</
script
>
...
...
frontend-h5/vite.config.ts
View file @
983ba494
...
@@ -23,7 +23,8 @@ function copyImageAssets() {
...
@@ -23,7 +23,8 @@ function copyImageAssets() {
}
}
}
}
export
default
defineConfig
({
export
default
defineConfig
(({
command
})
=>
({
base
:
command
===
'build'
?
'/cc/h5/'
:
'/'
,
plugins
:
[
plugins
:
[
vue
(),
vue
(),
vueDevTools
(),
vueDevTools
(),
...
@@ -32,19 +33,19 @@ export default defineConfig({
...
@@ -32,19 +33,19 @@ export default defineConfig({
server
:
{
server
:
{
proxy
:
{
proxy
:
{
'/socket.io'
:
{
'/socket.io'
:
{
target
:
'http://1
27.0.0.1
:8082'
,
target
:
'http://1
92.168.1.23
:8082'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
ws
:
true
,
ws
:
true
,
},
},
'/manager'
:
{
'/manager'
:
{
target
:
'http://1
27.0.0.1
:8082'
,
target
:
'http://1
92.168.1.23
:8082'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
},
},
},
},
},
},
resolve
:
{
resolve
:
{
alias
:
{
alias
:
{
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
))
,
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
))
},
},
},
},
})
})
)
frontend-large/src/composables/useAdminGameSocket.ts
View file @
983ba494
...
@@ -58,7 +58,7 @@ export function useAdminGameSocket(options: AdminGameSocketOptions) {
...
@@ -58,7 +58,7 @@ export function useAdminGameSocket(options: AdminGameSocketOptions) {
offSocketMessage
=
onSocketMessage
(
async
(
evt
,
payload
:
SocketPayload
)
=>
{
offSocketMessage
=
onSocketMessage
(
async
(
evt
,
payload
:
SocketPayload
)
=>
{
const
{
msg
,
state
,
data
}
=
payload
const
{
msg
,
state
,
data
}
=
payload
if
(
$goto_login
(
evt
,
router
,
options
.
loginRedirectPath
??
'/game1'
))
{
if
(
$goto_login
(
evt
,
router
,
options
.
loginRedirectPath
??
'/
pc/
game1'
))
{
return
return
}
}
...
...
frontend-large/src/pages/Login.vue
View file @
983ba494
...
@@ -64,7 +64,7 @@ offSocketMessage = onSocketMessage(async (evt, { msg, state, data }) => {
...
@@ -64,7 +64,7 @@ offSocketMessage = onSocketMessage(async (evt, { msg, state, data }) => {
}
}
switch
(
evt
)
{
switch
(
evt
)
{
case
'room_create_result'
:
{
case
'room_create_result'
:
{
await
router
.
replace
(
'/game1'
)
await
router
.
replace
(
'/
pc/
game1'
)
break
;
break
;
}
}
}
}
...
...
frontend-large/src/pages/game1/Game1.vue
View file @
983ba494
...
@@ -97,7 +97,7 @@ function handleRoomState(data: any) {
...
@@ -97,7 +97,7 @@ function handleRoomState(data: any) {
const
{
startGame
,
createRoom
,
requestRoomState
}
=
useAdminGameSocket
({
const
{
startGame
,
createRoom
,
requestRoomState
}
=
useAdminGameSocket
({
gameId
:
'game1'
,
gameId
:
'game1'
,
loginRedirectPath
:
'/game1'
,
loginRedirectPath
:
'/
pc/
game1'
,
onGameStartRejected
:
gotoLoading
,
onGameStartRejected
:
gotoLoading
,
onRoomState
:
handleRoomState
,
onRoomState
:
handleRoomState
,
onRoomJoin
:
(
data
)
=>
{
onRoomJoin
:
(
data
)
=>
{
...
...
frontend-large/vite.config.ts
View file @
983ba494
...
@@ -6,12 +6,26 @@ import { defineConfig } from 'vite'
...
@@ -6,12 +6,26 @@ import { defineConfig } from 'vite'
import
vue
from
'@vitejs/plugin-vue'
import
vue
from
'@vitejs/plugin-vue'
import
vueDevTools
from
'vite-plugin-vue-devtools'
import
vueDevTools
from
'vite-plugin-vue-devtools'
const
buildBase
=
'/cc/pc/'
const
buildOutDir
=
'dist/cc/pc'
function
cleanLegacyDistOutput
()
{
return
{
name
:
'clean-legacy-dist-output'
,
closeBundle
()
{
rmSync
(
resolve
(
__dirname
,
'dist/assets'
),
{
recursive
:
true
,
force
:
true
})
rmSync
(
resolve
(
__dirname
,
'dist/index.html'
),
{
force
:
true
})
rmSync
(
resolve
(
__dirname
,
'dist/favicon.ico'
),
{
force
:
true
})
},
}
}
function
copyImageAssets
()
{
function
copyImageAssets
()
{
return
{
return
{
name
:
'copy-image-assets'
,
name
:
'copy-image-assets'
,
closeBundle
()
{
closeBundle
()
{
const
source
=
resolve
(
__dirname
,
'src/assets/images'
)
const
source
=
resolve
(
__dirname
,
'src/assets/images'
)
const
target
=
resolve
(
__dirname
,
'dist/
assets/images'
)
const
target
=
resolve
(
__dirname
,
buildOutDir
,
'
assets/images'
)
if
(
!
existsSync
(
source
))
{
if
(
!
existsSync
(
source
))
{
return
return
...
@@ -24,11 +38,17 @@ function copyImageAssets() {
...
@@ -24,11 +38,17 @@ function copyImageAssets() {
}
}
// https://vite.dev/config/
// https://vite.dev/config/
export
default
defineConfig
({
export
default
defineConfig
(({
command
})
=>
({
base
:
command
===
'build'
?
buildBase
:
'/'
,
build
:
{
outDir
:
buildOutDir
,
emptyOutDir
:
true
,
},
plugins
:
[
plugins
:
[
vue
(),
vue
(),
vueDevTools
(),
vueDevTools
(),
copyImageAssets
(),
copyImageAssets
(),
cleanLegacyDistOutput
(),
],
],
server
:
{
server
:
{
proxy
:
{
proxy
:
{
...
@@ -48,4 +68,4 @@ export default defineConfig({
...
@@ -48,4 +68,4 @@ export default defineConfig({
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
))
'@'
:
fileURLToPath
(
new
URL
(
'./src'
,
import
.
meta
.
url
))
},
},
},
},
})
})
)
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