diff --git a/server/service/pay.go b/server/service/pay.go index e8e7db0..503f000 100644 --- a/server/service/pay.go +++ b/server/service/pay.go @@ -45,6 +45,17 @@ func (p *Pay) AlipayAuth(sess *session.AdminSession, authCode, state string) int panic(config.ErrInternal.New().Append(goutil.EncodeJSON(res))) } + if state != "" { + staffUser, err := dao.NewStaffUserDao().Get(cast.ToInt64(state)) + session.CheckDBError(err) + session.CheckNilError(staffUser) + payee := staffUser.GetPayee() + payee.AlipayUid = res.UserId + staffUser.Payee = goutil.EncodeJSON(payee) + err = dao.NewStaffUserDao().Update(staffUser) + session.CheckDBError(err) + } + data := make(map[string]interface{}) data["state"] = state data["userid"] = res.UserId