Selaa lähdekoodia

Merge branch 'TT'

XMTT 8 vuotta sitten
vanhempi
commit
8afca234b3

+ 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

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

191

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

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

236

226
	@Get
237
	@Get