Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
633247ac
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
633247ac
编写于
11月 16, 2021
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
AccountsStrategy
上级
29b5181a
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
370 addition
and
95 deletion
+370
-95
build.gradle
build.gradle
+1
-0
config/build_docker.gradle
config/build_docker.gradle
+1
-0
config/build_jar.gradle
config/build_jar.gradle
+1
-0
config/build_standard.gradle
config/build_standard.gradle
+1
-0
gradle.properties
gradle.properties
+1
-0
maxkey-core/src/main/java/org/maxkey/entity/AccountsStrategy.java
...ore/src/main/java/org/maxkey/entity/AccountsStrategy.java
+30
-3
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java
+0
-11
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/AccountsMapper.java
...in/java/org/maxkey/persistence/mapper/AccountsMapper.java
+7
-0
maxkey-persistence/src/main/java/org/maxkey/persistence/service/AccountsService.java
.../java/org/maxkey/persistence/service/AccountsService.java
+96
-17
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/AccountsStrategyMapper.xml
...y/persistence/mapper/xml/mysql/AccountsStrategyMapper.xml
+22
-20
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/AppsMapper.xml
...es/org/maxkey/persistence/mapper/xml/mysql/AppsMapper.xml
+0
-6
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java
...in/java/org/maxkey/web/contorller/AccountsController.java
+14
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsStrategyController.java
...org/maxkey/web/contorller/AccountsStrategyController.java
+9
-1
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties
...ey-web-mgt/src/main/resources/messages/message.properties
+4
-1
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties
...web-mgt/src/main/resources/messages/message_en.properties
+4
-1
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties
...-mgt/src/main/resources/messages/message_zh_CN.properties
+4
-1
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accounts/accountsAdd.ftl
...c/main/resources/templates/views/accounts/accountsAdd.ftl
+17
-1
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/accountsStrategyAdd.ftl
.../templates/views/accountsstrategy/accountsStrategyAdd.ftl
+22
-2
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/accountsStrategyList.ftl
...templates/views/accountsstrategy/accountsStrategyList.ftl
+17
-5
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/accountsStrategyUpdate.ftl
...mplates/views/accountsstrategy/accountsStrategyUpdate.ftl
+22
-2
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/selectAccountsStrategy.ftl
...mplates/views/accountsstrategy/selectAccountsStrategy.ftl
+91
-0
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/appAddCommon.ftl
.../src/main/resources/templates/views/apps/appAddCommon.ftl
+3
-12
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/appUpdateCommon.ftl
...c/main/resources/templates/views/apps/appUpdateCommon.ftl
+1
-10
setEnvVars.bat
setEnvVars.bat
+2
-2
未找到文件。
build.gradle
浏览文件 @
633247ac
...
...
@@ -402,6 +402,7 @@ subprojects {
implementation
group:
'org.codehaus.woodstox'
,
name:
'stax2-api'
,
version:
"${stax2apiVersion}"
implementation
group:
'org.reflections'
,
name:
'reflections'
,
version:
'0.9.11'
implementation
group:
'io.prometheus'
,
name:
'simpleclient'
,
version:
'0.5.0'
implementation
group:
'com.belerweb'
,
name:
'pinyin4j'
,
version:
"${pinyin4jVersion}"
//阿里云
implementation
group:
'com.aliyun'
,
name:
'aliyun-java-sdk-core'
,
version:
"${aliyunjavasdkcoreVersion}"
...
...
config/build_docker.gradle
浏览文件 @
633247ac
...
...
@@ -352,6 +352,7 @@ subprojects {
implementation
group:
'org.codehaus.woodstox'
,
name:
'stax2-api'
,
version:
"${stax2apiVersion}"
implementation
group:
'org.reflections'
,
name:
'reflections'
,
version:
'0.9.11'
implementation
group:
'io.prometheus'
,
name:
'simpleclient'
,
version:
'0.5.0'
implementation
group:
'com.belerweb'
,
name:
'pinyin4j'
,
version:
"${pinyin4jVersion}"
//阿里云
implementation
group:
'com.aliyun'
,
name:
'aliyun-java-sdk-core'
,
version:
"${aliyunjavasdkcoreVersion}"
...
...
config/build_jar.gradle
浏览文件 @
633247ac
...
...
@@ -352,6 +352,7 @@ subprojects {
implementation
group:
'org.codehaus.woodstox'
,
name:
'stax2-api'
,
version:
"${stax2apiVersion}"
implementation
group:
'org.reflections'
,
name:
'reflections'
,
version:
'0.9.11'
implementation
group:
'io.prometheus'
,
name:
'simpleclient'
,
version:
'0.5.0'
implementation
group:
'com.belerweb'
,
name:
'pinyin4j'
,
version:
"${pinyin4jVersion}"
//阿里云
implementation
group:
'com.aliyun'
,
name:
'aliyun-java-sdk-core'
,
version:
"${aliyunjavasdkcoreVersion}"
...
...
config/build_standard.gradle
浏览文件 @
633247ac
...
...
@@ -388,6 +388,7 @@ subprojects {
implementation
group:
'org.codehaus.woodstox'
,
name:
'stax2-api'
,
version:
"${stax2apiVersion}"
implementation
group:
'org.reflections'
,
name:
'reflections'
,
version:
'0.9.11'
implementation
group:
'io.prometheus'
,
name:
'simpleclient'
,
version:
'0.5.0'
implementation
group:
'com.belerweb'
,
name:
'pinyin4j'
,
version:
"${pinyin4jVersion}"
//阿里云
implementation
group:
'com.aliyun'
,
name:
'aliyun-java-sdk-core'
,
version:
"${aliyunjavasdkcoreVersion}"
...
...
gradle.properties
浏览文件 @
633247ac
...
...
@@ -143,6 +143,7 @@ aopallianceVersion =1.0
aspectjtoolsVersion
=
1.9.4
evictorVersion
=
1.0.0
lettuceVersion
=
6.1.4.RELEASE
pinyin4jVersion
=
2.5.1
#xml
jdomVersion
=
2.0.2
dom4jVersion
=
1.6.1
...
...
maxkey-core/src/main/java/org/maxkey/entity/AccountsStrategy.java
浏览文件 @
633247ac
...
...
@@ -42,17 +42,20 @@ public class AccountsStrategy extends JpaBaseEntity implements Serializable {
private
String
name
;
@Column
private
String
appId
;
private
byte
[]
appIcon
;
@Column
private
String
appName
;
@Column
private
String
mapping
;
@Column
String
filters
;
@Column
String
orgIdsList
;
@Column
String
suffixes
;
@Column
String
createType
;
@Column
String
status
;
@Column
String
description
;
...
...
@@ -173,7 +176,31 @@ public class AccountsStrategy extends JpaBaseEntity implements Serializable {
this
.
mapping
=
mapping
;
}
@Override
public
byte
[]
getAppIcon
()
{
return
appIcon
;
}
public
void
setAppIcon
(
byte
[]
appIcon
)
{
this
.
appIcon
=
appIcon
;
}
public
String
getCreateType
()
{
return
createType
;
}
public
void
setCreateType
(
String
createType
)
{
this
.
createType
=
createType
;
}
public
String
getSuffixes
()
{
return
suffixes
;
}
public
void
setSuffixes
(
String
suffixes
)
{
this
.
suffixes
=
suffixes
;
}
@Override
public
String
toString
()
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"AccountsStrategy [id="
);
...
...
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java
浏览文件 @
633247ac
...
...
@@ -140,9 +140,6 @@ public class Apps extends JpaBaseEntity implements Serializable {
@Column
private
String
adapter
;
@Column
protected
int
accountMgmt
;
protected
Accounts
appUser
;
@Column
...
...
@@ -586,14 +583,6 @@ public class Apps extends JpaBaseEntity implements Serializable {
this
.
adapterName
=
adapterName
;
}
public
int
getAccountMgmt
()
{
return
accountMgmt
;
}
public
void
setAccountMgmt
(
int
accountMgmt
)
{
this
.
accountMgmt
=
accountMgmt
;
}
@Override
public
String
toString
()
{
StringBuilder
builder
=
new
StringBuilder
();
...
...
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/AccountsMapper.java
浏览文件 @
633247ac
...
...
@@ -22,6 +22,8 @@ package org.maxkey.persistence.mapper;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.mybatis.jpa.persistence.IJpaBaseMapper
;
import
org.maxkey.entity.Accounts
;
import
org.maxkey.entity.AccountsStrategy
;
...
...
@@ -37,4 +39,9 @@ public interface AccountsMapper extends IJpaBaseMapper<Accounts> {
public
List
<
UserInfo
>
queryUserNotInStrategy
(
AccountsStrategy
strategy
);
public
long
deleteByStrategy
(
AccountsStrategy
strategy
);
public
List
<
Accounts
>
queryByAppIdAndDate
(
Accounts
account
);
@Select
(
"select * from mxk_accounts where appid=#{appId} and relatedusername=#{relatedUsername}"
)
public
List
<
Accounts
>
queryByAppIdAndAccount
(
@Param
(
"appId"
)
String
appId
,
@Param
(
"relatedUsername"
)
String
relatedUsername
);
}
maxkey-persistence/src/main/java/org/maxkey/persistence/service/AccountsService.java
浏览文件 @
633247ac
...
...
@@ -34,6 +34,13 @@ import org.maxkey.util.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
net.sourceforge.pinyin4j.PinyinHelper
;
import
net.sourceforge.pinyin4j.format.HanyuPinyinCaseType
;
import
net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat
;
import
net.sourceforge.pinyin4j.format.HanyuPinyinToneType
;
import
net.sourceforge.pinyin4j.format.HanyuPinyinVCharType
;
import
net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination
;
@Repository
public
class
AccountsService
extends
JpaBaseService
<
Accounts
>{
...
...
@@ -133,22 +140,7 @@ public class AccountsService extends JpaBaseService<Accounts>{
account
.
setUserId
(
user
.
getId
());
account
.
setUsername
(
user
.
getUsername
());
account
.
setDisplayName
(
user
.
getDisplayName
());
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"username"
))
{
account
.
setRelatedUsername
(
user
.
getUsername
());
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"mobile"
))
{
account
.
setRelatedUsername
(
user
.
getMobile
());
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"email"
))
{
account
.
setRelatedUsername
(
user
.
getEmail
());
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"employeeNumber"
))
{
account
.
setRelatedUsername
(
user
.
getEmployeeNumber
());
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"windowsAccount"
))
{
account
.
setRelatedUsername
(
user
.
getWindowsAccount
());
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"idCardNo"
))
{
account
.
setRelatedUsername
(
user
.
getIdCardNo
());
}
else
{
account
.
setRelatedUsername
(
user
.
getUsername
());
}
account
.
setRelatedUsername
(
generateAccount
(
user
,
strategy
));
account
.
setRelatedPassword
(
ReciprocalUtils
.
encode
(
userInfoService
.
randomPassword
()));
account
.
setCreateType
(
"automatic"
);
...
...
@@ -160,7 +152,9 @@ public class AccountsService extends JpaBaseService<Accounts>{
deleteByStrategy
(
strategy
);
}
public
void
refreshAllByStrategy
()
{
for
(
AccountsStrategy
strategy
:
accountsStrategyService
.
query
(
null
))
{
AccountsStrategy
queryStrategy
=
new
AccountsStrategy
();
queryStrategy
.
setCreateType
(
"automatic"
);
for
(
AccountsStrategy
strategy
:
accountsStrategyService
.
query
(
queryStrategy
))
{
refreshByStrategy
(
strategy
);
}
}
...
...
@@ -174,4 +168,89 @@ public class AccountsService extends JpaBaseService<Accounts>{
return
getMapper
().
deleteByStrategy
(
strategy
);
}
public
List
<
Accounts
>
queryByAppIdAndDate
(
Accounts
account
)
{
return
getMapper
().
queryByAppIdAndDate
(
account
);
}
public
List
<
Accounts
>
queryByAppIdAndAccount
(
String
appId
,
String
relatedUsername
){
return
getMapper
().
queryByAppIdAndAccount
(
appId
,
relatedUsername
);
}
public
String
generateAccount
(
UserInfo
userInfo
,
AccountsStrategy
accountsStrategy
)
{
String
shortAccount
=
generateAccount
(
userInfo
,
accountsStrategy
,
true
);
String
account
=
generateAccount
(
userInfo
,
accountsStrategy
,
false
);
String
accountResult
=
shortAccount
;
List
<
Accounts
>
AccountsList
=
getMapper
().
queryByAppIdAndAccount
(
accountsStrategy
.
getAppId
(),
shortAccount
+
accountsStrategy
.
getSuffixes
());
if
(!
AccountsList
.
isEmpty
())
{
if
(
accountsStrategy
.
getMapping
().
equalsIgnoreCase
(
"email"
))
{
accountResult
=
account
;
AccountsList
=
getMapper
().
queryByAppIdAndAccount
(
accountsStrategy
.
getAppId
(),
account
+
accountsStrategy
.
getSuffixes
());
}
if
(!
AccountsList
.
isEmpty
())
{
for
(
int
i
=
1
;
i
<
100
;
i
++)
{
accountResult
=
account
+
i
;
AccountsList
=
getMapper
().
queryByAppIdAndAccount
(
accountsStrategy
.
getAppId
(),
accountResult
+
accountsStrategy
.
getSuffixes
());
if
(
AccountsList
.
isEmpty
())
break
;
}
}
}
if
(
StringUtils
.
isNotBlank
(
accountsStrategy
.
getSuffixes
())){
accountResult
=
accountResult
+
accountsStrategy
.
getSuffixes
();
}
return
accountResult
;
}
private
String
generateAccount
(
UserInfo
userInfo
,
AccountsStrategy
strategy
,
boolean
isShort
)
{
String
account
=
""
;
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"username"
))
{
account
=
userInfo
.
getUsername
();
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"mobile"
))
{
account
=
userInfo
.
getMobile
();
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"email"
))
{
try
{
if
(
isShort
)
{
account
=
getPinYinShortName
(
userInfo
.
getDisplayName
());
}
else
{
account
=
getPinYinName
(
userInfo
.
getDisplayName
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"employeeNumber"
))
{
account
=
userInfo
.
getEmployeeNumber
();
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"windowsAccount"
))
{
account
=
userInfo
.
getWindowsAccount
();
}
else
if
(
strategy
.
getMapping
().
equalsIgnoreCase
(
"idCardNo"
))
{
account
=
userInfo
.
getIdCardNo
();
}
else
{
account
=
userInfo
.
getUsername
();
}
return
account
;
}
public
static
String
getPinYinName
(
String
name
)
throws
BadHanyuPinyinOutputFormatCombination
{
HanyuPinyinOutputFormat
pinyinFormat
=
new
HanyuPinyinOutputFormat
();
pinyinFormat
.
setCaseType
(
HanyuPinyinCaseType
.
LOWERCASE
);
pinyinFormat
.
setToneType
(
HanyuPinyinToneType
.
WITHOUT_TONE
);
pinyinFormat
.
setVCharType
(
HanyuPinyinVCharType
.
WITH_V
);
return
PinyinHelper
.
toHanYuPinyinString
(
name
,
pinyinFormat
,
""
,
false
);
}
public
static
String
getPinYinShortName
(
String
name
)
throws
BadHanyuPinyinOutputFormatCombination
{
char
[]
strs
=
name
.
toCharArray
();
String
pinyinName
=
""
;
for
(
int
i
=
0
;
i
<
strs
.
length
;
i
++)
{
if
(
i
==
0
)
{
pinyinName
+=
getPinYinName
(
strs
[
i
]+
""
);
}
else
{
pinyinName
+=
getPinYinName
(
strs
[
i
]+
""
).
charAt
(
0
);
}
}
return
pinyinName
;
}
}
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/AccountsStrategyMapper.xml
浏览文件 @
633247ac
...
...
@@ -3,27 +3,29 @@
<mapper
namespace=
"org.maxkey.persistence.mapper.AccountsStrategyMapper"
>
<sql
id=
"where_statement"
>
<if
test=
"id != null and id != ''"
>
and id =
#{id}
</if>
<if
test=
"appId != null and appId != ''"
>
and appid =
#{appId}
</if>
<if
test=
"name != null and name != ''"
>
and name =
#{name}
</if>
<if
test=
"id != null and id != ''"
>
and mas.id =
#{id}
</if>
<if
test=
"appId != null and appId != ''"
>
and mas.appid =
#{appId}
</if>
<if
test=
"name != null and name != ''"
>
and mas.name =
#{name}
</if>
</sql>
<select
id=
"queryPageResults"
parameterType=
"AccountsStrategy"
resultType=
"AccountsStrategy"
>
select
*
from
mxk_accounts_strategy
where
(1=1)
<include
refid=
"where_statement"
/>
</select>
<select
id=
"queryPageResults"
parameterType=
"AccountsStrategy"
resultType=
"AccountsStrategy"
>
select
mas.*,
ma.icon appicon
from
mxk_accounts_strategy mas,
mxk_apps ma
where
mas.appid = ma.id
<include
refid=
"where_statement"
/>
</select>
</mapper>
\ No newline at end of file
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/AppsMapper.xml
浏览文件 @
633247ac
...
...
@@ -21,9 +21,6 @@
<if
test=
"vendor != null and vendor != ''"
>
and vendor = #{vendor}
</if>
<if
test=
"accountMgmt == 1 or accountMgmt == 2"
>
and accountmgmt = #{accountMgmt}
</if>
</sql>
...
...
@@ -71,7 +68,6 @@
principal,
credentials,
accountmgmt,
visible,
...
...
@@ -113,7 +109,6 @@
#{principal},
#{credentials},
#{accountMgmt},
#{visible},
...
...
@@ -162,7 +157,6 @@
</if>
principal = #{principal},
credentials = #{credentials},
accountmgmt = #{accountMgmt},
visible = #{visible},
sortindex = #{sortIndex},
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java
浏览文件 @
633247ac
...
...
@@ -21,7 +21,10 @@ import org.apache.mybatis.jpa.persistence.JpaPageResults;
import
org.maxkey.constants.ConstantsOperateMessage
;
import
org.maxkey.crypto.ReciprocalUtils
;
import
org.maxkey.entity.Accounts
;
import
org.maxkey.entity.AccountsStrategy
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.service.AccountsService
;
import
org.maxkey.persistence.service.AccountsStrategyService
;
import
org.maxkey.persistence.service.AppsService
;
import
org.maxkey.persistence.service.UserInfoService
;
import
org.maxkey.web.WebContext
;
...
...
@@ -48,6 +51,10 @@ public class AccountsController {
@Qualifier
(
"accountsService"
)
AccountsService
accountsService
;
@Autowired
@Qualifier
(
"accountsStrategyService"
)
AccountsStrategyService
accountsStrategyService
;
@Autowired
@Qualifier
(
"appsService"
)
protected
AppsService
appsService
;
...
...
@@ -142,4 +149,11 @@ public class AccountsController {
}
@ResponseBody
@RequestMapping
(
value
=
"/generate"
)
public
String
generate
(
@ModelAttribute
(
"appAccounts"
)
Accounts
appAccounts
)
{
AccountsStrategy
accountsStrategy
=
accountsStrategyService
.
get
(
appAccounts
.
getStrategyId
());
UserInfo
userInfo
=
userInfoService
.
get
(
appAccounts
.
getUserId
());
return
accountsService
.
generateAccount
(
userInfo
,
accountsStrategy
);
}
}
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsStrategyController.java
浏览文件 @
633247ac
...
...
@@ -57,12 +57,20 @@ public class AccountsStrategyController {
return
new
ModelAndView
(
"accountsstrategy/accountsstrategyList"
);
}
@RequestMapping
(
value
={
"/select"
})
public
ModelAndView
selectAccountsStrategyList
(){
return
new
ModelAndView
(
"accountsstrategy/selectAccountsStrategy"
);
}
@RequestMapping
(
value
=
{
"/grid"
})
@ResponseBody
public
JpaPageResults
<
AccountsStrategy
>
queryDataGrid
(
@ModelAttribute
(
"accountsStrategy"
)
AccountsStrategy
accountsStrategy
)
{
_logger
.
debug
(
""
+
accountsStrategy
);
return
accountsStrategyService
.
queryPageResults
(
accountsStrategy
);
JpaPageResults
<
AccountsStrategy
>
accountsStrategyList
=
accountsStrategyService
.
queryPageResults
(
accountsStrategy
);
for
(
AccountsStrategy
strategy
:
accountsStrategyList
.
getRows
()){
WebContext
.
setAttribute
(
strategy
.
getId
(),
strategy
.
getAppIcon
());
}
return
accountsStrategyList
;
}
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message.properties
浏览文件 @
633247ac
...
...
@@ -313,7 +313,6 @@ apps.extendAttr.parameter.type=\u7c7b\u578b
apps.extendAttr.parameter.value
=
\u
503c
apps.principal
=
\u
51ed
\u
8bc1
apps.credentials
=
\u
79d8
\u
94a5
apps.accountMgmt
=
\u
8D26
\u
53F7
\u
7BA1
\u7406
#adapter
apps.adapter.name
=
\u
540D
\u
79F0
apps.adapter.adapter
=
\u9002\u
914D
\u5668
...
...
@@ -456,6 +455,10 @@ accounts.strategy.name=\u7B56\u7565\u540D\u79F0
accounts.strategy.mapping
=
\u
8D26
\u
53F7
\u6620\u
5C04
accounts.strategy.filters
=
\u7528\u6237\u6761\u
4EF6
accounts.strategy.orgidslist
=
\u
673A
\u6784\u5217\u8868
accounts.strategy.suffixes
=
\u
540E
\u
7F00
accounts.strategy.createType
=
\u
65B9
\u
5F0F
accounts.strategy.createType.manual
=
\u
624B
\u
52A8
accounts.strategy.createType.automatic
=
\u
81EA
\u
52A8
#socials.provider
socials.provider.id
=
\u
7F16
\u
53F7
socials.provider.provider
=
\u
63D0
\u
4F9B
\u8005
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_en.properties
浏览文件 @
633247ac
...
...
@@ -316,7 +316,6 @@ apps.extendAttr.parameter.type=type
apps.extendAttr.parameter.value
=
value
apps.principal
=
principal
apps.credentials
=
credentials
apps.accountMgmt
=
AccountMgmt
#adapter
apps.adapter.name
=
name
...
...
@@ -464,6 +463,10 @@ accounts.strategy.name=name
accounts.strategy.mapping
=
mapping
accounts.strategy.filters
=
filters
accounts.strategy.orgidslist
=
orgIdsList
accounts.strategy.suffixes
=
suffixes
accounts.strategy.createType
=
createType
accounts.strategy.createType.manual
=
manual
accounts.strategy.createType.automatic
=
automatic
socials.provider.id
=
Id
socials.provider.provider
=
Provider
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/messages/message_zh_CN.properties
浏览文件 @
633247ac
...
...
@@ -315,7 +315,6 @@ apps.extendAttr.parameter.type=\u7c7b\u578b
apps.extendAttr.parameter.value
=
\u
503c
apps.principal
=
\u
51ed
\u
8bc1
apps.credentials
=
\u
79d8
\u
94a5
apps.accountMgmt
=
\u
8D26
\u
53F7
\u
7BA1
\u7406
apps.adapter.name
=
\u
540D
\u
79F0
apps.adapter.adapter
=
\u9002\u
914D
\u5668
apps.adapter.protocol
=
\u
534F
\u
8BAE
...
...
@@ -461,6 +460,10 @@ accounts.strategy.name=\u7B56\u7565\u540D\u79F0
accounts.strategy.mapping
=
\u
8D26
\u
53F7
\u6620\u
5C04
accounts.strategy.filters
=
\u7528\u6237\u6761\u
4EF6
accounts.strategy.orgidslist
=
\u
673A
\u6784\u5217\u8868
accounts.strategy.suffixes
=
\u
540E
\u
7F00
accounts.strategy.createType
=
\u
65B9
\u
5F0F
accounts.strategy.createType.manual
=
\u
624B
\u
52A8
accounts.strategy.createType.automatic
=
\u
81EA
\u
52A8
#socials.provider
socials.provider.id
=
\u
7F16
\u
53F7
socials.provider.provider
=
\u
63D0
\u
4F9B
\u8005
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accounts/accountsAdd.ftl
浏览文件 @
633247ac
...
...
@@ -17,6 +17,19 @@
$
(
"
#relatedPassword
"
).
val
(
data
+
""
);
});
});
$
(
"
#generateAccountBtn
"
).
on
(
"
click
"
,
function
(){
$
.
post
(
"
<@base/>/accounts/generate/
"
,
{
_method
:
"
post
"
,
userId
:
$
(
"
#userId
"
).
val
(),
appId
:
$
(
"
#appId
"
).
val
(),
strategyId
:
$
(
"
#strategyId
"
).
val
(),
currTime
:(
new
Date
()).
getTime
()
},
function
(
data
)
{
$
(
"
#relatedUsername
"
).
val
(
data
+
""
);
});
});
$
(
"
#view
"
).
on
(
"
click
"
,
function
(){
if
(
$
(
"
#relatedPassword
"
).
attr
(
"
type
"
)
==
"
text
"
){
$
(
"
#relatedPassword
"
).
attr
(
"
type
"
,
"
password
"
);
...
...
@@ -73,7 +86,7 @@
</td>
<td>
<input
class=
"button btn btn-primary mr-3 window"
type=
"button"
id=
"selectAppsubmitBtn"
value=
"<@locale code="
button.text.select
"
/>
"
wurl="
<
@
base
/>
/a
pps/select?accountMgmt=1
"
wurl="
<
@
base
/>
/a
ccountsstrategy/select
"
wwidth="800"
wheight="620"
target="window"/>
...
...
@@ -86,6 +99,7 @@
</td>
<td>
<input
class=
"button btn btn-primary mr-3"
type=
"button"
id=
"generateAccountBtn"
value=
"<@locale code="
button.text.generate
"
/>
"/>
</td>
</tr>
<tr>
...
...
@@ -104,7 +118,9 @@
<input
id=
"_method"
type=
"hidden"
name=
"_method"
value=
"post"
/>
<input
id=
"status"
type=
"hidden"
name=
"status"
value=
"1"
/>
<input
type=
"hidden"
id=
"userId"
name=
"userId"
class=
"userId"
title=
""
value=
"${model.userId!}"
/>
<input
type=
"hidden"
id=
"strategyId"
name=
"strategyId"
class=
"strategyId"
title=
""
value=
"${model.strategyId!}"
/>
<input
type=
"hidden"
id=
"appId"
name=
"appId"
class=
"appId"
title=
""
value=
"${model.appId!}"
/>
<input
type=
"hidden"
id=
"createType"
name=
"createType"
title=
""
value=
"manual"
/>
<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
"
/>
"/>
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/accountsStrategyAdd.ftl
浏览文件 @
633247ac
...
...
@@ -214,6 +214,26 @@ function showOrgsTree() {
</select>
</td>
</tr>
<tr>
<th><
@
locale
code=
"accounts.strategy.suffixes"
/>
:
</th>
<td
nowrap
>
<input
type=
"text"
id=
"suffixes"
name=
"suffixes"
class=
"form-control"
title=
""
value=
""
/>
</td>
</tr>
<tr>
<th><
@
locale
code=
"accounts.strategy.createType"
/>
:
</th>
<td
nowrap
>
<select
id=
"createType"
name=
"createType"
class=
"form-control form-select"
>
<option
value=
"manual"
selected
>
<
@
locale
code=
"accounts.strategy.createType.manual"
/>
</option>
<option
value=
"automatic"
>
<
@
locale
code=
"accounts.strategy.createType.automatic"
/>
</option>
</select>
</td>
</tr>
<tr>
<th><
@
locale
code=
"accounts.strategy.orgidslist"
/>
:
</th>
<td
nowrap
>
...
...
@@ -224,13 +244,13 @@ function showOrgsTree() {
<tr>
<th><
@
locale
code=
"accounts.strategy.filters"
/>
:
</th>
<td
nowrap
>
<textarea
id=
"filters"
name=
"filters"
class=
"form-control"
rows=
"
4
"
cols=
"20"
></textarea>
<textarea
id=
"filters"
name=
"filters"
class=
"form-control"
rows=
"
3
"
cols=
"20"
></textarea>
</td>
</tr>
<tr>
<th><
@
locale
code=
"common.text.description"
/>
:
</th>
<td
nowrap
>
<textarea
id=
"description"
name=
"description"
class=
"form-control"
rows=
"
3
"
cols=
"20"
></textarea>
<textarea
id=
"description"
name=
"description"
class=
"form-control"
rows=
"
2
"
cols=
"20"
></textarea>
</td>
</tr>
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/accountsStrategyList.ftl
浏览文件 @
633247ac
...
...
@@ -5,8 +5,17 @@
<
#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" />
'
;
};
return
value
==
'
0
'
?
'
<@locale code="common.text.no" />
'
:
'
<@locale code="common.text.yes" />
'
;
};
function
createTypeFormatter
(
value
,
row
,
index
){
return
value
==
'
manual
'
?
'
<@locale code="accounts.strategy.createType.manual" />
'
:
'
<@locale code="accounts.strategy.createType.automatic" />
'
;
};
function
iconFormatter
(
value
,
row
,
index
){
return
"
<img width='30' border='0px' src='<@base/>/image/
"
+
value
+
"
'/>
"
;
};
</script>
</head>
<body>
...
...
@@ -96,9 +105,12 @@
<th
data-checkbox=
"true"
></th>
<th
data-sortable=
"true"
data-field=
"id"
data-visible=
"false"
>
Id
</th>
<th
data-field=
"name"
><
@
locale
code=
"accounts.strategy.name"
/></th>
<th
data-field=
"appName"
><
@
locale
code=
"app.name"
/></th>
<th
data-field=
"status"
data-formatter=
"dynamicFormatter"
><
@
locale
code=
"accounts.strategy.status"
/></th>
<th
data-field=
"description"
><
@
locale
code=
"common.text.description"
/></th>
<th
data-field=
"id"
data-formatter=
"iconFormatter"
><
@
locale
code=
"apps.icon"
/></th>
<th
data-field=
"appId"
data-visible=
"false"
><
@
locale
code=
"apps.id"
/></th>
<th
data-field=
"appName"
><
@
locale
code=
"apps.name"
/></th>
<th
data-field=
"createType"
data-formatter=
"createTypeFormatter"
><
@
locale
code=
"accounts.strategy.createType"
/></th>
<th
data-field=
"status"
data-formatter=
"dynamicFormatter"
><
@
locale
code=
"common.text.status"
/></th>
<th
data-field=
"description"
data-visible=
"false"
><
@
locale
code=
"common.text.description"
/></th>
<th
data-field=
"createdBy"
data-visible=
"false"
><
@
locale
code=
"common.text.createdby"
/></th>
<th
data-field=
"createdDate"
data-visible=
"false"
><
@
locale
code=
"common.text.createddate"
/></th>
<th
data-field=
"modifiedBy"
data-visible=
"false"
><
@
locale
code=
"common.text.modifiedby"
/></th>
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/accountsStrategyUpdate.ftl
浏览文件 @
633247ac
...
...
@@ -224,6 +224,26 @@ function showOrgsTree() {
</select>
</td>
</tr>
<tr>
<th><
@
locale
code=
"accounts.strategy.suffixes"
/>
:
</th>
<td
nowrap
>
<input
type=
"text"
id=
"suffixes"
name=
"suffixes"
class=
"form-control"
title=
""
value=
"${model.suffixes!}"
/>
</td>
</tr>
<tr>
<th><
@
locale
code=
"accounts.strategy.createType"
/>
:
</th>
<td
nowrap
>
<select
id=
"createType"
name=
"createType"
class=
"form-control form-select"
>
<option
value=
"manual"
<
#if
model.createType
?
contains
("
manual
")
>
selected
</
#
if>
>
<
@
locale
code=
"accounts.strategy.createType.manual"
/>
</option>
<option
value=
"automatic"
<
#if
model.createType
?
contains
("
automatic
")
>
selected
</
#
if>
>
<
@
locale
code=
"accounts.strategy.createType.automatic"
/>
</option>
</select>
</td>
</tr>
<tr>
<th><
@
locale
code=
"accounts.strategy.orgidslist"
/>
:
</th>
...
...
@@ -235,13 +255,13 @@ function showOrgsTree() {
<tr>
<th><
@
locale
code=
"accounts.strategy.filters"
/>
:
</th>
<td
nowrap
>
<textarea
id=
"filters"
name=
"filters"
class=
"form-control"
rows=
"
4
"
cols=
"20"
>
${model.filters!}
</textarea>
<textarea
id=
"filters"
name=
"filters"
class=
"form-control"
rows=
"
3
"
cols=
"20"
>
${model.filters!}
</textarea>
</td>
</tr>
<tr>
<th><
@
locale
code=
"common.text.description"
/>
:
</th>
<td
nowrap
>
<textarea
id=
"description"
name=
"description"
class=
"form-control"
rows=
"
3
"
cols=
"20"
>
${model.description!}
</textarea>
<textarea
id=
"description"
name=
"description"
class=
"form-control"
rows=
"
2
"
cols=
"20"
>
${model.description!}
</textarea>
</td>
</tr>
<tr>
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/accountsstrategy/selectAccountsStrategy.ftl
0 → 100644
浏览文件 @
633247ac
<!DOCTYPE HTML>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<
#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
createTypeFormatter
(
value
,
row
,
index
){
return
value
==
'
manual
'
?
'
<@locale code="accounts.strategy.createType.manual" />
'
:
'
<@locale code="accounts.strategy.createType.automatic" />
'
;
};
function
iconFormatter
(
value
,
row
,
index
){
return
"
<img width='30' border='0px' src='<@base/>/image/
"
+
value
+
"
'/>
"
;
};
$
(
function
()
{
$
(
"
#selectBtn
"
).
on
(
"
click
"
,
function
(){
var
seldata
=
$
.
dataGridSelRowsData
(
"
#datagrid
"
);
console
.
log
(
seldata
[
0
].
id
+
"
-
"
+
seldata
[
0
].
name
);
$
(
"
.strategyId
"
,
window
.
parent
.
document
).
val
(
seldata
[
0
].
id
);
$
(
"
.appId
"
,
window
.
parent
.
document
).
val
(
seldata
[
0
].
appId
);
$
(
"
.appName
"
,
window
.
parent
.
document
).
val
(
seldata
[
0
].
appName
);
$
.
closeWindow
();
});
});
</script>
</head>
<body>
<table
class=
"table table-bordered"
>
<tr>
<td
width=
"120px"
><
@
locale
code=
"accounts.strategy.name"
/>
:
</td>
<td
width=
"375px"
>
<form
id=
"basic_search_form"
>
<input
class=
"form-control"
type=
"text"
name=
"name"
style =
"width:150px;float:left;"
>
<input
class=
"button btn btn-primary mr-3"
id=
"searchBtn"
type=
"button"
size=
"50"
value=
"<@locale code="
button.text.search
"
/>
">
<!--<input class="button btn btn-secondary" id="advancedSearchExpandBtn" type="button" size="50" value="<@locale code="button.text.expandsearch"/>" expandValue="<@locale code="button.text.expandsearch"/>" collapseValue="<@locale code="button.text.collapsesearch"/>">
-->
</form>
</td>
<td
colspan=
"2"
>
<div
>
<input
class=
"button btn btn-primary mr-3"
id=
"selectBtn"
type=
"button"
value=
"<@locale code="
button.text.select
"
/>
" />
</div>
</td>
</tr>
</table>
<div
id=
"advanced_search"
>
<form
id=
"advanced_search_form"
>
</form>
</div>
<table
data-url=
"<@base/>/accountsstrategy/grid"
id=
"datagrid"
data-toggle=
"table"
data-classes=
"table table-bordered table-hover table-striped"
data-click-to-select=
"true"
data-pagination=
"true"
data-total-field=
"records"
data-page-list=
"[10, 25, 50, 100]"
data-search=
"false"
data-locale=
"zh-CN"
data-query-params=
"dataGridQueryParams"
data-query-params-type=
"pageSize"
data-side-pagination=
"server"
>
<thead>
<tr>
<th
data-checkbox=
"true"
></th>
<th
data-sortable=
"true"
data-field=
"id"
data-visible=
"false"
>
Id
</th>
<th
data-field=
"name"
><
@
locale
code=
"accounts.strategy.name"
/></th>
<th
data-field=
"id"
data-formatter=
"iconFormatter"
><
@
locale
code=
"apps.icon"
/></th>
<th
data-field=
"appId"
data-visible=
"false"
><
@
locale
code=
"apps.id"
/></th>
<th
data-field=
"appName"
><
@
locale
code=
"apps.name"
/></th>
<th
data-field=
"createType"
data-formatter=
"createTypeFormatter"
><
@
locale
code=
"accounts.strategy.createType"
/></th>
<th
data-field=
"status"
data-formatter=
"dynamicFormatter"
><
@
locale
code=
"common.text.status"
/></th>
<th
data-field=
"createdBy"
data-visible=
"false"
><
@
locale
code=
"common.text.createdby"
/></th>
<th
data-field=
"createdDate"
data-visible=
"false"
><
@
locale
code=
"common.text.createddate"
/></th>
<th
data-field=
"modifiedBy"
data-visible=
"false"
><
@
locale
code=
"common.text.modifiedby"
/></th>
<th
data-field=
"modifiedDate"
data-visible=
"false"
><
@
locale
code=
"common.text.modifieddate"
/></th>
</tr>
</thead>
</table>
</body>
</html>
\ No newline at end of file
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/appAddCommon.ftl
浏览文件 @
633247ac
...
...
@@ -24,24 +24,15 @@
</td>
</tr>
<tr>
<th><
@locale code="apps.loginUrl"/>:<
/th>
<th></th>
<td colspan="3">
<input type="text" class="form-control" id="loginUrl" name="loginUrl" size="100" title="" value="" required="" />
</td>
</tr>
<tr>
<th><@locale code="apps.logoutUrl"/>:</th>
<td colspan="3">
<input type="text" class="form-control" id="logoutUrl" name="logoutUrl" size="100" title="" value="" required="" />
</td>
</tr>
<tr>
<th><@locale code="apps.accountMgmt"/>:</th>
<th><@locale code="apps.loginUrl"/>:</th>
<td>
<select id="accountMgmt" name="accountMgmt" class="form-control form-select" >
<option value="1" ><@locale code="common.text.status.enabled"/></option>
<option value="2" selected ><@locale code="common.text.status.disabled"/></option>
</select>
<input type="text" class="form-control" id="logoutUrl" name="logoutUrl" size="100" title="" value="" />
</td>
<th><@locale code="apps.logoutType"/></th>
<td>
...
...
maxkey-webs/maxkey-web-mgt/src/main/resources/templates/views/apps/appUpdateCommon.ftl
浏览文件 @
633247ac
...
...
@@ -31,17 +31,8 @@
</tr>
<tr>
<th><@locale code="apps.logoutUrl"/>:</th>
<td colspan="3">
<input type="text" class="form-control" id="logoutUrl" name="logoutUrl" title="" value="${model.logoutUrl!}" required="" />
</td>
</tr>
<tr>
<th><@locale code="apps.accountMgmt"/>:</th>
<td>
<select id="accountMgmt" name="accountMgmt" class="form-control form-select" >
<option value="1" <#if 1==model.accountMgmt!>selected</#if> ><@locale code="common.text.status.enabled"/></option>
<option value="2" <#if 2==model.accountMgmt!>selected</#if> ><@locale code="common.text.status.disabled"/></option>
</select>
<input type="text" class="form-control" id="logoutUrl" name="logoutUrl" title="" value="${model.logoutUrl!}" />
</td>
<th><@locale code="apps.logoutType"/></th>
<td>
...
...
setEnvVars.bat
浏览文件 @
633247ac
echo
off
echo
set
env
set
JAVA_HOME
=
D
:\IDE\jdk
-
1
7
set
GRADLE_HOME
=
D
:\IDE\gradle
-
7
.2
set
JAVA_HOME
=
D
:\IDE\jdk
-
8
.0.312.
7
set
GRADLE_HOME
=
C
:\IDE\gradle
-
7
.2
call
%JAVA_HOME%
/bin/java -version
call
%GRADLE_HOME%
/bin/gradle -version
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录