瀏覽代碼

修改签到BUG

zhou.xiaoning 3 年之前
父節點
當前提交
c28fcc3d1c
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      controllers/ferroalloy/score.go

+ 2 - 1
controllers/ferroalloy/score.go

@@ -6,6 +6,7 @@ import (
 	"mtp2_if/logger"
 	"mtp2_if/models"
 	"net/http"
+	"strconv"
 
 	"github.com/gin-gonic/gin"
 )
@@ -26,7 +27,7 @@ func Signin(c *gin.Context) {
 
 	// 判断Token与UserID是否对应
 	userID, exists := c.Get("requserid")
-	if !exists || userID != m.USERID {
+	if !exists || userID != strconv.Itoa(int(m.USERID)) {
 		a.Response(http.StatusBadRequest, e.ERROR_OPERATION_FAILED, nil)
 		return
 	}