结构调整添加cmd
This commit is contained in:
1 parent
f2829bfd98
commit
a2f4c00246
72 files changed
+838
-597
No files matched your search
+6
-6
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/mssola/user_agent"
|
||||
"go-admin/models"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
"go-admin/pkg/utils"
|
||||
"go-admin/tools"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
@@ -57,9 +57,9 @@ func Authenticator(c *gin.Context) (interface{}, error) {
|
||||
|
||||
ua := user_agent.New(c.Request.UserAgent())
|
||||
loginlog.Ipaddr = c.ClientIP()
|
||||
location := utils.GetLocation(c.ClientIP())
|
||||
location := tools.GetLocation(c.ClientIP())
|
||||
loginlog.LoginLocation = location
|
||||
loginlog.LoginTime = utils.GetCurrntTime()
|
||||
loginlog.LoginTime = tools.GetCurrntTime()
|
||||
loginlog.Status = "0"
|
||||
loginlog.Remark = c.Request.UserAgent()
|
||||
browserName, browserVersion := ua.Browser()
|
||||
@@ -110,16 +110,16 @@ func LogOut(c *gin.Context) {
|
||||
var loginlog models.LoginLog
|
||||
ua := user_agent.New(c.Request.UserAgent())
|
||||
loginlog.Ipaddr = c.ClientIP()
|
||||
location := utils.GetLocation(c.ClientIP())
|
||||
location := tools.GetLocation(c.ClientIP())
|
||||
loginlog.LoginLocation = location
|
||||
loginlog.LoginTime = utils.GetCurrntTime()
|
||||
loginlog.LoginTime = tools.GetCurrntTime()
|
||||
loginlog.Status = "0"
|
||||
loginlog.Remark = c.Request.UserAgent()
|
||||
browserName, browserVersion := ua.Browser()
|
||||
loginlog.Browser = browserName + " " + browserVersion
|
||||
loginlog.Os = ua.OS()
|
||||
loginlog.Platform = ua.Platform()
|
||||
loginlog.Username = utils.GetUserName(c)
|
||||
loginlog.Username = tools.GetUserName(c)
|
||||
loginlog.Msg = "退出成功"
|
||||
loginlog.Create()
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/tools/app"
|
||||
)
|
||||
|
||||
func HelloGoAdmin(c *gin.Context) {
|
||||
app.OK(c,"欢迎使用go-admin 中后台脚手架","")
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/shirou/gopsutil/disk"
|
||||
"github.com/shirou/gopsutil/load"
|
||||
"github.com/shirou/gopsutil/mem"
|
||||
"go-admin/pkg/app"
|
||||
"go-admin/tools/app"
|
||||
"net/http"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
Reference in new issue
Block a user