From 714df4804ebb5e09aa0a284bb1c478ba76822315 Mon Sep 17 00:00:00 2001
From: xiaowuler <xiaowuler@163.com>
Date: Fri, 3 Dec 2021 11:00:29 +0800
Subject: [PATCH] modify some codes

---
 .../backend/config/WebMvcConfig.java           | 18 ++++++++++++++++++
 .../Backend/src/main/resources/application.yml |  2 +-
 04.系统编码/Frontend/src/hooks/Config.ts   |  8 +++++---
 04.系统编码/Frontend/src/uilts/axios.ts    |  2 +-
 4 files changed, 25 insertions(+), 5 deletions(-)
 create mode 100644 04.系统编码/Backend/src/main/java/com/userinformation/backend/config/WebMvcConfig.java

diff --git a/04.系统编码/Backend/src/main/java/com/userinformation/backend/config/WebMvcConfig.java b/04.系统编码/Backend/src/main/java/com/userinformation/backend/config/WebMvcConfig.java
new file mode 100644
index 0000000..6ee580b
--- /dev/null
+++ b/04.系统编码/Backend/src/main/java/com/userinformation/backend/config/WebMvcConfig.java
@@ -0,0 +1,18 @@
+package com.userinformation.backend.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+/**
+ * @describe: 虚拟目录配置
+ * @author: xiaowuler
+ * @createTime: 2021-12-03 09:33
+ */
+@Configuration
+public class WebMvcConfig extends WebMvcConfigurerAdapter {
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/product/**").addResourceLocations("file:D:\\Deployments\\LamanRadar\\product\\");
+    }
+}
diff --git a/04.系统编码/Backend/src/main/resources/application.yml b/04.系统编码/Backend/src/main/resources/application.yml
index 0680ca7..246ed6f 100644
--- a/04.系统编码/Backend/src/main/resources/application.yml
+++ b/04.系统编码/Backend/src/main/resources/application.yml
@@ -1,5 +1,5 @@
 server:
-  port: 8001
+  port: 8002
 spring:
   datasource:
     url: jdbc:mysql://112.124.40.88:33306/user_information?useUnicode=true&characteEncoding=utf-8
diff --git a/04.系统编码/Frontend/src/hooks/Config.ts b/04.系统编码/Frontend/src/hooks/Config.ts
index 99de69f..6422b3c 100644
--- a/04.系统编码/Frontend/src/hooks/Config.ts
+++ b/04.系统编码/Frontend/src/hooks/Config.ts
@@ -2,7 +2,7 @@ import { Moment } from "moment";
 import { format } from "./String";
 
 export class Config {
-    public static parentUrl: string = "http://112.124.40.88:8890/product/picture";
+    public static parentUrl: string = "http://112.124.40.88:8002/product/picture";
 }
 
 export class MicrowaveRadiationConfig {
@@ -21,13 +21,15 @@ export class RamanLidarConfig {
 }
 
 export class SynergyEvaluationConfig {
+    private static url: string = Config.parentUrl + "/images";
     public static getUrl(tabName: string, elementName: string, type: string): string {
-        return format('/images/ecological-environment/{0}/{1}/{2}.tif', tabName, elementName, type)
+        return format('{3}/ecological-environment/{0}/{1}/{2}.tif', tabName, elementName, type, this.url);
     }
 }
 
 export class DecisionSupportConfig {
+    private static url: string = Config.parentUrl + "/images";
     public static getUrl(productName: string, imgName: string): string {
-        return format('/images/decision-support/{0}/{1}.tif', productName, imgName)
+        return format('{2}/decision-support/{0}/{1}.tif', productName, imgName, this.url);
     }
 }
\ No newline at end of file
diff --git a/04.系统编码/Frontend/src/uilts/axios.ts b/04.系统编码/Frontend/src/uilts/axios.ts
index a3de2a4..6d600b5 100644
--- a/04.系统编码/Frontend/src/uilts/axios.ts
+++ b/04.系统编码/Frontend/src/uilts/axios.ts
@@ -5,7 +5,7 @@ import { ElLoading } from 'element-plus'
 
 let loading = null;
 const service = axios.create({
-    baseURL:"http://localhost:8001",
+    baseURL:"http://localhost:8002",
     timeout: 500000
 })