| | |
| | | * @throws Exception |
| | | */ |
| | | @GetMapping("/ssoLogin") |
| | | public String oaSsoLogin(@RequestParam("empCode") String empCode){ |
| | | public String oaSsoLogin(String empCode){ |
| | | String token; |
| | | try { |
| | | token = passwordFreeLoginService.ssoFreeLogin(empCode); |
| | |
| | | throw new ServiceException("单点登录获取token失败:"+e.getMessage()); |
| | | } |
| | | return token; |
| | | } |
| | | |
| | | /** |
| | | * 单点登录 |
| | | * @param empCode |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @GetMapping("/test") |
| | | public String test(@RequestParam("empCode") String empCode){ |
| | | String enStr2; |
| | | try { |
| | | // 加密 |
| | | String pwdfree = aesEncrypt("pwdfree", secretKey); |
| | | String pwdfree2 = aesEncrypt(pwdfree, clientId); |
| | | // 解密 |
| | | String enStr1 = aesDecrypt(empCode, secretKey); |
| | | enStr2 = aesDecrypt(enStr1, clientId); |
| | | }catch (Exception e){ |
| | | throw new ServiceException("单点登录获取token失败:"+e.getMessage()); |
| | | } |
| | | return enStr2; |
| | | } |
| | | |
| | | } |