Merge remote-tracking branch 'origin/master'
# Conflicts: # ruoyi-cms/src/main/java/com/ruoyi/cms/controller/CmsUserController.java
This commit is contained in:
commit
815ffbf39a
|
|
@ -1,7 +1,10 @@
|
||||||
package com.ruoyi.cms.controller;
|
package com.ruoyi.cms.controller;
|
||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.base.AjaxResult;
|
import com.ruoyi.common.base.AjaxResult;
|
||||||
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.exam.domain.*;
|
import com.ruoyi.exam.domain.*;
|
||||||
import cn.hutool.extra.servlet.ServletUtil;
|
import cn.hutool.extra.servlet.ServletUtil;
|
||||||
import com.ruoyi.exam.domain.ExamPractice;
|
import com.ruoyi.exam.domain.ExamPractice;
|
||||||
|
|
@ -96,6 +99,7 @@ public class CmsUserController {
|
||||||
user.setDelFlag("0");
|
user.setDelFlag("0");
|
||||||
user.setCreateTime(new Date());
|
user.setCreateTime(new Date());
|
||||||
user.setSalt( ShiroUtils.randomSalt() );
|
user.setSalt( ShiroUtils.randomSalt() );
|
||||||
|
user.setUserType( UserConstants.USER_VIP );
|
||||||
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
||||||
sysUserService.insertUser(user);
|
sysUserService.insertUser(user);
|
||||||
return success;
|
return success;
|
||||||
|
|
@ -246,5 +250,27 @@ public class CmsUserController {
|
||||||
success.put( "data", list );
|
success.put( "data", list );
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 保存头像
|
||||||
|
*/
|
||||||
|
@Log(title = "个人信息修改", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/user/update")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult update(SysUser user) {
|
||||||
|
if (sysUserService.updateUserInfo( user ) > 0) {
|
||||||
|
ShiroUtils.setSysUser( sysUserService.selectUserById( user.getUserId() ) );
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
|
||||||
|
@RequestMapping("/user/resetPwd")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult resetPwdSave(SysUser user) {
|
||||||
|
user.setSalt( ShiroUtils.randomSalt() );
|
||||||
|
user.setPassword( passwordService.encryptPassword( user.getLoginName(), user.getPassword(), user.getSalt() ) );
|
||||||
|
sysUserService.resetUserPwd( user );
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue