账户登录
This commit is contained in:
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 org.springframework.beans.factory.annotation.Value;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
/** 运营后台本地开发 Web 配置。 */
|
/** 运营后台 Web 配置。 */
|
||||||
@Configuration
|
@Configuration
|
||||||
public class AdminWebConfig implements WebMvcConfigurer {
|
public class AdminWebConfig implements WebMvcConfigurer {
|
||||||
/** 本地媒体上传目录。 */ @Value("${shoplix.media.upload-dir:./uploads}") private String uploadDir;
|
/** 本地媒体上传目录。 */ @Value("${shoplix.media.upload-dir:./uploads}") private String uploadDir;
|
||||||
/** 允许本地运营前端调用后台接口。 */
|
/** 允许本地和测试环境运营前端调用后台接口。 */
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
registry.addMapping("/api/admin/**").allowedOrigins("http://localhost:5173", "http://127.0.0.1:5173")
|
registry.addMapping("/api/admin/**").allowedOrigins(
|
||||||
|
"http://localhost:5173",
|
||||||
|
"http://127.0.0.1:5173",
|
||||||
|
"https://admin.steliro.com")
|
||||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS").allowCredentials(true);
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS").allowCredentials(true);
|
||||||
}
|
}
|
||||||
/** 暴露本地开发媒体资源。 */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry){registry.addResourceHandler("/uploads/**").addResourceLocations(Paths.get(uploadDir).toAbsolutePath().normalize().toUri().toString());}
|
/** 暴露本地开发媒体资源。 */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry){registry.addResourceHandler("/uploads/**").addResourceLocations(Paths.get(uploadDir).toAbsolutePath().normalize().toUri().toString());}
|
||||||
|
|||||||
@@ -7,14 +7,17 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
/** 前台站本地开发 Web 配置。 */
|
/** 前台站 Web 配置。 */
|
||||||
@Configuration
|
@Configuration
|
||||||
public class SiteWebConfig implements WebMvcConfigurer {
|
public class SiteWebConfig implements WebMvcConfigurer {
|
||||||
/** 本地媒体上传目录。 */ @Value("${shoplix.media.upload-dir:./uploads}") private String uploadDir;
|
/** 本地媒体上传目录。 */ @Value("${shoplix.media.upload-dir:./uploads}") private String uploadDir;
|
||||||
/** 允许本地英文站前端调用前台接口。 */
|
/** 允许本地和测试环境英文站前端调用前台接口。 */
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
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");
|
.allowedMethods("GET", "POST", "OPTIONS");
|
||||||
}
|
}
|
||||||
/** 暴露前台媒体资源。 */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry){registry.addResourceHandler("/uploads/**").addResourceLocations(Paths.get(uploadDir).toAbsolutePath().normalize().toUri().toString());}
|
/** 暴露前台媒体资源。 */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry){registry.addResourceHandler("/uploads/**").addResourceLocations(Paths.get(uploadDir).toAbsolutePath().normalize().toUri().toString());}
|
||||||
|
|||||||
Reference in new issue
Block a user