Browse Source

Merge branch 'Test' into 'master'

Test

See merge request crowd-2019/crowd-test-service-backend!19
薛晓波 5 years ago
parent
commit
a280b922b8

+ 7 - 1
site/src/main/java/com/mooctest/crowd/site/configuration/RedisSessionConfiguration.java

@@ -1,5 +1,6 @@
 package com.mooctest.crowd.site.configuration;
 
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.data.redis.connection.RedisConnectionFactory;
@@ -20,11 +21,16 @@ import org.springframework.session.web.http.DefaultCookieSerializer;
 @Configuration
 @EnableRedisHttpSession
 public class RedisSessionConfiguration {
+
+    @Value("${website.domain}")
+    private String domainName;
+
+
     @Bean
     public CookieSerializer cookieSerializer() {
         DefaultCookieSerializer serializer = new DefaultCookieSerializer();
         serializer.setCookiePath("/");
-        serializer.setDomainName("mooctest.net");
+        serializer.setDomainName(domainName);
         /**
          * 划重点,Spring-Session 2.x版本与1.x版本有较大差异
          * 由于内嵌tomcat版本不同,2.x版本默认开启Base64Encoding,同时使用1.x和2.x版本会导致Session不一致

+ 60 - 11
site/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: dev
+    active: online
   cache:
     guava:
       spec: expireAfterWrite=30s
@@ -23,16 +23,16 @@ spring:
     naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
   # The SQL dialect makes Hibernate generate better SQL for the chosen database
   properties.hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
-  redis:
-    host: 114.55.91.27
-    pool: 6379
-    password: '#03#05@ise@mooctest'
-    jedis:
-      pool:
-        max-active: 8
-        max-idle: 8
-        max-wait: -1
-        min-idle: 0
+#  redis:
+#    host: 114.55.91.27
+#    pool: 6379
+#    password: '#03#05@ise@mooctest'
+#    jedis:
+#      pool:
+#        max-active: 8
+#        max-idle: 8
+#        max-wait: -1
+#        min-idle: 0
 #    database: 6
   servlet:
     multipart:
@@ -59,11 +59,23 @@ spring:
     username: mooctest
     password: secr3t!
   redis:
+    host: 114.55.91.27
+    pool: 6379
+    password: '#03#05@ise@mooctest'
+    jedis:
+      pool:
+        max-active: 8
+        max-idle: 8
+        max-wait: -1
+        min-idle: 0
     database: 6
 user:
   service:
     baseUrl: http://118.25.48.10:8081
 
+website:
+  domain: mooctest.net
+
 ---
 spring:
   profiles: pre
@@ -72,10 +84,47 @@ spring:
     username: root
     password: crowd
   redis:
+    host: 114.55.91.27
+    pool: 6379
+    password: '#03#05@ise@mooctest'
+    jedis:
+      pool:
+        max-active: 8
+        max-idle: 8
+        max-wait: -1
+        min-idle: 0
     database: 6
 user:
   service:
     baseUrl: http://118.25.48.10:8081
 
+website:
+  domain: mooctest.net
+
+---
+spring:
+  profiles: online
+  datasource:
+    url: jdbc:mysql://10.18.18.50:3306/crowd-test-service?useSSL=false&useUnicode=yes&characterEncoding=UTF-8
+    username: root
+    password: callfortest_crowd
+  redis:
+    host: 10.18.18.50
+    pool: 6379
+    password: '#2019@callforttest@!'
+    jedis:
+      pool:
+        max-active: 8
+        max-idle: 8
+        max-wait: -1
+        min-idle: 0
+    database: 0
+user:
+  service:
+    baseUrl: http://user.callfortest.com
+website:
+  domain: callfortest.com
+
+