Selaa lähdekoodia

添加缺失代码

linqilong 7 kuukautta sitten
vanhempi
commit
8aba9f4464

+ 12 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -117,3 +117,15 @@ xss:
   excludes: /system/notice
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
+
+sys:
+  report:
+    upload:
+      path: D:/test/report/
+  chart:
+    upload:
+      path: D:/test/chart/
+  map:
+    upload:
+      path: D:/test/map/
+

+ 21 - 1
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java

@@ -5,7 +5,7 @@ import org.springframework.stereotype.Component;
 
 /**
  * 读取项目相关配置
- * 
+ *
  * @author ruoyi
  */
 @Component
@@ -30,6 +30,11 @@ public class RuoYiConfig
     /** 验证码类型 */
     private static String captchaType;
 
+    /**
+     * 网关地址
+     */
+    private static String gatewayUrl;
+
     public String getName()
     {
         return name;
@@ -88,6 +93,14 @@ public class RuoYiConfig
         RuoYiConfig.captchaType = captchaType;
     }
 
+    public static String getGatewayUrl() {
+        return gatewayUrl;
+    }
+
+    public void setGatewayUrl(String gatewayUrl) {
+        RuoYiConfig.gatewayUrl = gatewayUrl;
+    }
+
     /**
      * 获取导入上传路径
      */
@@ -119,4 +132,11 @@ public class RuoYiConfig
     {
         return getProfile() + "/upload";
     }
+
+    /**
+     * 获取上传路径
+     */
+    public static String getServiceFilePath() {
+        return getProfile() + "/serviceFile";
+    }
 }

+ 19 - 11
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java

@@ -7,7 +7,7 @@ import com.ruoyi.common.utils.StringUtils;
 
 /**
  * 操作消息提醒
- * 
+ *
  * @author ruoyi
  */
 public class AjaxResult extends HashMap<String, Object>
@@ -32,7 +32,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 初始化一个新创建的 AjaxResult 对象
-     * 
+     *
      * @param code 状态码
      * @param msg 返回内容
      */
@@ -44,7 +44,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 初始化一个新创建的 AjaxResult 对象
-     * 
+     *
      * @param code 状态码
      * @param msg 返回内容
      * @param data 数据对象
@@ -61,7 +61,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回成功消息
-     * 
+     *
      * @return 成功消息
      */
     public static AjaxResult success()
@@ -71,7 +71,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回成功数据
-     * 
+     *
      * @return 成功消息
      */
     public static AjaxResult success(Object data)
@@ -81,7 +81,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回成功消息
-     * 
+     *
      * @param msg 返回内容
      * @return 成功消息
      */
@@ -92,7 +92,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回成功消息
-     * 
+     *
      * @param msg 返回内容
      * @param data 数据对象
      * @return 成功消息
@@ -127,7 +127,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回错误消息
-     * 
+     *
      * @return 错误消息
      */
     public static AjaxResult error()
@@ -137,7 +137,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回错误消息
-     * 
+     *
      * @param msg 返回内容
      * @return 错误消息
      */
@@ -148,7 +148,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回错误消息
-     * 
+     *
      * @param msg 返回内容
      * @param data 数据对象
      * @return 错误消息
@@ -160,7 +160,7 @@ public class AjaxResult extends HashMap<String, Object>
 
     /**
      * 返回错误消息
-     * 
+     *
      * @param code 状态码
      * @param msg 返回内容
      * @return 错误消息
@@ -200,6 +200,14 @@ public class AjaxResult extends HashMap<String, Object>
         return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
     }
 
+    public static AjaxResult check(boolean check) {
+        return check(check, null);
+    }
+
+    public static AjaxResult check(boolean check, Object data) {
+        return check ? success(data) : error();
+    }
+
     /**
      * 方便链式调用
      *

+ 1 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/OkHttpUtils.java

@@ -15,6 +15,7 @@ import java.util.concurrent.TimeUnit;
  * Created by admin on 2018/12/21.
  */
 public class OkHttpUtils {
+
     public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
     public static final MediaType MEDIA_TYPE = MediaType.parse("application/json;charset=utf-8");
     private static final Logger logger = LoggerFactory.getLogger(OkHttpUtils.class);