Raod 4 år sedan
förälder
incheckning
5c28dcddb1

+ 20 - 0
report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java

@@ -57,6 +57,26 @@ public class TokenFilter implements Filter {
 
             //延长有效期
             cacheHelper.stringSetExpire(username, authorization, 3600);
+
+
+            //在线体验版本
+            if (username.equals("guest")
+                    && !uri.endsWith("/dataSet/testTransform")
+                    && !uri.endsWith("/reportDashboard/getData")
+                    && !uri.startsWith("/dict")
+                    && !uri.startsWith("/dict")
+            ) {
+                //不允许删除
+                String method = request.getMethod();
+                if ("post".equalsIgnoreCase(method)
+                        || "put".equalsIgnoreCase(method)
+                        || "delete".equalsIgnoreCase(method)
+                ) {
+                    ResponseBean responseBean = ResponseBean.builder().code("50001").message("在线体验版本,不允许此操作。请自行下载本地运行").build();
+                    response.getWriter().print(JSONObject.toJSONString(responseBean));
+                    return;
+                }
+            }
         }
 
         //执行

+ 2 - 2
report-ui/config/dev.env.js

@@ -4,6 +4,6 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  // BASE_API: '"http://127.0.0.1:9095"'
-  BASE_API: '"http://10.108.26.197:9095"'
+  BASE_API: '"http://127.0.0.1:9095"'
+  // BASE_API: '"http://10.108.26.197:9095"'
 })