|
@@ -15,6 +15,7 @@ import cn.kdan.pdf.tech.core.pojo.vo.SSOClientVO;
|
|
|
import cn.kdan.pdf.tech.core.pojo.vo.SSOMemberLicenseVO;
|
|
|
import cn.kdan.pdf.tech.core.pojo.vo.VppMemberVO;
|
|
|
import cn.kdan.pdf.tech.core.service.DirectoryService;
|
|
|
+import cn.kdan.pdf.tech.core.service.VppDeviceService;
|
|
|
import cn.kdan.pdf.tech.core.service.VppLicenseCodeService;
|
|
|
import cn.kdan.pdf.tech.core.service.VppMemberService;
|
|
|
import constant.CommonConstant;
|
|
@@ -27,6 +28,7 @@ import pojo.ResultMap;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.net.CookieManager;
|
|
|
|
|
|
/**
|
|
|
* @author tangxiangan
|
|
@@ -41,6 +43,8 @@ public class VppMemberController {
|
|
|
private VppLicenseCodeService licenseCodeService;
|
|
|
@Resource
|
|
|
private DirectoryService directoryService;
|
|
|
+ @Resource
|
|
|
+ private VppDeviceService deviceService;
|
|
|
|
|
|
/**
|
|
|
* 用户注册
|
|
@@ -129,16 +133,23 @@ public class VppMemberController {
|
|
|
throw new BackendRuntimeException(SSOConstant.EXCEPTION_MSG_MEMBER_REVOKED);
|
|
|
}
|
|
|
LicenseCodes codes = licenseCodeService.getByMemberId(member.getId(), productCode);
|
|
|
- if (!ObjectUtils.isEmpty(codes)) {
|
|
|
- throw new BackendRuntimeException(SSOConstant.EXCEPTION_MSG_MEMBER_HAS_ASSIGNED);
|
|
|
- }
|
|
|
+// if (ObjectUtils.isEmpty(codes)) {
|
|
|
+// throw new BackendRuntimeException(SSOConstant.EXCEPTION_MSG_MEMBER_HAS_ASSIGNED);
|
|
|
+// }
|
|
|
SSOMemberLicenseVO ssoMemberLicenseVO = new SSOMemberLicenseVO();
|
|
|
BeanUtils.copyProperties(member, ssoMemberLicenseVO);
|
|
|
- BeanUtils.copyProperties(codes, ssoMemberLicenseVO);
|
|
|
+ if (!ObjectUtils.isEmpty(codes)) {
|
|
|
+ BeanUtils.copyProperties(codes, ssoMemberLicenseVO);
|
|
|
+ }
|
|
|
|
|
|
- return new ResultMap<>(CommonConstant.SUCCESS, VppLicenseCodeConstant.SUCCESS_MSG_ASSIGN, ssoMemberLicenseVO);
|
|
|
+ return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, ssoMemberLicenseVO);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取微软配置
|
|
|
+ * @param email 邮箱
|
|
|
+ * @return SSOClientVO
|
|
|
+ */
|
|
|
@GetMapping("/getSSOInfo")
|
|
|
public ResultMap<SSOClientVO> getSSOInfo(@RequestParam("email") String email) {
|
|
|
VppMember member = vppMemberService.getByAccountSSO(email);
|
|
@@ -154,4 +165,15 @@ public class VppMemberController {
|
|
|
return new ResultMap<>(CommonConstant.SUCCESS, VppLicenseCodeConstant.SUCCESS_MSG_ASSIGN, vo);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * SSO用户登出
|
|
|
+ * @param deviceId 设备id
|
|
|
+ * @return Boolean
|
|
|
+ */
|
|
|
+ @PostMapping("cancelSSOMember")
|
|
|
+ public ResultMap<Boolean> cancelSSOMember(@RequestParam String deviceId) {
|
|
|
+ deviceService.cancel(deviceId);
|
|
|
+ return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, true);
|
|
|
+ }
|
|
|
+
|
|
|
}
|