chore: replace 'token' with power

This commit is contained in:
RockYang
2024-02-23 18:11:57 +08:00
parent 66c0d1b2f7
commit 668d4c9c64
11 changed files with 397 additions and 212 deletions

View File

@@ -80,7 +80,7 @@ func (h *UserHandler) Register(c *gin.Context) {
// check if the username is exists
var item model.User
res := h.db.Where("username = ?", data.Username).First(&item)
if res.RowsAffected > 0 {
if item.Id > 0 {
resp.ERROR(c, "该用户名已经被注册")
return
}
@@ -257,7 +257,7 @@ type userProfile struct {
Calls int `json:"calls"`
ImgCalls int `json:"img_calls"`
TotalTokens int64 `json:"total_tokens"`
Tokens int64 `json:"tokens"`
Tokens int `json:"tokens"`
ExpiredTime int64 `json:"expired_time"`
Vip bool `json:"vip"`
}