fix: 修复相对路径只取第一级的BUG

修复相对路径只取第一级的BUG
This commit is contained in:
yaoyilin
2022-11-04 18:17:01 +08:00
parent d9f1161320
commit 3e05c5b3a0
2 changed files with 7 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ func main() {
//router.HTMLRender = LoadTemplates("views")
//router.GET("level/index", controller.Level.Index)
//router.GET("position/index", controller.Position.Index)
router.Router.Run(":9097") // 监听并在 0.0.0.0:8080 上启动服务
router.Router.Run(":9011") // 监听并在 0.0.0.0:8080 上启动服务
}
func LoadTemplates(templatesDir string) multitemplate.Renderer {

View File

@@ -26,8 +26,11 @@
<script type="text/javascript">
var url = window.location.pathname.substring(1);
var item = url.split("/");
var C = item[0];
var A = item[1];
var delItem = item.splice(item.length -1)
var A = delItem.join("")
var C = item.join("/")
// var C = item[0];
// var A = item[1];
var cUrl = "/" + C;
</script>
</head>