提交 c8c1b752 authored 作者: gongwenjie's avatar gongwenjie

代码修改

上级 31158068
package com.zjty.tynotes.pas.config; package com.zjty.tynotes.pas.config;
import com.zjty.tynotes.pas.config.handler.MyFailHandler;
import com.zjty.tynotes.pas.dao.AuthorityDao; import com.zjty.tynotes.pas.dao.AuthorityDao;
import com.zjty.tynotes.pas.dao.RoleAuthorityDao; import com.zjty.tynotes.pas.dao.RoleAuthorityDao;
import com.zjty.tynotes.pas.dao.RoleDao; import com.zjty.tynotes.pas.dao.RoleDao;
...@@ -49,7 +50,7 @@ public class MyUserDetailsServiceImpl implements UserDetailsService { ...@@ -49,7 +50,7 @@ public class MyUserDetailsServiceImpl implements UserDetailsService {
@Autowired @Autowired
private Init init; private Init init;
@Override @Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{
System.out.println("userService验证:" + username); System.out.println("userService验证:" + username);
if(username.equals("root")){ if(username.equals("root")){
User root = init.root; User root = init.root;
...@@ -97,6 +98,9 @@ public class MyUserDetailsServiceImpl implements UserDetailsService { ...@@ -97,6 +98,9 @@ public class MyUserDetailsServiceImpl implements UserDetailsService {
user.setArrayList(list); user.setArrayList(list);
} }
if(user==null){
throw new UsernameNotFoundException("用户名或密码不正确");
}
return user; return user;
} }
} }
......
...@@ -50,7 +50,6 @@ public class User implements UserDetails, Serializable { ...@@ -50,7 +50,6 @@ public class User implements UserDetails, Serializable {
@ApiModelProperty(value = "联系方式",example = "113665465465") @ApiModelProperty(value = "联系方式",example = "113665465465")
private String phone1; private String phone1;
@NotEmpty(message = "联系方式不可为空")
@ApiModelProperty(value = "联系方式",example = "113665465465") @ApiModelProperty(value = "联系方式",example = "113665465465")
private String phone2; private String phone2;
......
...@@ -40,7 +40,7 @@ public class ConfigServiceImpl implements ConfigService { ...@@ -40,7 +40,7 @@ public class ConfigServiceImpl implements ConfigService {
holidayRequest.getStartDate(), holidayRequest.getEndDate()); holidayRequest.getStartDate(), holidayRequest.getEndDate());
List<Date> dates = new ArrayList<>(); List<Date> dates = new ArrayList<>();
for (Day day : days) { for (Day day : days) {
String format = sdf.format(day); String format = sdf.format(day.getDate());
try { try {
Date parse = sdf.parse(format); Date parse = sdf.parse(format);
dates.add(parse); dates.add(parse);
......
...@@ -14,7 +14,7 @@ server.ssl.keyStoreType=PKCS12 ...@@ -14,7 +14,7 @@ server.ssl.keyStoreType=PKCS12
server.ssl.keyAlias= alias server.ssl.keyAlias= alias
#mongodb configuration #mongodb configuration
spring.data.mongodb.uri=mongodb://localhost:27017/test2 spring.data.mongodb.uri=mongodb://localhost:27017/test3
# servlet configuration # servlet configuration
spring.servlet.multipart.max-file-size=100MB spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=1000MB spring.servlet.multipart.max-request-size=1000MB
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论