|
|
@ -30,6 +30,7 @@ import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
@ -160,17 +161,23 @@ public class UserController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@OptionalLog(module = "重置密码",methods = "用户管理",fieldName = "userName",tableName = "power_user")
|
|
|
|
|
|
|
|
@RequiresPermissions(value="/user/resetPassword")
|
|
|
|
|
|
|
|
@RequestMapping("/resetPassword")
|
|
|
|
@RequestMapping("/resetPassword")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public Msg update(Integer userId) throws Exception{
|
|
|
|
public Msg update(String ids) throws Exception{
|
|
|
|
ServletRequestAttributes attr=(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
|
ServletRequestAttributes attr=(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
|
HttpServletRequest request =attr.getRequest();
|
|
|
|
HttpServletRequest request =attr.getRequest();
|
|
|
|
Power_UserVo powerUser = powerUserService.selectByPrimaryKey(userId);
|
|
|
|
// Power_UserVo powerUser = powerUserService.selectByPrimaryKey(userId);
|
|
|
|
powerUser.setUserPwd(Base64.encode(MD5.KL("000000")));
|
|
|
|
// powerUser.setUserPwd(Base64.encode(MD5.KL("000000")));
|
|
|
|
powerUserService.updateByPrimaryKeySelective(powerUser,request);
|
|
|
|
// powerUserService.updateByPrimaryKeySelective(powerUser,request);
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
// CacheManager.addExcCount("noExc");
|
|
|
|
|
|
|
|
//取得当前登录账号
|
|
|
|
|
|
|
|
HttpSession session= request.getSession();
|
|
|
|
|
|
|
|
Power_User powerUser1 =(Power_User) session.getAttribute("CURRENT_USER");
|
|
|
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
|
|
|
|
|
String date = df.format(new Date());// new Date()为获取当前系统时间
|
|
|
|
|
|
|
|
String userName = powerUser1.getUserName();
|
|
|
|
|
|
|
|
String encode = Base64.encode(MD5.KL("000000"));
|
|
|
|
|
|
|
|
powerUserService.updateUserPass(ids,userName,encode,date);
|
|
|
|
return Msg.success();
|
|
|
|
return Msg.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@RequestMapping("/selectUser")
|
|
|
|
@RequestMapping("/selectUser")
|
|
|
|