Ver Código Fonte

更优雅的实现传递去除password和salt

xiaochen 7 anos atrás
pai
commit
982ea5cae0

+ 1 - 4
src/main/java/io/renren/modules/sys/controller/SysUserController.java

57
	 */
57
	 */
58
	@GetMapping("/info")
58
	@GetMapping("/info")
59
	public R info(){
59
	public R info(){
60
		SysUserEntity user = getUser();
61
		user.setSalt("");
62
		user.setPassword("");
63
		return R.ok().put("user", user);
60
		return R.ok().put("user", getUser());
64
	}
61
	}
65
	
62
	
66
	/**
63
	/**

+ 3 - 0
src/main/java/io/renren/modules/sys/entity/SysUserEntity.java

3
import com.baomidou.mybatisplus.annotations.TableField;
3
import com.baomidou.mybatisplus.annotations.TableField;
4
import com.baomidou.mybatisplus.annotations.TableId;
4
import com.baomidou.mybatisplus.annotations.TableId;
5
import com.baomidou.mybatisplus.annotations.TableName;
5
import com.baomidou.mybatisplus.annotations.TableName;
6
import com.fasterxml.jackson.annotation.JsonIgnore;
6
import io.renren.common.validator.group.AddGroup;
7
import io.renren.common.validator.group.AddGroup;
7
import io.renren.common.validator.group.UpdateGroup;
8
import io.renren.common.validator.group.UpdateGroup;
8
import org.hibernate.validator.constraints.Email;
9
import org.hibernate.validator.constraints.Email;
123
	 * 获取:密码
124
	 * 获取:密码
124
	 * @return String
125
	 * @return String
125
	 */
126
	 */
127
	@JsonIgnore
126
	public String getPassword() {
128
	public String getPassword() {
127
		return password;
129
		return password;
128
	}
130
	}
207
		this.createUserId = createUserId;
209
		this.createUserId = createUserId;
208
	}
210
	}
209
211
212
	@JsonIgnore
210
	public String getSalt() {
213
	public String getSalt() {
211
		return salt;
214
		return salt;
212
	}
215
	}