账户登录

This commit is contained in:
张锐 committed 2026-11-22 11:26:28 +08:00
1 parent 3b555ae815
commit 5d9b9d21b4
2 files changed
+12 -6

No files matched your search

@@ -7,14 +7,17 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
import org.springframework.beans.factory.annotation.Value;
import java.nio.file.Paths;
/** 前台站本地开发 Web 配置。 */
/** 前台站 Web 配置。 */
@Configuration
public class SiteWebConfig implements WebMvcConfigurer {
/** 本地媒体上传目录。 */ @Value("${shoplix.media.upload-dir:./uploads}") private String uploadDir;
/** 允许本地英文站前端调用前台接口。 */
/** 允许本地和测试环境英文站前端调用前台接口。 */
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/site/**").allowedOrigins("http://localhost:5174", "http://127.0.0.1:5174")
registry.addMapping("/api/site/**").allowedOrigins(
"http://localhost:5174",
"http://127.0.0.1:5174",
"https://site.steliro.com")
.allowedMethods("GET", "POST", "OPTIONS");
}
/** 暴露前台媒体资源。 */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry){registry.addResourceHandler("/uploads/**").addResourceLocations(Paths.get(uploadDir).toAbsolutePath().normalize().toUri().toString());}