|
@@ -59,8 +59,23 @@ func (this *BaseCommonController) Prepare() {
|
|
|
this.StopRun()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ var wxUser *models.WxUserItem
|
|
|
+ if session.UserId > 0{
|
|
|
+ tmpWxUser, tmpErr := services.GetWxUserItemByUserId(session.UserId,utils.WxPcPlatform)
|
|
|
+ wxUser = tmpWxUser
|
|
|
+ err = tmpErr
|
|
|
+ }else if session.OpenId != ""{
|
|
|
+ tmpWxUser, tmpErr := services.GetWxUserItemByOpenId(session.OpenId)
|
|
|
+ wxUser = tmpWxUser
|
|
|
+ err = tmpErr
|
|
|
+ }else{
|
|
|
+ this.JSON(models.BaseResponse{Ret: 408, Msg: "数据异常!", ErrMsg: "sesson is empty "}, false, false)
|
|
|
+ this.StopRun()
|
|
|
+ return
|
|
|
+ }
|
|
|
//wxUser, err := models.GetWxUserItemByUserId(session.UserId)
|
|
|
- wxUser, err := services.GetWxUserItemByOpenId(session.OpenId)
|
|
|
+ //wxUser, err := services.GetWxUserItemByOpenId(session.OpenId)
|
|
|
if err != nil {
|
|
|
//没有找到记录
|
|
|
if err.Error() == utils.ErrNoRow() {
|