Crystal.Sea 3 jaren geleden
bovenliggende
commit
3e2ed44521

+ 1 - 0
.gitignore

@@ -40,3 +40,4 @@ setEnvVars.bat
 
 /.gradle/
 /.gradle/*
+.vscode/settings.json

+ 8 - 2
ReleaseNotes.txt

@@ -21,9 +21,15 @@
     *(MAXKEY-210820) 企业微信扫码登录js更新wwLogin-1.2.4.js
     *(MAXKEY-210821) 中文切换调整为下拉菜单
     *(MAXKEY-210822) 移除原有的缓存方案
-    *(MAXKEY-210823) 依赖jar引用、更新和升级
-         spring              5.3.11
+	*(MAXKEY-210823) 应用管理OAuth适配器显示问题修复
+    *(MAXKEY-210824) 图片验证码优化,增加随机颜色的字符生成实现,干扰线优化
+    *(MAXKEY-210825) 依赖jar引用、更新和升级
+         spring              5.3.12
+         springboot          2.5.6
          tomcat              9.0.54
+		 springSecurity      5.5.3
+         springData          2.5.5
+         springSession       2.5.3
          mybatis-jpa-extra   2.6
          druid               1.2.8
          caffeine            2.9.2

+ 6 - 6
gradle.properties

@@ -44,11 +44,11 @@ poiVersion                      =4.1.2
 tomcatVersion                   =9.0.54
 tomcatembedloggingjuliVersion   =8.5.2
 #spring
-springVersion                   =5.3.11
-springBootVersion               =2.5.5
-springSecurityVersion           =5.5.2
-springDataVersion               =2.5.2
-springSessionVersion            =2.5.2
+springVersion                   =5.3.12
+springBootVersion               =2.5.6
+springSecurityVersion           =5.5.3
+springDataVersion               =2.5.5
+springSessionVersion            =2.5.3
 springkafkaVersion              =2.7.7
 springretryVersion              =1.3.0
 springplugincoreVersion         =2.0.0.RELEASE
@@ -61,6 +61,7 @@ springcloudalibabacsplVersion   =1.8.2
 alibabanacosclientVersion  		=2.0.3
 #google
 jibGradlePluginVersion          =3.1.4
+jhlabsfiltersVersion            =2.0.235-1
 kaptchaVersion                  =2.3.2
 gsonVersion                     =2.8.8
 guavaVersion                    =30.1.1-jre
@@ -98,7 +99,6 @@ jakartaannotationVersion        =2.0.0
 jakartavalidationapiVersion     =3.0.0
 attoparserVersion               =2.0.5.RELEASE
 unbescapeVersion                =1.1.6.RELEASE
-jhlabsfiltersVersion            =2.0.235-1
 slf4jVersion                    =1.7.32
 jacksonVersion                  =2.12.5
 bouncycastleVersion             =1.69

+ 31 - 0
maxkey-core/src/main/java/org/maxkey/entity/Accounts.java

@@ -60,6 +60,12 @@ public class Accounts extends JpaBaseEntity implements Serializable {
     private String relatedUsername;
     @Column
     private String relatedPassword;
+    @Column
+    private String createType;
+    @Column
+    private String strategyId;
+    @Column
+    private int status;
     
     UserInfo userInfo;
 
@@ -156,6 +162,31 @@ public class Accounts extends JpaBaseEntity implements Serializable {
         this.userInfo = userInfo;
     }
 
+    
+    public String getCreateType() {
+        return createType;
+    }
+
+    public void setCreateType(String createType) {
+        this.createType = createType;
+    }
+
+    public String getStrategyId() {
+        return strategyId;
+    }
+
+    public void setStrategyId(String strategyId) {
+        this.strategyId = strategyId;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+
     @Override
     public String toString() {
         return "AppAccounts [uid=" + userId + ", username=" + username + ", displayName=" + displayName + ", appId="

+ 4 - 0
maxkey-core/src/main/java/org/maxkey/entity/apps/AppsOAuth20Details.java

@@ -90,6 +90,9 @@ public class AppsOAuth20Details extends Apps {
         this.setVendor(application.getVendor());
         this.setVendorUrl(application.getVendorUrl());
         this.setVisible(application.getVisible());
+        this.setAdapter(application.getAdapter());
+        this.setAdapterId(application.getAdapterId());
+        this.setAdapterName(application.getAdapterName());
         
         this.clientSecret = baseClientDetails.getClientSecret();
         this.scope = baseClientDetails.getScope().toString();
@@ -114,6 +117,7 @@ public class AppsOAuth20Details extends Apps {
         this.approvalPrompt = baseClientDetails.getApprovalPrompt();
         
         this.pkce = baseClientDetails.getPkce();
+        
 
     }
 

+ 3 - 3
maxkey-persistence/src/main/java/org/maxkey/persistence/service/GroupsService.java

@@ -75,8 +75,8 @@ public class GroupsService  extends JpaBaseService<Groups> implements Serializab
 	    if(dynamicGroup.getDynamic().equals("1")) {
 	        boolean isDynamicTimeSupport = false;
 	        boolean isBetweenEffectiveTime = false;
-	        if(dynamicGroup.getResumeTime()!=null&&dynamicGroup.getResumeTime().equals("")
-	                &&dynamicGroup.getSuspendTime()!=null&&dynamicGroup.getSuspendTime().equals("")) {
+	        if(StringUtils.isNotBlank(dynamicGroup.getResumeTime())
+	                &&StringUtils.isNotBlank(dynamicGroup.getSuspendTime())) {
 	            LocalTime currentTime = LocalDateTime.now().toLocalTime();
 	            LocalTime resumeTime = LocalTime.parse(dynamicGroup.getResumeTime());
 	            LocalTime suspendTime = LocalTime.parse(dynamicGroup.getSuspendTime());
@@ -92,7 +92,7 @@ public class GroupsService  extends JpaBaseService<Groups> implements Serializab
 	            
 	        }
 	        
-    	    if(dynamicGroup.getOrgIdsList()!=null && !dynamicGroup.getOrgIdsList().equals("")) {
+    	    if(StringUtils.isNotBlank(dynamicGroup.getOrgIdsList())) {
     	        dynamicGroup.setOrgIdsList("'"+dynamicGroup.getOrgIdsList().replace(",", "','")+"'");
     	    }
     	    String filters = dynamicGroup.getFilters();

+ 1 - 0
maxkey-webs/maxkey-web-mgt/src/main/resources/META-INF/spring.factories

@@ -7,5 +7,6 @@ org.maxkey.autoconfigure.JwtAuthnAutoConfiguration,\
 org.maxkey.autoconfigure.RedisAutoConfiguration,\
 org.maxkey.autoconfigure.AuthenticationAutoConfiguration,\
 org.maxkey.synchronizer.autoconfigure.SynchronizerAutoConfiguration,\
+org.maxkey.autoconfigure.SwaggerConfig,\
 org.maxkey.MaxKeyMgtConfig,\
 org.maxkey.MaxKeyMgtMvcConfig

+ 1 - 1
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accounts/accountsAdd.ftl

@@ -29,7 +29,7 @@
 </head>
 <body>
 
-<form id="actionForm"  method="post" type="label" autoclose="true"  action="<@base/>/app/accounts/add"  class="needs-validation" novalidate>
+<form id="actionForm"  method="post" type="label" autoclose="true"  action="<@base/>/accounts/add"  class="needs-validation" novalidate>
 	<table border="0" cellpadding="0" cellspacing="0" class="table table-bordered" >
 		<tbody>
 			<tr style="display:none">

+ 22 - 2
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accounts/accountsList.ftl

@@ -3,6 +3,21 @@
 <head>
 	<#include  "../layout/header.ftl"/>
 	<#include  "../layout/common.cssjs.ftl"/>
+	<script type="text/javascript">    
+        function statusFormatter(value, row, index){
+            if(value==1){
+                return '<@locale code="userinfo.status.active" />';
+            }else if(value==2){
+                return '<@locale code="userinfo.status.inactive" />';
+            }else if(value==5){
+                return '<@locale code="userinfo.status.lock" />';
+            }else if(value==9){
+                return '<@locale code="userinfo.status.delete" />';
+            }else {
+                return '<@locale code="userinfo.status.inactive" />';
+            }
+        };   
+    </script>
 </head>
 <body> 
 <div class="app header-default side-nav-dark">
@@ -57,8 +72,12 @@
 						 		    wurl="<@base/>/accounts/forwardAdd"
 						 		    wwidth="960"
 						 		    wheight="600"
-					 		    	target="window">	   
-					 		    	
+					 		    	target="window">
+					 	<input class="button btn btn-info mr-3 " id="modifyBtn" type="button" value="<@locale code="button.text.edit"/>" 
+                                    wurl="<@base/>/accounts/forwardUpdate"
+                                    wwidth="700"
+                                    wheight="400"
+                                    target="window">   	
 					 	<input class="button btn btn-danger mr-3 "  id="deleteBtn" type="button" value="<@locale code="button.text.delete"/>"
 					 				wurl="<@base/>/accounts/delete" />
 					</div>
@@ -115,6 +134,7 @@
 				<th data-field="appName"><@locale code="account.appName"/></th>
 				<th data-field="appId"   data-visible="false"><@locale code="account.appId"/></th>
 				<th data-field="relatedUsername"><@locale code="account.relatedUsername"/></th>
+				<th data-field="status"  data-formatter="statusFormatter"><@locale code="common.text.status"/></th>
 			</tr>
 		</thead>
 	</table>

+ 121 - 0
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accounts/accountsUpdate.ftl

@@ -0,0 +1,121 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <#include  "../layout/header.ftl"/>
+    <#include  "../layout/common.cssjs.ftl"/>
+    <link type="text/css" rel="stylesheet"  href="<@base />/static/css/minitable.css"/>
+    <script type="text/javascript">
+    $(function(){
+        $("#relatedUsername").focus(function(){
+          if($("#relatedUsername").val()==""){
+            $("#relatedUsername").val($("#username").val());
+          }
+        });
+        
+        $("#generateSecret").on("click",function(){
+            $.post("<@base/>/userinfo/randomPassword/", {_method:"post",currTime:(new Date()).getTime()}, function(data) {
+                $("#relatedPassword").val(data+"");
+            }); 
+        });
+        $("#view").on("click",function(){
+            if($("#relatedPassword").attr("type")=="text"){
+                $("#relatedPassword").attr("type","password");
+            }else{
+                $("#relatedPassword").attr("type","text");
+            }
+        });
+    });
+    </script>
+</head>
+<body>
+
+<form id="actionForm"  method="post" type="label" autoclose="true"  action="<@base/>/accounts/update"  class="needs-validation" novalidate>
+    <table border="0" cellpadding="0" cellspacing="0" class="table table-bordered" >
+        <tbody>
+            <tr style="display:none">
+                <th><@locale code="userinfo.id" />:</th>
+                <td nowrap>
+                    <input  required="" type="text" id="id" name="id" readonly  class="form-control" title="" value="${model.id!}"/>
+    
+                </td>
+                <td>
+                </td>
+            </tr>
+            <tr>
+                <th style="width: 150px;"><@locale code="userinfo.username" />:</th>
+                <td nowrap  style="width:400px">
+                    <input  required="" readonly type="text" id="username" name="username"  class="form-control username" title="" value="${model.username!}"   required="" />
+                    
+                </td>
+                <td >
+                    
+                </td>
+            </tr>
+            <tr>
+                <th><@locale code="userinfo.displayName" />:</th>
+                <td nowrap>
+                    <input  required="" readonly  type="text" id="displayName" name="displayName"  class="form-control displayName"  title="" value="${model.displayName!}"   required="" />
+            
+                </td>
+                <td>
+                </td>
+            </tr>
+            <tr>
+                <th><@locale code="apps.name" />:</th>
+                <td nowrap>
+                    <input  required="" readonly  type="text" id="appName" name="appName"  class="form-control appName" title="" value="${model.appName!}"   required="" />
+                    
+                    
+                </td>
+                <td>
+                    
+                </td>
+            </tr>
+            <tr>
+                <th><@locale code="account.relatedUsername" />:</th>
+                <td nowrap>
+                    <input type="text" id="relatedUsername" name="relatedUsername"  class="form-control" title="" value="${model.relatedUsername!}"    required="" />
+
+                </td>
+                <td>
+                </td>
+            </tr>
+            <tr>
+                <th><@locale code="account.relatedPassword" />:</th>
+                <td nowrap>
+                    <input type="password" id="relatedPassword" name="relatedPassword"  class="form-control" title="" value="${model.relatedPassword!}"  required="" />
+                </td>
+                <td>
+                    <input id="generateSecret" type="button" class="button btn btn-warning mr-3" style="width:75px"  value="<@locale code="button.text.generate"/>"/>
+                    <input id="view" type="button" class="button btn btn-info mr-3" style="width:75px"  value="<@locale code="button.text.view"/>"/>
+                
+                </td>
+            </tr>
+            <tr>
+                <th><@locale code="common.text.status" />:</th>
+                <td nowrap>
+                    <select  id="status" name="status" class="form-control  form-select" >
+                        <option value="1" <#if 1==model.status!>selected</#if>><@locale code="common.text.status.activate"/></option>
+                        <option value="2" <#if 2==model.status!>selected</#if>><@locale code="common.text.status.inactive"/></option>
+                        <option value="5" <#if 5==model.status!>selected</#if>><@locale code="common.text.status.lock"/></option>
+                        <option value="9" <#if 9==model.status!>selected</#if>><@locale code="common.text.status.delete"/></option>
+                    
+                    </select>
+                </td>
+                <td></td>
+             </tr>
+            <tr>
+                <td colspan="3"  class="center">
+                    <input id="_method" type="hidden" name="_method"  value="post"/>
+                    <input type="hidden" id="userId" name="userId" class="userId" title="" value="${model.userId!}"/>
+                    <input type="hidden" id="appId" name="appId" class="appId" title="" value="${model.appId!}"/>
+                    <input class="button btn btn-primary mr-3"  type="submit"    id="submitBtn" value="<@locale code="button.text.save" />"/>
+                    <input class="button btn btn-secondary mr-3"  type="button"    id="closeBtn" value="<@locale code="button.text.cancel" /> "/>   
+                    
+                </td>
+            </tr>
+        </tbody>
+    </table>
+</form>
+</body>
+</html>

+ 8 - 2
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/socialsprovider/socialsProviderAdd.ftl

@@ -69,13 +69,19 @@
             <tr>
                     <th><@locale code="socials.provider.hidden" />:</th>
                     <td nowrap>
-                        <input type="text" id="hidden" name="hidden" class="form-control" title="" value=""  required="" />
+                        <select  id="hidden" name="hidden" class="form-control  form-select" >
+                            <option value="true" ><@locale code="common.text.yes"/></option>
+                            <option value="false" selected><@locale code="common.text.no"/></option>
+                        </select>
                     </td>
             </tr>
             <tr>
                     <th><@locale code="common.text.status" />:</th>
                     <td nowrap>
-                        <input type="text" id="status" name="status" class="form-control" title="" value=""  required="" />
+                        <select  id="status" name="status" class="form-control  form-select" >
+                            <option value="1" selected><@locale code="common.text.status.activate"/></option>
+                            <option value="2" ><@locale code="common.text.status.inactive"/></option>
+                        </select>
                     </td>
             </tr>
 			<tr>

+ 15 - 4
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/socialsprovider/socialsProviderList.ftl

@@ -4,9 +4,20 @@
 	<#include  "../layout/header.ftl"/>
 	<#include  "../layout/common.cssjs.ftl"/>
 	<script type="text/javascript">	
-		function dynamicFormatter(value, row, index){
-	  		return value=='0'? '<@locale code="common.text.no" />':'<@locale code="common.text.yes" />';
-		};             
+		function statusFormatter(value, row, index){
+            if(value==1){
+                return '<@locale code="userinfo.status.active" />';
+            }else if(value==2){
+                return '<@locale code="userinfo.status.inactive" />';
+            }else if(value==5){
+                return '<@locale code="userinfo.status.lock" />';
+            }else if(value==9){
+                return '<@locale code="userinfo.status.delete" />';
+            }else {
+                return '<@locale code="userinfo.status.inactive" />';
+            }
+        };   
+                
         function iconFormatter(value, row, index){
                 return "<img height='30' border='0px' src='<@base/>/static/"+value+"'/>";
         };
@@ -101,7 +112,7 @@
                         <th data-field="provider"><@locale code="socials.provider.provider"/></th>
                         <th data-field="providerName"><@locale code="socials.provider.providerName"/></th>
                         <th data-field="sortIndex"><@locale code="common.text.sortindex"/></th>
-                        <th data-field="status"><@locale code="common.text.status"/></th>
+                        <th data-field="status"  data-formatter="statusFormatter"><@locale code="common.text.status"/></th>
             
                     </tr>
                 </thead>

+ 8 - 2
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/socialsprovider/socialsProviderUpdate.ftl

@@ -72,13 +72,19 @@
         <tr>
                 <th><@locale code="socials.provider.hidden" />:</th>
                 <td nowrap>
-                    <input type="text" id="hidden" name="hidden" class="form-control" title="" value="${model.hidden!}"  required="" />
+                    <select  id="hidden" name="hidden" class="form-control  form-select" >
+                            <option value="true"  <#if 'true'==model.hidden!>selected</#if>><@locale code="common.text.yes"/></option>
+                            <option value="false" <#if 'false'==model.hidden!>selected</#if>><@locale code="common.text.no"/></option>
+                        </select>
                 </td>
         </tr>
         <tr>
                 <th><@locale code="common.text.status" />:</th>
                 <td nowrap>
-                    <input type="text" id="status" name="status" class="form-control" title="" value="${model.status!}"  required="" />
+                    <select  id="status" name="status" class="form-control  form-select" >
+                        <option value="1" <#if 1==model.status!>selected</#if>><@locale code="common.text.status.activate"/></option>
+                        <option value="2" <#if 2==model.status!>selected</#if>><@locale code="common.text.status.inactive"/></option>
+                    </select>
                 </td>
         </tr>
 		<tr>

+ 6 - 4
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/userinfo/userinfoSelect.ftl

@@ -15,10 +15,8 @@
 	};
 
 	function onClick(event, treeId, treeNode) {
-		  $("#deptId").val(treeNode.id);
-		  $("#list").setGridParam({ postData: { deptId: treeNode.id} });
-   		  $("#list").trigger('reloadGrid', [{page:1}]);
-  			
+		  $("#departmentId").val(treeNode.id);
+  		  $("#searchBtn").click();
 	}
 				
 	$(function () {	
@@ -151,6 +149,10 @@
 </head>
 <body>
  <div>
+    <form id="basic_search_form" style="display:none">
+        <input id="departmentId"  class="form-control" name="departmentId" type="text" >
+        <input  class="button btn mr-3 btn-primary"    id="searchBtn" type="button" size="50" value="<@locale code="button.text.search"/>">
+    </form>
  	<input class="button btn btn-primary mr-3"  style="float: right;" id="winClose" type="button" value="<@locale code="button.text.select" />" >
  </div>
      <!-- content -->