mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 18:20:50 +00:00
修改后端首页为文档主页
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import(
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
const INDEX = `
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>GO-ADMIN欢迎您</title>
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
overflow-y:hidden
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.onerror=function(){return true;}
|
||||||
|
$(function(){
|
||||||
|
headerH = 0;
|
||||||
|
var h=$(window).height();
|
||||||
|
$("#iframe").height((h-headerH)+"px");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe id="iframe" frameborder="0" src="http://doc.zhangwj.com/go-admin-site/" style="width:100%;"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`
|
||||||
|
|
||||||
|
|
||||||
|
func HelloWorld(c *gin.Context){
|
||||||
|
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||||
|
c.String(200, INDEX)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -28,7 +28,7 @@ func InitRouter() *gin.Engine {
|
|||||||
r.Use(middleware.RequestId())
|
r.Use(middleware.RequestId())
|
||||||
r.Use(middleware.DemoEvn())
|
r.Use(middleware.DemoEvn())
|
||||||
|
|
||||||
r.GET("/", handler.HelloGoAdmin)
|
r.GET("/", system.HelloWorld)
|
||||||
r.Static("/static", "./static")
|
r.Static("/static", "./static")
|
||||||
r.GET("/info", handler.Ping)
|
r.GET("/info", handler.Ping)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user