mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-20 17:57:54 +00:00
gorm升级到v2版本
This commit is contained in:
@@ -28,4 +28,4 @@ func InitApplication(cfg *viper.Viper) *Application {
|
||||
}
|
||||
}
|
||||
|
||||
var ApplicationConfig = new(Application)
|
||||
var ApplicationConfig = new(Application)
|
||||
|
||||
@@ -81,4 +81,3 @@ func Setup(path string) {
|
||||
}
|
||||
GenConfig = InitGen(cfgGen)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
//获取当前路径,比如:E:/abc/data/test
|
||||
|
||||
+5
-5
@@ -20,7 +20,7 @@ func GetUserId(c *gin.Context) int {
|
||||
if data["identity"] != nil {
|
||||
return int((data["identity"]).(float64))
|
||||
}
|
||||
fmt.Println(GetCurrentTimeStr()+" [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetUserId 缺少identity")
|
||||
fmt.Println(GetCurrentTimeStr() + " [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetUserId 缺少identity")
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ func GetUserIdStr(c *gin.Context) string {
|
||||
if data["identity"] != nil {
|
||||
return Int64ToString(int64((data["identity"]).(float64)))
|
||||
}
|
||||
fmt.Println(GetCurrentTimeStr()+" [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetUserIdStr 缺少identity")
|
||||
fmt.Println(GetCurrentTimeStr() + " [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetUserIdStr 缺少identity")
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func GetUserName(c *gin.Context) string {
|
||||
if data["nice"] != nil {
|
||||
return (data["nice"]).(string)
|
||||
}
|
||||
fmt.Println(GetCurrentTimeStr()+" [WARING] "+ c.Request.Method +" " + c.Request.URL.Path + " GetUserName 缺少nice")
|
||||
fmt.Println(GetCurrentTimeStr() + " [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetUserName 缺少nice")
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func GetRoleName(c *gin.Context) string {
|
||||
if data["rolekey"] != nil {
|
||||
return (data["rolekey"]).(string)
|
||||
}
|
||||
fmt.Println(GetCurrentTimeStr()+" [WARING] "+ c.Request.Method +" " + c.Request.URL.Path + " GetRoleName 缺少rolekey")
|
||||
fmt.Println(GetCurrentTimeStr() + " [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetRoleName 缺少rolekey")
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -57,6 +57,6 @@ func GetRoleId(c *gin.Context) int {
|
||||
i := int((data["roleid"]).(float64))
|
||||
return i
|
||||
}
|
||||
fmt.Println(GetCurrentTimeStr()+" [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetRoleId 缺少roleid")
|
||||
fmt.Println(GetCurrentTimeStr() + " [WARING] " + c.Request.Method + " " + c.Request.URL.Path + " GetRoleId 缺少roleid")
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user