fix: 修复获取全部/文件读取/ReqShop/ReqShopReqShop 请求错误
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -56,8 +56,13 @@ type ReqShopReq struct {
|
||||
func (c *BaseSysUserController) ReqShop(ctx context.Context, req *ReqShopReq) (res *cool.BaseRes, err error) {
|
||||
t := cool.GetAdmin(ctx)
|
||||
|
||||
if !playerservice.NewTaskService(uint32(t.UserId)).CanShop() {
|
||||
return cool.Fail("不满足申请条件"), nil
|
||||
user := service.NewBaseSysUserService().GetPerson(uint32(t.UserId))
|
||||
if user == nil || user.QQ == 0 {
|
||||
return cool.Fail("请先绑定QQ"), nil
|
||||
}
|
||||
|
||||
if err := playerservice.NewTaskService(uint32(t.UserId)).ShopRequirementError(); err != nil {
|
||||
return cool.Fail(err.Error()), nil
|
||||
}
|
||||
cool.DBM(&model.BaseSysUserRole{}).Data("roleId", "27", "userId", t.UserId).Save()
|
||||
res = cool.Ok(nil)
|
||||
|
||||
Reference in New Issue
Block a user