完善c端登录
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate(RestTemplateBuilder builder) {
|
||||
return builder
|
||||
.setConnectTimeout(Duration.ofSeconds(5))
|
||||
.setReadTimeout(Duration.ofSeconds(5))
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class SecurityConfig
|
||||
.authorizeHttpRequests((requests) -> {
|
||||
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
requests.antMatchers("/login", "/register","/shopLogin", "/captchaImage").permitAll()
|
||||
requests.antMatchers("/login", "/register","/client/shopLogin", "/captchaImage","/client/getCode").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ShopUserDetailServiceImpl implements UserDetailsService {
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
ShopUser member = shopUserMapper.selectShopUserByPhone(username); //验证登录用户,查询数据库,如果这个mapper定义在自己的模块,引入maven依赖不用我多说吧?
|
||||
ShopUser member = shopUserMapper.selectShopUserByUsername(username); //验证登录用户,查询数据库,如果这个mapper定义在自己的模块,引入maven依赖不用我多说吧?
|
||||
System.out.println("这里是会员登录"+member);
|
||||
if (StringUtils.isNull(member)) {
|
||||
log.info("登录用户:{} 不存在.", username);
|
||||
|
||||
Reference in New Issue
Block a user