✨ 优化返回包装类和首页不做判断
This commit is contained in:
parent
42b9a3ac5a
commit
fea7f324af
@ -28,9 +28,9 @@ func R(ctx *gin.Context) *rs {
|
||||
|
||||
// Result 手动组装返回结果
|
||||
func (r rs) Result(code int, data interface{}, msg string) {
|
||||
if data == nil {
|
||||
data = map[string]interface{}{}
|
||||
}
|
||||
//if data == nil {
|
||||
// data = map[string]interface{}{}
|
||||
//}
|
||||
r.ctx.JSON(code, response{
|
||||
code,
|
||||
data,
|
||||
|
@ -14,6 +14,11 @@ import (
|
||||
// CheckDeviceId 检查是否存在设备指纹
|
||||
func CheckDeviceId() gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
p := ctx.Request.URL.Path
|
||||
if p == "/" {
|
||||
ctx.Next()
|
||||
return
|
||||
}
|
||||
// 取出设备指纹
|
||||
deviceId := ctx.Request.Header.Get("di")
|
||||
if deviceId == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user