Skip to content

Commit 6741223

Browse files
committed
恢复二维平面版地图页面 /twha/index.html
1 parent b7e9c94 commit 6741223

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

twha/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<html>
33
<head>
44
<meta charset="UTF-8">
5+
<link rel="icon" type="image/x-icon" href="../favicon.png?v=1.0">
6+
<link rel="shortcut icon" href="../favicon.png?v=1.0">
57
<style type="text/css"> @import "style.css"; </style>
68

79
<script>

vue.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const path = require('path')
2+
13
module.exports = {
24
"publicPath": "./",
35
"runtimeCompiler": false,
@@ -8,6 +10,21 @@ module.exports = {
810
"port": 8080,
911
"https": false,
1012
"hotOnly": true,
13+
before: function(app, server) {
14+
const fs = require('fs')
15+
app.get('/twha/', function(req, res) {
16+
res.sendFile(path.join(__dirname, 'twha/index.html'))
17+
})
18+
app.get('/twha/*', function(req, res, next) {
19+
const relativePath = req.path.replace('/twha', '')
20+
const filePath = path.join(__dirname, 'twha', relativePath)
21+
if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
22+
res.sendFile(filePath)
23+
} else {
24+
next()
25+
}
26+
})
27+
},
1128
},
1229
"transpileDependencies": [
1330
"vuetify"

0 commit comments

Comments
 (0)