[change] setup api return port and admin root

This commit is contained in:
Max 2022-10-28 19:46:14 +08:00
parent d041b2a760
commit 43c1dfd895

View file

@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/yaoapp/kun/exception" "github.com/yaoapp/kun/exception"
"github.com/yaoapp/xun" "github.com/yaoapp/xun"
"github.com/yaoapp/yao/widgets/app"
) )
// recovered custom recovered // recovered custom recovered
@ -91,10 +92,18 @@ func runSetup(c *gin.Context) {
return return
} }
adminRoot := "yao"
if app.Setting.AdminRoot != "" {
adminRoot = app.Setting.AdminRoot
}
adminRoot = strings.Trim(adminRoot, "/")
c.JSON(200, gin.H{ c.JSON(200, gin.H{
"code": 200, "code": 200,
"message": "安装成功", "message": "安装成功",
"urls": urls, "urls": urls,
"port": cfg.Port,
"root": adminRoot,
}) })
Complete() Complete()