终端设置安全码加密

2.X
RuoYi 5 years ago committed by 疯狂的狮子li
parent 7b11cbf536
commit 73ac66385b

@ -17,6 +17,7 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.domain.SysClientDetails; import com.ruoyi.system.domain.SysClientDetails;
import com.ruoyi.system.service.ISysClientDetailsService; import com.ruoyi.system.service.ISysClientDetailsService;
@ -67,6 +68,7 @@ public class SysClientDetailsController extends BaseController
{ {
return AjaxResult.error("新增终端'" + clientId + "'失败,编号已存在"); return AjaxResult.error("新增终端'" + clientId + "'失败,编号已存在");
} }
sysClientDetails.setClientSecret(SecurityUtils.encryptPassword(sysClientDetails.getClientSecret()));
return toAjax(sysClientDetailsService.insertSysClientDetails(sysClientDetails)); return toAjax(sysClientDetailsService.insertSysClientDetails(sysClientDetails));
} }
@ -78,6 +80,7 @@ public class SysClientDetailsController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody SysClientDetails sysClientDetails) public AjaxResult edit(@RequestBody SysClientDetails sysClientDetails)
{ {
sysClientDetails.setClientSecret(SecurityUtils.encryptPassword(sysClientDetails.getClientSecret()));
return toAjax(sysClientDetailsService.updateSysClientDetails(sysClientDetails)); return toAjax(sysClientDetailsService.updateSysClientDetails(sysClientDetails));
} }

Loading…
Cancel
Save