mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-02-10 08:05:37 +08:00
初始化
This commit is contained in:
18
internal/web/actions/default/index/index.go
Normal file
18
internal/web/actions/default/index/index.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
stringutil "github.com/iwind/TeaGo/utils/string"
|
||||
)
|
||||
|
||||
type IndexAction actions.Action
|
||||
|
||||
// 首页(登录页)
|
||||
|
||||
var TokenSalt = stringutil.Rand(32)
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
From string
|
||||
}) {
|
||||
this.WriteString("Hello, i am index")
|
||||
}
|
||||
13
internal/web/actions/default/index/init.go
Normal file
13
internal/web/actions/default/index/init.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.Prefix("/").
|
||||
GetPost("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user