Compare commits

..

3 Commits

  1. 5
      cweb/src/main/java/com/hfkj/controller/GoodsController.java
  2. 46
      cweb/src/main/java/com/hfkj/controller/UserController.java

@ -55,8 +55,7 @@ public class GoodsController {
try { try {
List<GoodsModel> goodsList; List<GoodsModel> goodsList;
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
// 1:淘宝 2:拼多多 // 1:淘宝 2:拼多多
if (type == 1) { if (type == 1) {
@ -69,6 +68,8 @@ public class GoodsController {
goodsList = goodsDataService.goodsModelTaoBaoList(jsonObject); goodsList = goodsDataService.goodsModelTaoBaoList(jsonObject);
} else if (type == 2) { } else if (type == 2) {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String , Object> mapUser = new JSONObject(); Map<String , Object> mapUser = new JSONObject();
mapUser.put("uid", userSession.getUser().getId()); mapUser.put("uid", userSession.getUser().getId());
JSONObject object = PddService.authority(mapUser.toString()); JSONObject object = PddService.authority(mapUser.toString());

@ -14,6 +14,7 @@ import com.hfkj.entity.BsUserPlatformAuthorize;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.UserSessionObject; import com.hfkj.model.UserSessionObject;
import com.hfkj.service.pdd.PddService;
import com.hfkj.service.user.BsUserPlatformAuthorizeService; import com.hfkj.service.user.BsUserPlatformAuthorizeService;
import com.hfkj.service.user.BsUserService; import com.hfkj.service.user.BsUserService;
import com.hfkj.sysenum.user.UserAuthorizePlatformEnum; import com.hfkj.sysenum.user.UserAuthorizePlatformEnum;
@ -185,6 +186,51 @@ public class UserController {
} }
} }
@RequestMapping(value = "/userAccreditList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "用户授权列表")
public ResponseData userAccreditList() {
try {
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
JSONObject object = new JSONObject();
object.put("taobao", userSession.getUser().getRelationId() != null);
Map<String , Object> mapUser = new JSONObject();
mapUser.put("uid", userSession.getUser().getId());
// 判断是否需要授权
JSONObject jsonObject = PddService.authority(mapUser.toString());
boolean generateAuthorityUrl = jsonObject.getJSONObject("authorityQueryResponse").getInteger("bind") == 1;
object.put("pdd", generateAuthorityUrl);
return ResponseMsgUtil.success(object);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/taoBaoAccreditDelete", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "淘宝授权取消")
public ResponseData taoBaoAccreditDelete() {
try {
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
BsUser user = userService.getUser(userSession.getUser().getId());
user.setRelationId(null);
userService.editData(user);
return ResponseMsgUtil.success("取消成功");
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/bindPhone", method = RequestMethod.POST) @RequestMapping(value = "/bindPhone", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ApiOperation(value = "绑定手机号") @ApiOperation(value = "绑定手机号")

Loading…
Cancel
Save