| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.base.smo.front.AbstractFrontServiceSMO; |
| | | import com.java110.api.properties.WechatAuthProperties; |
| | | import com.java110.api.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.api.smo.staff.IStaffAuthSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.context.PageData; |
| | | import com.java110.core.factory.WechatFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.smallWeChat.SmallWeChatDto; |
| | | import com.java110.api.properties.WechatAuthProperties; |
| | | import com.java110.api.smo.staff.IStaffAuthSMO; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.constant.WechatConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | * wx登录 |
| | | */ |
| | | @Service("staffAuthSMOImpl") |
| | | public class StaffAuthSMOImpl extends AbstractFrontServiceSMO implements IStaffAuthSMO { |
| | | public class StaffAuthSMOImpl extends DefaultAbstractComponentSMO implements IStaffAuthSMO { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(StaffAuthSMOImpl.class); |
| | | |
| | |
| | | |
| | | String openUrl = ""; |
| | | String url = MappingCache.getValue("OWNER_WECHAT_URL"); |
| | | url = url |
| | | + "/app/loginStaffWechatAuth?appId=992020061452450002&staffId=" |
| | | + staffId + "&storeId=" + storeId + "&wId=" + WechatFactory.getWId(smallWeChatDto.getAppId()) |
| | | + "&communityId=" + communityId; |
| | | |
| | | if (url.contains("?")) { |
| | | url += ("&wAppId=" + smallWeChatDto.getAppId()); |
| | | } else { |
| | | url += ("?wAppId=" + smallWeChatDto.getAppId()); |
| | | } |
| | | try { |
| | | openUrl = WechatConstant.OPEN_AUTH |
| | | .replace("APPID", smallWeChatDto.getAppId()) |
| | |
| | | .replace( |
| | | "REDIRECT_URL", |
| | | URLEncoder |
| | | .encode( |
| | | (url |
| | | + "/app/loginStaffWechatAuth?appId=992020061452450002&staffId=" |
| | | + staffId + "&storeId=" + storeId + "&wId=" + WechatFactory.getWId(smallWeChatDto.getAppId())) |
| | | + "&communityId=" + communityId, |
| | | .encode(url, |
| | | "UTF-8")).replace("STATE", "1"); |
| | | response.sendRedirect(openUrl); |
| | | } catch (Exception e) { |