完善c端登录

This commit is contained in:
menxipeng
2025-07-14 23:21:19 +08:00
parent 05403e3485
commit 121448abc4
18 changed files with 555 additions and 56 deletions

View File

@@ -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();
}
}

View File

@@ -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()

View File

@@ -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);