slowslo vor 3 Jahren
Ursprung
Commit
15455205b6

+ 49 - 0
pom.xml

@@ -214,6 +214,13 @@
                 <version>${spring.boot.version}</version>
                 <configuration>
                     <finalName>${project.build.finalName}</finalName>
+                    <layout>ZIP</layout>
+                    <includes>
+                        <include>
+                            <groupId>nothing</groupId>
+                            <artifactId>nothing</artifactId>
+                        </include>
+                    </includes>
                 </configuration>
                 <executions>
                     <execution>
@@ -262,6 +269,48 @@
                 </compilerArgs>
             </configuration>
         </plugin>
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <executions>
+                <execution>
+                    <id>copy-dependencies</id>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>copy-dependencies</goal>
+                    </goals>
+                    <configuration>
+                        <!--target/lib是依赖jar包的输出目录,根据自己喜好配置-->
+                        <outputDirectory>target/lib</outputDirectory>
+                        <excludeTransitive>false</excludeTransitive>
+                        <stripVersion>false</stripVersion>
+                        <includeScope>runtime</includeScope>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
+
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-resources-plugin</artifactId>
+            <executions>
+                <execution>
+                    <id>copy-resources</id>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>copy-resources</goal>
+                    </goals>
+                    <configuration>
+                        <resources>
+                            <resource>
+                                <directory>src/main/resources</directory>
+                            </resource>
+                        </resources>
+                        <outputDirectory>${project.build.directory}/resources</outputDirectory>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
     </plugins>
 </build>
     <repositories>

+ 2 - 2
src/main/java/org/springblade/system/bladeuserex/controller/UserExController.java

@@ -144,12 +144,12 @@ public class UserExController {
 	 */
 	@RequestMapping(value = "/oauth/render/{source}")
 	@ResponseBody
-	public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
+	public R renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException {
 		log.warn("进入render:" + source);
 		AuthRequest authRequest = SocialUtil.getAuthRequest(source);
 		String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
 		log.warn(authorizeUrl);
-		response.sendRedirect(authorizeUrl);
+		return R.data(authorizeUrl);
 	}
 
 

+ 9 - 2
src/main/java/org/springblade/system/bladeuserex/social/AuthCtwingRequest.java

@@ -13,6 +13,7 @@ import me.zhyd.oauth.request.AuthDefaultRequest;
 import me.zhyd.oauth.utils.HttpUtils;
 import me.zhyd.oauth.utils.StringUtils;
 import me.zhyd.oauth.utils.UrlBuilder;
+import org.springblade.core.tool.utils.SpringUtil;
 import org.springblade.system.bladeuserex.social.ctwing.*;
 
 import java.util.HashMap;
@@ -20,6 +21,12 @@ import java.util.Map;
 
 public class AuthCtwingRequest extends AuthDefaultRequest {
 
+    private static SocialConfig socialConfig;
+
+    static {
+        socialConfig = SpringUtil.getBean(SocialConfig.class);
+    }
+
     public AuthCtwingRequest(AuthConfig config) {
         super(config, AuthCustomizeSource.CTWING);
     }
@@ -164,11 +171,11 @@ public class AuthCtwingRequest extends AuthDefaultRequest {
             // 时间戳
             businessMap.put("timeStamp", String.valueOf(System.currentTimeMillis()));
             // 回调地址
-            businessMap.put("returnURL", CtwingAuthConstants.returnURL);
+            businessMap.put("returnURL", socialConfig.getRedirectUri());
             // 页面Key
             businessMap.put("pageKey", CtwingAuthConstants.pageKey);
             // 登录类型
-            businessMap.put("regReturnUrl", CtwingAuthConstants.regReturnUrl);
+            businessMap.put("regReturnUrl", socialConfig.getRedirectUri());
             // 状态参数
             businessMap.put("state", state);
 

+ 15 - 0
src/main/java/org/springblade/system/bladeuserex/social/SocialConfig.java

@@ -0,0 +1,15 @@
+package org.springblade.system.bladeuserex.social;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@Data
+public class SocialConfig {
+
+    @Value("${social.domain}")
+    private String domain;
+    @Value("${social.redirect-uri}")
+    private String redirectUri;
+}

+ 6 - 1
src/main/java/org/springblade/system/bladeuserex/social/SocialUtil.java

@@ -10,6 +10,11 @@ import org.springblade.system.bladeuserex.social.ctwing.CtwingAuthConstants;
 public class SocialUtil {
 
 	private static AuthStateCache authStateCache;
+	private static SocialConfig socialConfig;
+
+	static {
+		socialConfig = SpringUtil.getBean(SocialConfig.class);
+	}
 
 	public SocialUtil() {
 	}
@@ -29,7 +34,7 @@ public class SocialUtil {
 				authRequest = new AuthCtwingRequest(AuthConfig.builder()
 					.clientId(CtwingAuthConstants.APP_ID)
 					.clientSecret(CtwingAuthConstants.APP_SECRET)
-					.redirectUri("http://192.168.1.69:1888/oauth/redirect/CTWING")
+					.redirectUri(socialConfig.getRedirectUri())
 					.build());
 				break;
 			default:

+ 9 - 1
src/main/java/org/springblade/system/bladeuserex/social/ctwing/AuthRequestUtil.java

@@ -3,10 +3,18 @@ package org.springblade.system.bladeuserex.social.ctwing;
 import me.zhyd.oauth.config.AuthConfig;
 import me.zhyd.oauth.exception.AuthException;
 import me.zhyd.oauth.request.AuthRequest;
+import org.springblade.core.tool.utils.SpringUtil;
 import org.springblade.system.bladeuserex.social.AuthCtwingRequest;
+import org.springblade.system.bladeuserex.social.SocialConfig;
 
 public class AuthRequestUtil {
 
+    private static SocialConfig socialConfig;
+
+    static {
+        socialConfig = SpringUtil.getBean(SocialConfig.class);
+    }
+
     /**
      * 根据具体的授权来源,获取授权请求工具类
      *
@@ -20,7 +28,7 @@ public class AuthRequestUtil {
                 authRequest = new AuthCtwingRequest(AuthConfig.builder()
                         .clientId(CtwingAuthConstants.APP_ID)
                         .clientSecret(CtwingAuthConstants.APP_SECRET)
-                        .redirectUri("http://192.168.1.69:1888/community/oauth/redirect/CTWING")
+                        .redirectUri(socialConfig.getRedirectUri())
                         .build());
                 break;
             default:

+ 4 - 1
src/main/java/org/springblade/system/bladeuserex/social/ctwing/CtwingAuthConstants.java

@@ -1,5 +1,8 @@
 package org.springblade.system.bladeuserex.social.ctwing;
 
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.system.bladeuserex.social.SocialConfig;
+
 /**
  * @author: Chenzhenyong
  * @description: 常量工具类
@@ -58,7 +61,7 @@ public class CtwingAuthConstants {
     /**
      * 重定向返回URL(returnURL如带参数,整个returnURL需进行URL编码)
      */
-    public static final String returnURL = "http://192.168.1.69:1888/community/blade-user/oauth/redirect/CTWING";
+    public static final String returnURL = "";
 
     /**
      * 值为normal或popping(normal为正常嵌入页面,popping为弹出式页面,默认normal)

+ 10 - 0
src/main/resources/application-dev.yml

@@ -52,6 +52,11 @@ spring:
     #url: jdbc:oracle:thin:@127.0.0.1:49161:orcl
     #username: BLADEX_BOOT
     #password: oracle
+    druid:
+      filter:
+        wall:
+          config:
+            insert-allow:
   rabbitmq:
     host: 192.168.1.218
     port: 5672
@@ -164,4 +169,9 @@ zlm:
   defaultVhost: __defaultVhost__
   dstUrl: rtmp://192.168.1.218:1935/live/
 
+social:
+  domain: http://192.168.1.69:1888
+  redirect-uri: ${social.domain}/oauth/redirect/CTWING
+
+
 

+ 167 - 0
src/main/resources/application-test.yml

@@ -0,0 +1,167 @@
+#server:
+#  address: 192.168.1.69
+#数据源配置
+spring:
+  # admin-client 的用户名和密码
+#  security:
+#    user:
+#      name: szsq-boot-client
+#      password: szsq#boot#client#password
+#  boot:
+#    admin:
+#      client:
+#        instance:
+#          name: 数字社区实例1
+#          metadata:
+#            user.name: ${spring.security.user.name}
+#            user.password: ${spring.security.user.password}
+#          prefer-ip: true
+#        url: http://192.168.1.69:7259
+#        username: szsq-boot-server
+#        password: szsq#boot#server#password
+  redis:
+  #redis 单机环境配置
+    host: 192.168.1.218
+    port: 6379
+    password:
+    database: 15
+    ssl: false
+  #redis 集群环境配置
+#  cluster:
+#    nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
+#    commandTimeout: 5000
+  datasource:
+    # MySql
+    #url: jdbc:mysql://192.168.199.144:3306/bladex_boot_230?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    #username: foziserver
+    #password: tOje841EyH4NfEST
+#    url: jdbc:mysql://139.9.103.171:3306/ycwgdb?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+#    username: root
+#    password: 2e564ee5-d9ed-11e9-bab6-0242ac170005
+#    url: jdbc:mysql://localhost:3306/ycwgdb?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://192.168.1.218:3306/ycwgdb?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    username: root
+#    password: 123456
+    password: root@123456
+    # PostgreSQL
+    #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
+    #username: postgres
+    #password: 123456
+
+    # Oracle
+    #url: jdbc:oracle:thin:@127.0.0.1:49161:orcl
+    #username: BLADEX_BOOT
+    #password: oracle
+  rabbitmq:
+    host: 192.168.1.218
+    port: 5672
+    username: guest
+    password: guest
+    virtual-host: smart-house-dev
+  #配置rabbitMq 服务器 (线上MQ)
+#  rabbitmq:
+#    host: 139.9.103.171
+#    port: 5672
+#    username: guest
+#    password: 2e564ee5-d9ed-11e9-bab6-0242ac170005
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: smart-house
+
+#第三方登陆
+#social:
+#  enabled: true
+#  domain: http://192.168.1.69:1888
+
+#blade配置
+blade:
+  #分布式锁
+  #  lock:
+  #    enabled: false
+  #    address: redis://127.0.0.1:6379
+  #本地文件上传
+  secure:
+    skip-url:
+      - /**
+  file:
+    remote-mode: true
+    upload-domain: http://192.168.1.218:8999
+    remote-path: /usr/share/nginx/html
+#jetcache配置
+jetcache:
+  statIntervalMinutes: 15
+  areaInCacheName: false
+  local:
+    default:
+      type: caffeine
+      keyConvertor: fastjson
+#  remote:
+#    default:
+#      type: redis.lettuce
+#      keyConvertor: fastjson
+#      keyPrefix: default
+#      uri: redis://139.9.178.34:16379/
+oss:
+  enabled: true
+  name: minio
+  tenant-mode: false
+  endpoint: http://192.168.1.218:9000
+  access-key: D99KGE6ZTQXSATTJWU24
+  secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ
+  bucket-name: cyzhyc
+  return-path: http://192.168.1.218:1888/miniofile/cyzhyc/
+
+qinlin:
+  appId: QCxTKDxQf4WH8Wmk
+  appSecret: DiReTxz4SWhmiKX3wrEiAmDaRb3sjsN0
+  version: v1
+  apiHost: https://gateway.qinlinkeji.com
+
+chinanet:
+  crm:
+    custinfoverify:
+      X-APP-ID: 7ac9dcaabcbc30187915afc5ec34
+      X-APP-KEY: 3e83329c4ad42d050234d3e304f56176
+      url: http://61.133.213.220:8763/eop/nx/crm/openapi/custInfoVerify/custInfoVerify
+
+#云梯
+yunti:
+  url: https://zlopen.yun-ti.com
+  appKey: bnh6aHNxVmN5dEtGODJPNGdBS1ZMNXJp
+  appSecret: Ym5oNmFITnhWbU41ZEV0R09ESlBOR2RC
+
+
+#腾达
+tenda:
+  parkCode: SLZX/1P11
+  host: tcp://test.tdzntech.com:1883
+  userName: test
+  passWord: test
+  clientId: 3e2e2555d5c04cb1860c648b9fc4a758
+  topic: tpc/SLZX/1P11
+
+#视频云配置
+videocloud:
+  server_ip: https://36.103.231.102
+  server_port: 6006
+  sign_method: md5
+  format: json
+  v: 2.1
+  pwd_encrypt: TcRlEiyjizMOfK4u
+  secret: 6GZyUUDr21BH4JKgnmRJZEJuYRBj5D
+  v3-app-key: 9510260001
+  v3-member-key: zlqagqOys0epxue1a9RR
+  v3-app-secret: 6S4zou6L
+  v3-api-host: http://36.103.241.111:19103/api/dict/
+
+wvp:
+  server_host: 192.168.1.69
+  server_port: 18080
+
+zlm:
+  serverUrl: http://192.168.1.218
+  port: 8088
+  secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc
+  defaultVhost: __defaultVhost__
+  dstUrl: rtmp://192.168.1.218:1935/live/
+
+