开始新增代码生成配置2.0功能,配置文件格式规定完成
This commit is contained in:
+6
-2
@@ -13,15 +13,19 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(time.Now().Weekday().String())
|
||||
date, _ := time.Parse("2006-01-02 15:04", time.Now().Format("2006-01-02")+" 14:00")
|
||||
fmt.Println(date, date.Unix())
|
||||
appIns := hotime.Init("config/config.json")
|
||||
//RESTfull接口适配
|
||||
appIns.SetConnectListener(func(context *hotime.Context) bool {
|
||||
|
||||
if len(context.RouterString)>1&& context.RouterString[0] == "admin" {
|
||||
if len(context.RouterString) > 1 && context.RouterString[0] == "admin" {
|
||||
if context.RouterString[1] == "hotime" && context.RouterString[2] == "login" {
|
||||
return true
|
||||
}
|
||||
if context.RouterString[1] == "hotime" && context.RouterString[2] == "logout" {
|
||||
return true
|
||||
}
|
||||
|
||||
if context.Session("admin_id").Data == nil {
|
||||
context.Display(2, "你还没有登录")
|
||||
|
||||
Reference in New Issue
Block a user