diff --git a/common/dao/staff_token.go b/common/dao/staff_token.go index 6a1b1c3..4e47fe8 100644 --- a/common/dao/staff_token.go +++ b/common/dao/staff_token.go @@ -15,7 +15,7 @@ func NewStaffTokenDao() *StaffTokenDao { } func (d *StaffTokenDao) TableName() string { - return "staff_token" + return "user_token" } func (d *StaffTokenDao) Create(o *model.StaffToken) (int64, error) { diff --git a/server/controller/staff.go b/server/controller/staff.go index cdc3945..6f97f67 100644 --- a/server/controller/staff.go +++ b/server/controller/staff.go @@ -19,7 +19,8 @@ func (s *Staff) Login(ctx *gin.Context) { var req api.StaffLoginReq session.CheckParamError(ctx.ShouldBindJSON(&req)) sess := ctx.Keys[session.ContextSession].(*session.AdminSession) - new(service.StaffUser).Login(sess, &req) + data := new(service.StaffUser).Login(sess, &req) + ctx.JSON(http.StatusOK, session.NewRsp(data)) } func (s *Staff) Salary(ctx *gin.Context) {