andy 1 rok pred
rodič
commit
4b16d06b56

+ 5 - 2
src/main/java/com/scbfkj/uni/library/RequestUtil.java

@@ -48,11 +48,14 @@ public class RequestUtil {
 
     }
 
-    public static String getAppId() {
+    public static String getAppId() throws Exception {
 //        请求
         ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
         Object appid = requestAttributes.getAttribute("appid", SCOPE_SESSION);
-        return Objects.nonNull(appid) ? appid.toString() : null;
+        if(Objects.nonNull(appid)) {
+            return  appid.toString();
+        }
+        return getApplication().get("appid").toString();
 
     }