| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | |
| | | public Long getAreaId() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long areaId = loginUserInfo.getAreaId(); |
| | | if (null == areaId || 0 == areaId) { |
| | | throw new ServiceException("用户未绑定社区"); |
| | | if (null == areaId) { |
| | | throw new ServiceException("用户未绑定小区"); |
| | | } |
| | | return areaId; |
| | | } |
| | | /** |
| | | * 获取登录对象所在区域编码 |
| | | * |
| | | * @return |
| | | */ |
| | | public String getAreaCode() { |
| | | String appid = this.getRequest().getHeader("appid"); |
| | | if(StringUtils.isNotEmpty(appid)){ |
| | | if(appid.equals("wx08932ba29546ff82")){ |
| | | return "510411"; |
| | | } |
| | | else if(appid.equals("wx50d8c395af50481b")){ |
| | | return "510402"; |
| | | } |
| | | else { |
| | | return "510423"; |
| | | } |
| | | } |
| | | else { |
| | | LoginUserInfoVO loginUserInfoVO=this.getLoginUserInfo(); |
| | | ComActVO comActVO=loginUserInfoVO.getComActVO(); |
| | | if(comActVO!=null){ |
| | | return comActVO.getAreaCode(); |
| | | } |
| | | return "510423"; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取登录token |
| | |
| | | return header; |
| | | } |
| | | |
| | | public String getAppId(){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | return loginUserInfo.getAppId(); |
| | | } |
| | | |
| | | public String getAppSecret(){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | return loginUserInfo.getAppSecret(); |
| | | } |
| | | /** |
| | | * 获取登录对象所有信息 |
| | | * |