Browse Source

终端设置安全码加密

tags/v2.1
RuoYi 4 years ago
parent
commit
394bde5e8e
  1. 3
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysClientDetailsController.java

3
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysClientDetailsController.java

@ -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