mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 17:38:32 +08:00
社交账号登录 &图片上传
This commit is contained in:
parent
030a28c82f
commit
a8ed05b522
@ -102,7 +102,7 @@ public class SavedRequestAwareAuthenticationSuccessHandler
|
|||||||
logger.trace("CAS " + request.getParameter(WebConstants.CAS_SERVICE_PARAMETER));
|
logger.trace("CAS " + request.getParameter(WebConstants.CAS_SERVICE_PARAMETER));
|
||||||
if (request.getParameter(WebConstants.CAS_SERVICE_PARAMETER) != null
|
if (request.getParameter(WebConstants.CAS_SERVICE_PARAMETER) != null
|
||||||
&& request.getParameter(WebConstants.CAS_SERVICE_PARAMETER).startsWith("http")) {
|
&& request.getParameter(WebConstants.CAS_SERVICE_PARAMETER).startsWith("http")) {
|
||||||
targetUrl = WebContext.getHttpContextPath() + "/authz/cas/login?service="
|
targetUrl = WebContext.getHttpContextPath(true) + "/authz/cas/login?service="
|
||||||
+ request.getParameter(WebConstants.CAS_SERVICE_PARAMETER);
|
+ request.getParameter(WebConstants.CAS_SERVICE_PARAMETER);
|
||||||
}
|
}
|
||||||
targetUrl = targetUrl == null ? "/forwardindex" : targetUrl;
|
targetUrl = targetUrl == null ? "/forwardindex" : targetUrl;
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package org.maxkey.web.contorller;
|
package org.maxkey.authn.web;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -37,7 +37,6 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
@ -55,11 +54,11 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
|||||||
@RequestMapping(value={"/authorize/{provider}"}, method = RequestMethod.GET)
|
@RequestMapping(value={"/authorize/{provider}"}, method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<?> authorize( HttpServletRequest request,
|
public ResponseEntity<?> authorize( HttpServletRequest request,
|
||||||
@PathVariable String provider,
|
@PathVariable String provider
|
||||||
@RequestHeader("Origin") String originURL
|
|
||||||
) {
|
) {
|
||||||
_logger.trace("SocialSignOn provider : " + provider);
|
_logger.trace("SocialSignOn provider : " + provider);
|
||||||
String instId = WebContext.getInst().getId();
|
String instId = WebContext.getInst().getId();
|
||||||
|
String originURL =WebContext.getHttpContextPath(request,false);
|
||||||
String authorizationUrl =
|
String authorizationUrl =
|
||||||
buildAuthRequest(
|
buildAuthRequest(
|
||||||
instId,
|
instId,
|
||||||
@ -74,9 +73,9 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
|||||||
@RequestMapping(value={"/scanqrcode/{provider}"}, method = RequestMethod.GET)
|
@RequestMapping(value={"/scanqrcode/{provider}"}, method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<?> scanQRCode(HttpServletRequest request,
|
public ResponseEntity<?> scanQRCode(HttpServletRequest request,
|
||||||
@PathVariable("provider") String provider,
|
@PathVariable("provider") String provider) {
|
||||||
@RequestHeader("Origin") String originURL) {
|
|
||||||
String instId = WebContext.getInst().getId();
|
String instId = WebContext.getInst().getId();
|
||||||
|
String originURL =WebContext.getHttpContextPath(request,false);
|
||||||
AuthRequest authRequest =
|
AuthRequest authRequest =
|
||||||
buildAuthRequest(
|
buildAuthRequest(
|
||||||
instId,
|
instId,
|
||||||
@ -102,10 +101,11 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
|||||||
|
|
||||||
@RequestMapping(value={"/bind/{provider}"}, method = RequestMethod.GET)
|
@RequestMapping(value={"/bind/{provider}"}, method = RequestMethod.GET)
|
||||||
public ResponseEntity<?> bind(@PathVariable String provider,
|
public ResponseEntity<?> bind(@PathVariable String provider,
|
||||||
@RequestHeader("Origin") String originURL,
|
@CurrentUser UserInfo userInfo,
|
||||||
@CurrentUser UserInfo userInfo) {
|
HttpServletRequest request) {
|
||||||
//auth call back may exception
|
//auth call back may exception
|
||||||
try {
|
try {
|
||||||
|
String originURL =WebContext.getHttpContextPath(request,false);
|
||||||
SocialsAssociate socialsAssociate =
|
SocialsAssociate socialsAssociate =
|
||||||
this.authCallback(userInfo.getInstId(),provider,originURL + applicationConfig.getFrontendUri());
|
this.authCallback(userInfo.getInstId(),provider,originURL + applicationConfig.getFrontendUri());
|
||||||
socialsAssociate.setSocialUserInfo(accountJsonString);
|
socialsAssociate.setSocialUserInfo(accountJsonString);
|
||||||
@ -127,9 +127,10 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
|
|||||||
|
|
||||||
@RequestMapping(value={"/callback/{provider}"}, method = RequestMethod.GET)
|
@RequestMapping(value={"/callback/{provider}"}, method = RequestMethod.GET)
|
||||||
public ResponseEntity<?> callback(@PathVariable String provider,
|
public ResponseEntity<?> callback(@PathVariable String provider,
|
||||||
@RequestHeader("Origin") String originURL) {
|
HttpServletRequest request) {
|
||||||
//auth call back may exception
|
//auth call back may exception
|
||||||
try {
|
try {
|
||||||
|
String originURL =WebContext.getHttpContextPath(request,false);
|
||||||
String instId = WebContext.getInst().getId();
|
String instId = WebContext.getInst().getId();
|
||||||
SocialsAssociate socialsAssociate =
|
SocialsAssociate socialsAssociate =
|
||||||
this.authCallback(instId,provider,originURL + applicationConfig.getFrontendUri());
|
this.authCallback(instId,provider,originURL + applicationConfig.getFrontendUri());
|
||||||
|
|||||||
@ -231,8 +231,8 @@ public class InitializeContext extends HttpServlet {
|
|||||||
*/
|
*/
|
||||||
public void showLicense() {
|
public void showLicense() {
|
||||||
_logger.info("-----------------------------------------------------------");
|
_logger.info("-----------------------------------------------------------");
|
||||||
_logger.info("+ MaxKey ");
|
_logger.info("+ MaxKey Community Edition ");
|
||||||
_logger.info("+ Single Sign On ( SSO ) ");
|
_logger.info("+ Single Sign On ( SSO ) ");
|
||||||
_logger.info("+ Version {}",
|
_logger.info("+ Version {}",
|
||||||
WebContext.properties.getProperty("application.formatted-version"));
|
WebContext.properties.getProperty("application.formatted-version"));
|
||||||
_logger.info("+");
|
_logger.info("+");
|
||||||
|
|||||||
@ -179,9 +179,9 @@ public final class WebContext {
|
|||||||
*
|
*
|
||||||
* @return String HttpContextPath
|
* @return String HttpContextPath
|
||||||
*/
|
*/
|
||||||
public static String getHttpContextPath() {
|
public static String getHttpContextPath(boolean isContextPath) {
|
||||||
HttpServletRequest httpServletRequest = WebContext.getRequest();
|
HttpServletRequest httpServletRequest = WebContext.getRequest();
|
||||||
return getHttpContextPath(httpServletRequest);
|
return getHttpContextPath(httpServletRequest,isContextPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -190,32 +190,44 @@ public final class WebContext {
|
|||||||
* @return String eg:http://192.168.1.20:9080/webcontext or
|
* @return String eg:http://192.168.1.20:9080/webcontext or
|
||||||
* http://www.website.com/webcontext
|
* http://www.website.com/webcontext
|
||||||
*/
|
*/
|
||||||
public static String getHttpContextPath(HttpServletRequest httpServletRequest) {
|
public static String getHttpContextPath(HttpServletRequest request,boolean isContextPath) {
|
||||||
ApplicationConfig applicationConfig =
|
ApplicationConfig applicationConfig =
|
||||||
WebContext.getBean("applicationConfig",ApplicationConfig.class);
|
WebContext.getBean("applicationConfig",ApplicationConfig.class);
|
||||||
|
|
||||||
_logger.trace("Config ServerPrefix " + applicationConfig.getServerPrefix());
|
_logger.trace("Config ServerPrefix " + applicationConfig.getServerPrefix());
|
||||||
_logger.trace("Config DomainName " + applicationConfig.getDomainName());
|
_logger.trace("Config DomainName " + applicationConfig.getDomainName());
|
||||||
_logger.trace("ServerName " + httpServletRequest.getServerName());
|
_logger.trace("ServerName " + request.getServerName());
|
||||||
|
|
||||||
String httpContextPath ="";
|
StringBuilder url = new StringBuilder();
|
||||||
if (httpServletRequest.getServerName().matches(ipAddressRegex)
|
if (request.getServerName().matches(ipAddressRegex)
|
||||||
||httpServletRequest.getServerName().equalsIgnoreCase("localhost")) {
|
||request.getServerName().equalsIgnoreCase("localhost")) {
|
||||||
httpContextPath = httpServletRequest.getScheme().toLowerCase()
|
url.append(request.getScheme().toLowerCase())
|
||||||
+ "://"+httpServletRequest.getServerName();
|
.append("://").append(request.getServerName())
|
||||||
|
.append(request.getServerPort());
|
||||||
}else {
|
}else {
|
||||||
httpContextPath = applicationConfig.getServerName() ;
|
String scheme = request.getScheme().toLowerCase();
|
||||||
|
String serverName = request.getServerName();
|
||||||
|
int serverPort = request.getServerPort();
|
||||||
|
|
||||||
|
url.append(scheme).append("://").append(serverName);
|
||||||
|
// Only add port if not default
|
||||||
|
if ("http".equals(scheme)) {
|
||||||
|
if (serverPort != 80) {
|
||||||
|
url.append(":").append(serverPort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ("https".equals(scheme)) {
|
||||||
|
if (serverPort != 443) {
|
||||||
|
url.append(":").append(serverPort);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int port = httpServletRequest.getServerPort();
|
if(isContextPath) {
|
||||||
if(!(port==80 || port==443)){
|
url.append(request.getContextPath());
|
||||||
httpContextPath += ":"+port;
|
|
||||||
}
|
}
|
||||||
|
_logger.trace("httpContextPath {}" , url);
|
||||||
httpContextPath += httpServletRequest.getContextPath() + "";
|
return url.toString();
|
||||||
|
|
||||||
_logger.trace("httpContextPath " + httpContextPath);
|
|
||||||
return httpContextPath;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class BasePathTagDirective implements TemplateDirectiveModel {
|
|||||||
public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)
|
public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body)
|
||||||
throws TemplateException, IOException {
|
throws TemplateException, IOException {
|
||||||
|
|
||||||
env.getOut().append(WebContext.getHttpContextPath(request));
|
env.getOut().append(WebContext.getHttpContextPath(request,true));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -111,15 +111,15 @@ public class SamlMetadataEndpoint {
|
|||||||
|
|
||||||
IDPSSODescriptor descriptor = metadataGenerator.buildIDPSSODescriptor();
|
IDPSSODescriptor descriptor = metadataGenerator.buildIDPSSODescriptor();
|
||||||
|
|
||||||
descriptor.getSingleSignOnServices().add(metadataGenerator.getSingleSignOnService(WebContext.getHttpContextPath()+"/authz/saml20/"+appId,null));
|
descriptor.getSingleSignOnServices().add(metadataGenerator.getSingleSignOnService(WebContext.getHttpContextPath(true)+"/authz/saml20/"+appId,null));
|
||||||
|
|
||||||
descriptor.getSingleSignOnServices().add(metadataGenerator.getSingleSignOnService(WebContext.getHttpContextPath()+"/authz/saml20/"+appId,SAMLConstants.SAML2_REDIRECT_BINDING_URI));
|
descriptor.getSingleSignOnServices().add(metadataGenerator.getSingleSignOnService(WebContext.getHttpContextPath(true)+"/authz/saml20/"+appId,SAMLConstants.SAML2_REDIRECT_BINDING_URI));
|
||||||
|
|
||||||
descriptor.getSingleSignOnServices().add(metadataGenerator.getSingleSignOnService(WebContext.getHttpContextPath()+"/authz/saml20/"+appId,SAMLConstants.SAML2_POST_SIMPLE_SIGN_BINDING_URI));
|
descriptor.getSingleSignOnServices().add(metadataGenerator.getSingleSignOnService(WebContext.getHttpContextPath(true)+"/authz/saml20/"+appId,SAMLConstants.SAML2_POST_SIMPLE_SIGN_BINDING_URI));
|
||||||
|
|
||||||
descriptor.getSingleLogoutServices().add(metadataGenerator.getSingleLogoutService(WebContext.getHttpContextPath()+"/logout",null));
|
descriptor.getSingleLogoutServices().add(metadataGenerator.getSingleLogoutService(WebContext.getHttpContextPath(true)+"/logout",null));
|
||||||
|
|
||||||
descriptor.getManageNameIDServices().add(metadataGenerator.getManageNameIDService(WebContext.getHttpContextPath()+"/saml/metadata/" + WebConstants.MXK_METADATA_PREFIX + appId + ".xml"));
|
descriptor.getManageNameIDServices().add(metadataGenerator.getManageNameIDService(WebContext.getHttpContextPath(true)+"/saml/metadata/" + WebConstants.MXK_METADATA_PREFIX + appId + ".xml"));
|
||||||
|
|
||||||
descriptor.getKeyDescriptors().add(metadataGenerator.generateEncryptionKeyDescriptor(signingCredential));
|
descriptor.getKeyDescriptors().add(metadataGenerator.generateEncryptionKeyDescriptor(signingCredential));
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@
|
|||||||
<nz-form-label [nzSm]="8" [nzXs]="24" nzFor="uploadFile">{{ 'mxk.users.picture' | i18n }}
|
<nz-form-label [nzSm]="8" [nzXs]="24" nzFor="uploadFile">{{ 'mxk.users.picture' | i18n }}
|
||||||
</nz-form-label>
|
</nz-form-label>
|
||||||
<div nz-col class="clearfix" nzSm="16" nzXs="24">
|
<div nz-col class="clearfix" nzSm="16" nzXs="24">
|
||||||
<nz-upload nzAction="file/upload/" nzListType="picture-card" [(nzFileList)]="fileList"
|
<nz-upload nzAction="/file/upload/" nzListType="picture-card" [(nzFileList)]="fileList"
|
||||||
nzName="uploadFile" [nzShowButton]="fileList.length < 1" [nzPreview]="handlePreview"
|
nzName="uploadFile" [nzShowButton]="fileList.length < 1" [nzPreview]="handlePreview"
|
||||||
(nzChange)="uploadImageChange($event)">
|
(nzChange)="uploadImageChange($event)">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@ -262,7 +262,7 @@
|
|||||||
"filters": "Filters",
|
"filters": "Filters",
|
||||||
"basedn": "Base DN",
|
"basedn": "Base DN",
|
||||||
"msadDomain": "Active Directory Domain",
|
"msadDomain": "Active Directory Domain",
|
||||||
"accountMapping": "Account Mapping",
|
"accountMapping": "Domain Account",
|
||||||
"trustStore": "TrustStore",
|
"trustStore": "TrustStore",
|
||||||
"trustStorePassword": "TrustStore Password"
|
"trustStorePassword": "TrustStore Password"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -249,7 +249,7 @@
|
|||||||
"filters": "过滤器",
|
"filters": "过滤器",
|
||||||
"basedn": "基本DN",
|
"basedn": "基本DN",
|
||||||
"msadDomain": "Active Directory域",
|
"msadDomain": "Active Directory域",
|
||||||
"accountMapping": "账号映射",
|
"accountMapping": "域账号认证",
|
||||||
"trustStore": "证书",
|
"trustStore": "证书",
|
||||||
"trustStorePassword": "证书密钥"
|
"trustStorePassword": "证书密钥"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -249,7 +249,7 @@
|
|||||||
"filters": "過濾器",
|
"filters": "過濾器",
|
||||||
"basedn": "基本DN",
|
"basedn": "基本DN",
|
||||||
"msadDomain": "Active Directory域",
|
"msadDomain": "Active Directory域",
|
||||||
"accountMapping": "賬號映射",
|
"accountMapping": "域賬號認證",
|
||||||
"trustStore": "證書",
|
"trustStore": "證書",
|
||||||
"trustStorePassword": "證書密鑰"
|
"trustStorePassword": "證書密鑰"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export const environment = {
|
|||||||
production: true,
|
production: true,
|
||||||
useHash: true,
|
useHash: true,
|
||||||
api: {
|
api: {
|
||||||
baseUrl: '/sign',
|
baseUrl: '/sign/',
|
||||||
refreshTokenEnabled: true,
|
refreshTokenEnabled: true,
|
||||||
refreshTokenType: 're-request'
|
refreshTokenType: 're-request'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,28 +130,28 @@
|
|||||||
<script src="http://wwcdn.weixin.qq.com/node/wework/wwopen/js/wwLogin-1.2.7.js"></script>
|
<script src="http://wwcdn.weixin.qq.com/node/wework/wwopen/js/wwLogin-1.2.7.js"></script>
|
||||||
-->
|
-->
|
||||||
<!--钉钉-->
|
<!--钉钉-->
|
||||||
<!--
|
<!---->
|
||||||
<script src="http://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
|
<script src="http://g.alicdn.com/dingding/dinglogin/0.0.5/ddLogin.js"></script>
|
||||||
<script >
|
<script>
|
||||||
var ddredirect_uri="";
|
var ddredirect_uri = "";
|
||||||
var handleMessage = function (event) {
|
var handleMessage = function (event) {
|
||||||
var origin = event.origin;
|
var origin = event.origin;
|
||||||
if( origin == "https://login.dingtalk.com" ) { //判断是否来自ddLogin扫码事件。
|
if (origin == "https://login.dingtalk.com") { //判断是否来自ddLogin扫码事件。
|
||||||
var loginTmpCode = event.data;
|
var loginTmpCode = event.data;
|
||||||
ddredirect_uri = ddredirect_uri+'&loginTmpCode='+loginTmpCode;
|
ddredirect_uri = ddredirect_uri + '&loginTmpCode=' + loginTmpCode;
|
||||||
//获取到loginTmpCode后就可以在这里构造跳转链接进行跳转了
|
//获取到loginTmpCode后就可以在这里构造跳转链接进行跳转了
|
||||||
window.top.location.href = ddredirect_uri;
|
window.top.location.href = ddredirect_uri;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (typeof window.addEventListener != 'undefined') {
|
if (typeof window.addEventListener != 'undefined') {
|
||||||
window.addEventListener('message', handleMessage, false);
|
window.addEventListener('message', handleMessage, false);
|
||||||
} else if (typeof window.attachEvent != 'undefined') {
|
} else if (typeof window.attachEvent != 'undefined') {
|
||||||
window.attachEvent('onmessage', handleMessage);
|
window.attachEvent('onmessage', handleMessage);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
-->
|
|
||||||
<!--飞书-->
|
<!--飞书-->
|
||||||
<!---->
|
<!--
|
||||||
<script src="http://sf3-cn.feishucdn.com/obj/static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.1.js"></script>
|
<script src="http://sf3-cn.feishucdn.com/obj/static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.1.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var fsredirectUri = "";
|
var fsredirectUri = "";
|
||||||
@ -173,5 +173,6 @@
|
|||||||
window.attachEvent('onmessage', handleMessage);
|
window.attachEvent('onmessage', handleMessage);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
-->
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@ -5,7 +5,7 @@
|
|||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||||
<div nz-col nzMd="16" nzSm="24">
|
<div nz-col nzMd="16" nzSm="24">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzFor="name">{{ 'mxk.groups.name' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<input nz-input [(ngModel)]="query.params.name" [ngModelOptions]="{ standalone: true }" name="name"
|
<input nz-input [(ngModel)]="query.params.name" [ngModelOptions]="{ standalone: true }" name="name"
|
||||||
placeholder="" id="name" />
|
placeholder="" id="name" />
|
||||||
@ -40,8 +40,8 @@
|
|||||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||||
<th nzAlign="center" style="display: none">Id</th>
|
<th nzAlign="center" style="display: none">Id</th>
|
||||||
<th nzAlign="center">{{ 'mxk.groups.name' | i18n }}</th>
|
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||||
<th nzAlign="center">{{ 'mxk.groups.dynamic' | i18n }}</th>
|
<th nzAlign="center">{{ 'mxk.roles.dynamic' | i18n }}</th>
|
||||||
<th nzAlign="center">{{ 'mxk.text.description' | i18n }}</th>
|
<th nzAlign="center">{{ 'mxk.text.description' | i18n }}</th>
|
||||||
<th nzAlign="center"><a>{{ 'mxk.text.action' | i18n }}</a></th>
|
<th nzAlign="center"><a>{{ 'mxk.text.action' | i18n }}</a></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||||
<div nz-col nzMd="14" nzSm="24">
|
<div nz-col nzMd="14" nzSm="24">
|
||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label nzFor="name">{{ 'mxk.groups.name' | i18n }}</nz-form-label>
|
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||||
<nz-form-control>
|
<nz-form-control>
|
||||||
<input nz-input [(ngModel)]="query.params.name" [ngModelOptions]="{ standalone: true }" name="name"
|
<input nz-input [(ngModel)]="query.params.name" [ngModelOptions]="{ standalone: true }" name="name"
|
||||||
placeholder="" id="name" />
|
placeholder="" id="name" />
|
||||||
@ -32,8 +32,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th nzAlign="center" style="display: none">Id</th>
|
<th nzAlign="center" style="display: none">Id</th>
|
||||||
<th nzAlign="center">{{ 'mxk.groups.name' | i18n }}</th>
|
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||||
<th nzAlign="center">{{ 'mxk.groups.dynamic' | i18n }}</th>
|
<th nzAlign="center">{{ 'mxk.roles.dynamic' | i18n }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@ -56,8 +56,9 @@
|
|||||||
<nz-form-item>
|
<nz-form-item>
|
||||||
<nz-form-label [nzSm]="8" [nzXs]="24" nzFor="uploadFile">{{ 'mxk.users.picture' | i18n }}</nz-form-label>
|
<nz-form-label [nzSm]="8" [nzXs]="24" nzFor="uploadFile">{{ 'mxk.users.picture' | i18n }}</nz-form-label>
|
||||||
<div nz-col class="clearfix" nzSm="16" nzXs="24">
|
<div nz-col class="clearfix" nzSm="16" nzXs="24">
|
||||||
<nz-upload nzAction="file/upload/" nzListType="picture-card" [(nzFileList)]="fileList" nzName="uploadFile"
|
<nz-upload nzAction="/file/upload/" nzListType="picture-card" [(nzFileList)]="fileList"
|
||||||
[nzShowButton]="fileList.length < 1" [nzPreview]="handlePreview" (nzChange)="uploadImageChange($event)">
|
nzName="uploadFile" [nzShowButton]="fileList.length < 1" [nzPreview]="handlePreview"
|
||||||
|
(nzChange)="uploadImageChange($event)">
|
||||||
<div>
|
<div>
|
||||||
<i nz-icon nzType="plus"></i>
|
<i nz-icon nzType="plus"></i>
|
||||||
<div style="margin-top: 8px">Upload</div>
|
<div style="margin-top: 8px">Upload</div>
|
||||||
|
|||||||
@ -251,30 +251,10 @@
|
|||||||
"filters": "Filters",
|
"filters": "Filters",
|
||||||
"basedn": "Base DN",
|
"basedn": "Base DN",
|
||||||
"msadDomain": "MSAD Domain",
|
"msadDomain": "MSAD Domain",
|
||||||
"accountMapping": "Account Mapping",
|
"accountMapping": "Domain Account",
|
||||||
"trustStore": "TrustStore",
|
"trustStore": "TrustStore",
|
||||||
"trustStorePassword": "TrustStore Password"
|
"trustStorePassword": "TrustStore Password"
|
||||||
},
|
},
|
||||||
"groups": {
|
|
||||||
"name": "Group Name",
|
|
||||||
"dynamic": "Dynamic",
|
|
||||||
"filters": "Attributes Filter",
|
|
||||||
"orgIdsList": "Dept List",
|
|
||||||
"resumeTime": "Join Time",
|
|
||||||
"suspendTime": "Suspend Time",
|
|
||||||
"isdefault": "Is Default"
|
|
||||||
},
|
|
||||||
"accountsstrategy": {
|
|
||||||
"name": "Strategy Name",
|
|
||||||
"appIcon": "App Icon",
|
|
||||||
"appId": "App Id",
|
|
||||||
"appName": "App Name",
|
|
||||||
"filters": "Attributes Filter",
|
|
||||||
"orgIdsList": "Dept List",
|
|
||||||
"createType": "createType",
|
|
||||||
"mapping": "Mapping",
|
|
||||||
"suffixes": "Suffixes"
|
|
||||||
},
|
|
||||||
"apps": {
|
"apps": {
|
||||||
"tab.basic": "Basic",
|
"tab.basic": "Basic",
|
||||||
"tab.extra": "Extra",
|
"tab.extra": "Extra",
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
"audit": {
|
"audit": {
|
||||||
"": "日志审计",
|
"": "日志审计",
|
||||||
"logins": "系统登录日志",
|
"logins": "系统登录日志",
|
||||||
"loginapps": "应用登录日志",
|
"loginapps": "应用访问日志",
|
||||||
"synchronizer": "同步器日志",
|
"synchronizer": "同步器日志",
|
||||||
"connector": "连接器日志",
|
"connector": "连接器日志",
|
||||||
"operate": "系统管理日志"
|
"operate": "系统管理日志"
|
||||||
@ -252,31 +252,10 @@
|
|||||||
"filters": "过滤器",
|
"filters": "过滤器",
|
||||||
"basedn": "基本DN",
|
"basedn": "基本DN",
|
||||||
"msadDomain": "AD域名",
|
"msadDomain": "AD域名",
|
||||||
"accountMapping": "账号映射",
|
"accountMapping": "域账号认证",
|
||||||
"trustStore": "证书",
|
"trustStore": "证书",
|
||||||
"trustStorePassword": "证书密钥"
|
"trustStorePassword": "证书密钥"
|
||||||
},
|
},
|
||||||
"groups": {
|
|
||||||
"name": "组名称",
|
|
||||||
"dynamic": "动态组",
|
|
||||||
"filters": "属性过滤器",
|
|
||||||
"orgIdsList": "部门列表",
|
|
||||||
"resumeTime": "加入时间",
|
|
||||||
"suspendTime": "挂起时间",
|
|
||||||
"isdefault": "是否默认组"
|
|
||||||
},
|
|
||||||
"accountsstrategy": {
|
|
||||||
"id": "策略编码",
|
|
||||||
"name": "策略名称",
|
|
||||||
"appIcon": "应用图标",
|
|
||||||
"appId": "应用编码",
|
|
||||||
"appName": "应用名称",
|
|
||||||
"filters": "属性过滤器",
|
|
||||||
"orgIdsList": "部门列表",
|
|
||||||
"createType": "创建方式",
|
|
||||||
"mapping": "账号映射",
|
|
||||||
"suffixes": "后缀"
|
|
||||||
},
|
|
||||||
"apps": {
|
"apps": {
|
||||||
"tab.basic": "基本信息",
|
"tab.basic": "基本信息",
|
||||||
"tab.extra": "扩展信息",
|
"tab.extra": "扩展信息",
|
||||||
@ -510,7 +489,7 @@
|
|||||||
"email": "邮箱",
|
"email": "邮箱",
|
||||||
"address": "地址",
|
"address": "地址",
|
||||||
"logo": "LOGO",
|
"logo": "LOGO",
|
||||||
"domain": "域名",
|
"domain": "认证域名",
|
||||||
"frontTitle": "系統名称",
|
"frontTitle": "系統名称",
|
||||||
"consoleDomain": "控制台域名",
|
"consoleDomain": "控制台域名",
|
||||||
"consoleTitle": "控制台名称",
|
"consoleTitle": "控制台名称",
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
"audit": {
|
"audit": {
|
||||||
"": "日誌審計",
|
"": "日誌審計",
|
||||||
"logins": "系統登錄日誌",
|
"logins": "系統登錄日誌",
|
||||||
"loginapps": "應用登錄日誌",
|
"loginapps": "應用訪問日誌",
|
||||||
"synchronizer": "同步器日誌",
|
"synchronizer": "同步器日誌",
|
||||||
"connector": "連接器日誌",
|
"connector": "連接器日誌",
|
||||||
"operate": "系統管理日誌"
|
"operate": "系統管理日誌"
|
||||||
@ -253,31 +253,10 @@
|
|||||||
"filters": "過濾器",
|
"filters": "過濾器",
|
||||||
"basedn": "基本DN",
|
"basedn": "基本DN",
|
||||||
"msadDomain": "AD域名",
|
"msadDomain": "AD域名",
|
||||||
"accountMapping": "賬號映射",
|
"accountMapping": "域賬號認證",
|
||||||
"trustStore": "證書",
|
"trustStore": "證書",
|
||||||
"trustStorePassword": "證書密鑰"
|
"trustStorePassword": "證書密鑰"
|
||||||
},
|
},
|
||||||
"groups": {
|
|
||||||
"name": "組名稱",
|
|
||||||
"dynamic": "動態組",
|
|
||||||
"filters": "屬性過濾器",
|
|
||||||
"orgIdsList": "部門列表",
|
|
||||||
"resumeTime": "加入時間",
|
|
||||||
"suspendTime": "掛起時間",
|
|
||||||
"isdefault": "是否默認組"
|
|
||||||
},
|
|
||||||
"accountsstrategy": {
|
|
||||||
"id": "策略編碼",
|
|
||||||
"name": "策略名稱",
|
|
||||||
"appIcon": "應用圖標",
|
|
||||||
"appId": "應用編碼",
|
|
||||||
"appName": "應用名稱",
|
|
||||||
"filters": "屬性過濾器",
|
|
||||||
"orgIdsList": "部門列表",
|
|
||||||
"createType": "創建方式",
|
|
||||||
"mapping": "賬號映射",
|
|
||||||
"suffixes": "後綴"
|
|
||||||
},
|
|
||||||
"apps": {
|
"apps": {
|
||||||
"tab.basic": "基本信息",
|
"tab.basic": "基本信息",
|
||||||
"tab.extra": "擴展信息",
|
"tab.extra": "擴展信息",
|
||||||
@ -511,7 +490,7 @@
|
|||||||
"email": "郵箱",
|
"email": "郵箱",
|
||||||
"address": "地址",
|
"address": "地址",
|
||||||
"logo": "LOGO",
|
"logo": "LOGO",
|
||||||
"domain": "域名",
|
"domain": "認證域名",
|
||||||
"frontTitle": "系統名稱",
|
"frontTitle": "系統名稱",
|
||||||
"consoleDomain": "控制台域名",
|
"consoleDomain": "控制台域名",
|
||||||
"consoleTitle": "控制台名稱",
|
"consoleTitle": "控制台名稱",
|
||||||
|
|||||||
@ -20,7 +20,9 @@ package org.maxkey.web.contorller;
|
|||||||
import org.maxkey.authn.annotation.CurrentUser;
|
import org.maxkey.authn.annotation.CurrentUser;
|
||||||
import org.maxkey.entity.Message;
|
import org.maxkey.entity.Message;
|
||||||
import org.maxkey.entity.UserInfo;
|
import org.maxkey.entity.UserInfo;
|
||||||
|
import org.maxkey.persistence.service.FileUploadService;
|
||||||
import org.maxkey.persistence.service.UserInfoService;
|
import org.maxkey.persistence.service.UserInfoService;
|
||||||
|
import org.maxkey.util.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -39,6 +41,9 @@ public class ProfileController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserInfoService userInfoService;
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
FileUploadService fileUploadService;
|
||||||
|
|
||||||
@RequestMapping(value = { "/get" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
@RequestMapping(value = { "/get" }, produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||||
public ResponseEntity<?> get(@CurrentUser UserInfo currentUser) {
|
public ResponseEntity<?> get(@CurrentUser UserInfo currentUser) {
|
||||||
@ -72,7 +77,11 @@ public class ProfileController {
|
|||||||
// String extraAttribute=JsonUtils.object2Json(extraAttributeMap);
|
// String extraAttribute=JsonUtils.object2Json(extraAttributeMap);
|
||||||
// userInfo.setExtraAttribute(extraAttribute);
|
// userInfo.setExtraAttribute(extraAttribute);
|
||||||
// }
|
// }
|
||||||
|
if(StringUtils.isNotBlank(userInfo.getPictureId())) {
|
||||||
|
userInfo.setPicture(fileUploadService.get(userInfo.getPictureId()).getUploaded());
|
||||||
|
fileUploadService.remove(userInfo.getPictureId());
|
||||||
|
}
|
||||||
|
|
||||||
if (userInfoService.updateProfile(userInfo) > 0) {
|
if (userInfoService.updateProfile(userInfo) > 0) {
|
||||||
return new Message<UserInfo>(Message.SUCCESS).buildResponse();
|
return new Message<UserInfo>(Message.SUCCESS).buildResponse();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user