This commit is contained in:
2025-11-21 10:53:04 +08:00
parent e24d6ef0b4
commit 24ca9148dd
61 changed files with 4918 additions and 582 deletions

View File

@@ -0,0 +1,15 @@
package com.delivery.framework.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/** 配送定位上报规则配置 */
@Data
@Component("locationReportProperties")
@ConfigurationProperties(prefix = "delivery.location")
public class LocationReportProperties {
private long minPersistIntervalMs;
private long stateTtlHours;
private long lockSeconds;
}

View File

@@ -32,6 +32,10 @@ public class ResourcesConfig implements WebMvcConfigurer
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
.addResourceLocations("file:" + DeliveryConfig.getProfile() + "/");
/** D:\delivery 的静态映射 */
registry.addResourceHandler("/delivery/**")
.addResourceLocations("file:D:/delivery/");
/** swagger配置 */
registry.addResourceHandler("/swagger-ui/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")

View File

@@ -114,7 +114,14 @@ public class SecurityConfig
requests.antMatchers(
"/login",
"/register",
"/app/**",
"/delivery/**",
"/document/vehicle/**",
"/document/type/**",
"/document/location/**",
"/document/mtd/**",
"/document/info/**",
"/delivery/location/**",
"/document/attachment/**",
"/document/order/**",
// "/document/info/bill/groups",

View File

@@ -173,4 +173,28 @@ public class SysLoginService
{
userService.updateLoginInfo(userId, IpUtils.getIpAddr(), DateUtils.getNowDate());
}
public LoginUser loginWithoutCaptcha(String username, String password) {
loginPreCheck(username, password);
Authentication authentication;
try {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
AuthenticationContextHolder.setContext(token);
authentication = authenticationManager.authenticate(token);
}catch (Exception e){
throw new ServiceException("登录失败");
}finally {
AuthenticationContextHolder.clearContext();
}
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
recordLoginInfo(loginUser.getUserId());
return loginUser;
}
}