chore: set guest while token is empty

This commit is contained in:
Noah Hsu
2022-06-26 16:39:02 +08:00
parent 54ca68e4b3
commit 7cbfe93a02
6 changed files with 31 additions and 8 deletions

View File

@ -11,8 +11,8 @@ type Resp struct {
Data interface{} `json:"data"`
}
func ErrorResp(c *gin.Context, err error, code int, noLog ...bool) {
if len(noLog) != 0 && noLog[0] {
func ErrorResp(c *gin.Context, err error, code int, l ...bool) {
if len(l) != 0 && l[0] {
log.Errorf("%+v", err)
}
c.JSON(200, Resp{