整合代码
diff --git a/src/main/java/com/supwisdom/dlpay/framework/core/DatabaseConfig.java b/src/main/java/com/supwisdom/dlpay/framework/core/DatabaseConfig.java
index 16f454a..99bb014 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/core/DatabaseConfig.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/core/DatabaseConfig.java
@@ -5,14 +5,10 @@
 
 @Configuration
 public class DatabaseConfig {
-  @Value("${database.dbtype:oracle}")
-  private String dbType;
+  @Value("${spring.datasource.platform}")
+  private String platform;
 
-  public String getDbType() {
-    return dbType;
-  }
-
-  public void setDbType(String dbType) {
-    this.dbType = dbType;
+  public String getPlatform() {
+    return platform;
   }
 }
diff --git a/src/main/java/com/supwisdom/dlpay/framework/service/impl/SystemUtilServiceImpl.java b/src/main/java/com/supwisdom/dlpay/framework/service/impl/SystemUtilServiceImpl.java
index 07d5e63..53ebf4c 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/service/impl/SystemUtilServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/service/impl/SystemUtilServiceImpl.java
@@ -13,6 +13,7 @@
 import com.supwisdom.dlpay.framework.util.StringUtil;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
@@ -74,7 +75,7 @@
 
   @Override
   public SystemDateTime getSysdatetime() {
-    switch (databaseConfig.getDbType()) {
+    switch (databaseConfig.getPlatform()) {
       case "postgresql":
         return getPGDatetime();
       default:
diff --git a/src/main/java/com/supwisdom/dlpay/framework/util/DateUtil.java b/src/main/java/com/supwisdom/dlpay/framework/util/DateUtil.java
index a17a6ee..ee65ddb 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/util/DateUtil.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/util/DateUtil.java
@@ -1,13 +1,13 @@
 package com.supwisdom.dlpay.framework.util;
 
 import org.apache.log4j.Logger;
-import org.springframework.util.Assert;
 
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.TimeZone;
 
 public class DateUtil {
   private static final Logger logger = Logger.getLogger(DateUtil.class);
@@ -96,8 +96,8 @@
    * Description: 比较两个时间字符串的前后关系 @param firstTime String 格式:yyyyMMddHHmmss
    *
    * @param secondTime String 格式: yyyyMMddHHmmss @return int |
-   * firstTime=second int=0 | firstTime>secondTime int>0 |
-   * firstTime<secondTime int<0 @exception Modify History:
+   *                   firstTime=second int=0 | firstTime>secondTime int>0 |
+   *                   firstTime<secondTime int<0 @exception Modify History:
    */
   public static int compareDatetime(String firstTime, String secondTime) {
     try {
@@ -111,9 +111,10 @@
 
   /**
    * Description: 比较两个时间字符串的前后关系 @param firstTime String 格式:pattern
+   *
    * @param secondTime String 格式: yyyyMMddHHmmss @return int |
-   * firstTime=second int=0 | firstTime>secondTime int>0 |
-   * firstTime<secondTime int<0 @exception Modify History:
+   *                   firstTime=second int=0 | firstTime>secondTime int>0 |
+   *                   firstTime<secondTime int<0 @exception Modify History:
    */
   public static int compareDatetime(String firstTime, String secondTime, String pattern) {
     try {
@@ -130,8 +131,8 @@
    * Description: 比较两个时间字符串的时间差 @param firstTime String 格式:yyyyMMddHHmmss
    *
    * @param secondTime String 格式: yyyyMMddHHmmss @param second int 格式 @return
-   * int | firstTime+seconds=secondTime int=0 | firstTime+seconds>secondTime
-   * int>0 | firstTime+seconds<secondTime int<0 @exception Modify History:
+   *                   int | firstTime+seconds=secondTime int=0 | firstTime+seconds>secondTime
+   *                   int>0 | firstTime+seconds<secondTime int<0 @exception Modify History:
    */
   public static int compareDatetime(String firstTime, String secondTime, int seconds) {
     try {
@@ -179,7 +180,7 @@
 
   /**
    * 获得两个字符串日期之间的时间差(单位毫秒)
-   * */
+   */
   public static long getIntervalTime(String startTime, String endTime, String pattern) {
     long duration = 0;
     try {
@@ -196,17 +197,17 @@
    * 短格式:20140401 -> 2014-04-01
    * 中格式:201404011200 -> 2014-04-01 12:00
    * 长格式:20140401123025 -> 2014-04-01 12:30:25
-   * **/
-  public static String parseToDateFormat(String str){
-    switch(str.length()){
+   **/
+  public static String parseToDateFormat(String str) {
+    switch (str.length()) {
       case 8:
-        str = str.substring(0, 4)+"-"+str.substring(4, 6)+"-"+str.substring(6, 8);
+        str = str.substring(0, 4) + "-" + str.substring(4, 6) + "-" + str.substring(6, 8);
         break;
       case 12:
-        str = str.substring(0, 4)+"-"+str.substring(4, 6)+"-"+str.substring(6, 8)+" "+str.substring(8, 10)+":"+str.substring(10, 12);
+        str = str.substring(0, 4) + "-" + str.substring(4, 6) + "-" + str.substring(6, 8) + " " + str.substring(8, 10) + ":" + str.substring(10, 12);
         break;
       case 14:
-        str = str.substring(0, 4)+"-"+str.substring(4, 6)+"-"+str.substring(6, 8)+" "+str.substring(8, 10)+":"+str.substring(10, 12)+":"+str.substring(12, 14);
+        str = str.substring(0, 4) + "-" + str.substring(4, 6) + "-" + str.substring(6, 8) + " " + str.substring(8, 10) + ":" + str.substring(10, 12) + ":" + str.substring(12, 14);
         break;
       default:
         break;
@@ -219,14 +220,14 @@
    * 短格式:2014-04-01 -> 20140401
    * 中格式:2014-04-01 12:00 -> 201404011200
    * 长格式:2014-04-01 12:30:25 -> 20140401123025
-   * **/
-  public static String unParseToDateFormat(String str){
+   **/
+  public static String unParseToDateFormat(String str) {
     return str.replaceAll("-", "").replaceAll(" ", "").replaceAll(":", "");
   }
 
   /**
    * 检验时间格式
-   * */
+   */
   public static boolean checkDatetimeValid(String datetime, String pattern) {
     if (null == datetime) return false;
     try {
@@ -241,8 +242,8 @@
   /**
    * 获取指定日期是星期几 格式 yyyyMMdd
    * MON|TUE|WED|THU|FRI|SAT|SUN
-   * 	1		2		3		4		5		6		7
-   * */
+   * 1		2		3		4		5		6		7
+   */
   public static int getWeekday(String datestr) {
     try {
       Calendar calendar = Calendar.getInstance();
@@ -275,13 +276,13 @@
     }
   }
 
-  public static Integer getLastDayOfMonth(Integer year,Integer month){
+  public static Integer getLastDayOfMonth(Integer year, Integer month) {
     Calendar cal = Calendar.getInstance();
     cal.set(Calendar.YEAR, year);
-    cal.set(Calendar.MONTH, month-1);
-    cal.set(Calendar.DAY_OF_MONTH,cal.getActualMaximum(Calendar.DATE));
-    String str = new SimpleDateFormat( "yyyyMMdd ").format(cal.getTime()).toString();
-    Integer result = Integer.parseInt(str.substring(0,4) + str.substring(4,6) + str.substring(6,8));
+    cal.set(Calendar.MONTH, month - 1);
+    cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
+    String str = new SimpleDateFormat("yyyyMMdd ").format(cal.getTime()).toString();
+    Integer result = Integer.parseInt(str.substring(0, 4) + str.substring(4, 6) + str.substring(6, 8));
     return result;
   }
 
@@ -305,4 +306,15 @@
   }
 
 
+  public static String getUTCTime(Long timeInMillisSecond) {
+    Calendar time = Calendar.getInstance();
+    SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
+    fmt.setTimeZone(TimeZone.getTimeZone("UTC"));
+    time.setTimeInMillis(timeInMillisSecond);
+    return fmt.format(time.getTime());
+  }
+
+  public static String getUTCTime() {
+    return getUTCTime(System.currentTimeMillis());
+  }
 }
diff --git a/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt
index 2ee98f6..e2ba3ab 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/framework/controller/security_controller.kt
@@ -4,21 +4,21 @@
 import com.supwisdom.dlpay.framework.core.JwtConfig
 import com.supwisdom.dlpay.framework.core.JwtTokenUtil
 import com.supwisdom.dlpay.framework.dao.ApiClientDao
-import com.supwisdom.dlpay.framework.security.validate.ImageCodeUtil
-import com.supwisdom.dlpay.framework.security.validate.VerifyCode
 import com.supwisdom.dlpay.framework.domain.ApiClientRedis
 import com.supwisdom.dlpay.framework.domain.JwtRedis
 import com.supwisdom.dlpay.framework.domain.TOperator
 import com.supwisdom.dlpay.framework.redisrepo.ApiClientRepository
 import com.supwisdom.dlpay.framework.redisrepo.ApiJwtRepository
+import com.supwisdom.dlpay.framework.security.validate.ImageCodeUtil
+import com.supwisdom.dlpay.framework.security.validate.VerifyCode
 import com.supwisdom.dlpay.framework.service.SystemUtilService
+import com.supwisdom.dlpay.framework.util.DateUtil
 import com.supwisdom.dlpay.framework.util.HmacUtil
 import com.supwisdom.dlpay.framework.util.TradeDict
 import com.supwisdom.dlpay.system.service.CommonService
 import com.supwisdom.dlpay.system.service.FunctionService
 import mu.KotlinLogging
 import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.http.HttpRequest
 import org.springframework.http.HttpStatus
 import org.springframework.http.ResponseEntity
 import org.springframework.security.core.annotation.AuthenticationPrincipal
@@ -28,9 +28,11 @@
 import org.springframework.social.connect.web.HttpSessionSessionStrategy
 import org.springframework.stereotype.Controller
 import org.springframework.ui.Model
-import org.springframework.web.bind.annotation.*
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PathVariable
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
 import org.springframework.web.context.request.ServletWebRequest
-import java.text.SimpleDateFormat
 import java.util.*
 import javax.imageio.ImageIO
 import javax.servlet.http.HttpServletRequest
@@ -112,14 +114,11 @@
                 }.apply {
                     apiJwtRepository.save(this)
                 }
-                val exp = Calendar.getInstance()
-                val fmt = SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
-                fmt.timeZone = TimeZone.getTimeZone("UTC")
-                exp.timeInMillis = token.expiration.valueInMillis
+
                 ResponseEntity.ok(ResponseBodyBuilder.create()
                         .data("jwt", token.jwtToken)
                         .data("appid", appid)
-                        .data("expiredAt", fmt.format(exp.time))
+                        .data("expiredAt", DateUtil.getUTCTime(token.expiration.valueInMillis))
                         .success())
             } else {
                 ResponseEntity.status(HttpStatus.UNAUTHORIZED).build()
@@ -150,14 +149,11 @@
                 }.apply {
                     apiJwtRepository.save(this)
                 }
-                val exp = Calendar.getInstance()
-                val fmt = SimpleDateFormat("yyyy-MM-dd HH:mm:ss z")
-                fmt.timeZone = TimeZone.getTimeZone("UTC")
-                exp.timeInMillis = token.expiration.valueInMillis
+
                 ResponseEntity.ok(ResponseBodyBuilder.create()
                         .data("jwt", token.jwtToken)
                         .data("appid", appid)
-                        .data("expiredAt", fmt.format(exp.time))
+                        .data("expiredAt", DateUtil.getUTCTime(token.expiration.valueInMillis))
                         .success())
             } else {
                 ResponseEntity.status(HttpStatus.UNAUTHORIZED).build()
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index b54e727..41f5532 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -3,6 +3,8 @@
 spring.jpa.show-sql=true
 spring.datasource.hikari.connection-timeout=60000
 spring.datasource.hikari.maximum-pool-size=5
+spring.datasource.initialization-mode=always
+spring.datasource.continue-on-error=true
 spring.jpa.hibernate.ddl-auto=update
 # logging
 logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
new file mode 100644
index 0000000..0b14207
--- /dev/null
+++ b/src/main/resources/data.sql
@@ -0,0 +1,22 @@
+insert into tb_apiclient(appid, secret, status, roles)
+values ('100001', 'oUw2NmA09ficiVWD4TUQLDOkPyzQa3VzbjjsW0B2qTk=', 'normal', 'ROLE_THIRD_ADMIN');
+INSERT INTO tb_operator(
+	operid, closedate, opendate, opercode, opername, operpwd, opertype, status)
+	VALUES ('LOR2IwRkbOjp+sVG9KR2BpHZbwGKepS4', '20500101', '20190101', 'system', '系统管理员', '$2a$10$Ex9xp11.vCaD8D0a7ahiUOKqDij1TcCUBwRAmrqXeDvAkmzLibn4.', '', 'normal');
+
+INSERT INTO tb_role(
+	role_id, createtime, editflag, lastsaved, rolecode, roledesc, rolename)
+	VALUES ('d1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '20190101000000', 0, '', 'ROLE_ADMIN', '超级管理员', '超级管理员');
+
+INSERT INTO tb_oper_role(
+	id, operid, role_id)
+	VALUES ('1', 'LOR2IwRkbOjp+sVG9KR2BpHZbwGKepS4', 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
+
+-- 功能表
+Insert into TB_FUNCTION (ID,PARENT_ID,NAME,ORDER_NUM,MENU_URL,MENU_ICON,IS_LEAF)
+values ('1','-1','系统中心',1,'#','layui-icon-set',0);
+Insert into TB_FUNCTION (ID,PARENT_ID,NAME,ORDER_NUM,MENU_URL,MENU_ICON,IS_LEAF)
+values ('2','1','管理员维护',1,'#','layui-icon-set',1);
+
+Insert into TB_ROLE_FUNCTION (ID,FUNCTION_ID,ROLE_ID) values ('1','1','d1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
+Insert into TB_ROLE_FUNCTION (ID,FUNCTION_ID,ROLE_ID) values ('2','2','d1yctWs5+ks0iQN3m9bUvRHus6HbKbrs');
\ No newline at end of file