添加对应 php注册登录的token 验证逻辑

This commit is contained in:
2024-04-15 17:01:42 +08:00
parent de7cd23deb
commit 62db070f61
6 changed files with 109 additions and 177 deletions

View File

@@ -5,6 +5,8 @@ import (
"github.com/iapologizewhenimwrong/Vestmore_GO/utils/log"
)
var respLog = log.New(0)
// 全局返回的结构体
type Response struct {
Data interface{} `json:"data"`
@@ -25,7 +27,7 @@ func (resp *Response) Error(errcode *ErrorCode, Data ...interface{}) *Response {
resp.ErrorText = errcode.Message
resp.IsSuccess = false
resp.setData(Data)
log.Error(resp.ErrorText)
respLog.Error(resp.ErrorText)
return resp
}
@@ -38,7 +40,7 @@ func (resp *Response) ErrorErr(Code int, err error, Data ...interface{}) *Respon
resp.IsSuccess = false
resp.setData(Data)
log.Error(resp.ErrorText)
respLog.Error(resp.ErrorText)
return resp
}
@@ -50,7 +52,7 @@ func (resp *Response) ErrorMsg(Code int, Message string, Data ...interface{}) *R
resp.ErrorText = Message
resp.IsSuccess = false
resp.setData(Data)
log.Error(resp.ErrorText)
respLog.Error(resp.ErrorText)
return resp
}