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