XMTT 8 ans auparavant
Parent
commit
536151d578

+ 4 - 0
src/main/java/com/ekexiu/console/system/dao/UserDao.java

39
	@From(User.class)
39
	@From(User.class)
40
	int[] resetPassword(Connection con,@Batch  String[] id, @Set String loginPassword) throws SQLException;
40
	int[] resetPassword(Connection con,@Batch  String[] id, @Set String loginPassword) throws SQLException;
41

41

42
	@UpdateWith
43
	@From(User.class)
44
	int changePassword(Connection con, String id,@Set String loginPassword)throws SQLException;
45

42
	@IncludeFixSet("modifyTime")
46
	@IncludeFixSet("modifyTime")
43
	@UpdateWith
47
	@UpdateWith
44
	@From(User.class)
48
	@From(User.class)

+ 12 - 1
src/main/java/com/ekexiu/console/system/service/UserService.java

188
		this.userDao.resetPassword(con, ids, DEFAULT_PW_STR);
188
		this.userDao.resetPassword(con, ids, DEFAULT_PW_STR);
189
	}
189
	}
190

190

191
	@Post
192
	@Path("/cp")
193
	public void changePassword(@JdbcConn(true) Connection con,@LoginUser ConsoleAuthUser cau,String pw)throws SQLException {
194
			this.userDao.changePassword(con, cau.getId(),StringUtil.md5(pw));
195
	}
196

191
	@Get
197
	@Get
192
	@Path("/right/{id}")
198
	@Path("/right/{id}")
193
	public int[] getRights(@JdbcConn Connection con, @PathVar String id) throws SQLException {
199
	public int[] getRights(@JdbcConn Connection con, @PathVar String id) throws SQLException {
219
	@Get
225
	@Get
220
	@Path("/id/{id}")
226
	@Path("/id/{id}")
221
	public User query(@JdbcConn Connection con, @PathVar String id) throws SQLException {
227
	public User query(@JdbcConn Connection con, @PathVar String id) throws SQLException {
222
		return this.userDao.queryById(con, id);
228
		User user =  this.userDao.queryById(con, id);
229
		if (user != null) {
230
			user.setLoginPassword(null);
231
			user.setAuthinfo(null);
232
		}
233
		return user;
223
	}
234
	}
224

235

225
	@Get
236
	@Get