v1.3.1 FIX
1、验证增强,增加算术验证码支持 2、修复新增用户时报错 3、修复操作日志报错 4、mybatis-jpa-extra升级到v2.0
This commit is contained in:
@@ -9,16 +9,26 @@ import org.springframework.context.annotation.PropertySource;
|
||||
public class LoginConfig {
|
||||
@Value("${config.login.captcha}")
|
||||
boolean captcha;
|
||||
|
||||
//验证码类型 text 文本 , arithmetic算术验证码
|
||||
@Value("${config.login.captcha.type}")
|
||||
String captchaType;
|
||||
|
||||
@Value("${config.login.onetimepwd}")
|
||||
boolean oneTimePwd;
|
||||
|
||||
@Value("${config.login.socialsignon}")
|
||||
boolean socialSignOn;
|
||||
|
||||
@Value("${config.login.kerberos}")
|
||||
boolean kerberos;
|
||||
|
||||
@Value("${config.login.remeberme}")
|
||||
boolean remeberMe;
|
||||
|
||||
@Value("${config.login.wsfederation}")
|
||||
boolean wsFederation;
|
||||
|
||||
@Value("${config.login.default.uri}")
|
||||
String defaultUri;
|
||||
|
||||
@@ -85,6 +95,14 @@ public class LoginConfig {
|
||||
this.wsFederation = wsFederation;
|
||||
}
|
||||
|
||||
public String getCaptchaType() {
|
||||
return captchaType;
|
||||
}
|
||||
|
||||
public void setCaptchaType(String captchaType) {
|
||||
this.captchaType = captchaType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
@@ -1,184 +1,195 @@
|
||||
package org.maxkey.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
|
||||
|
||||
|
||||
/**
|
||||
* .
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Table(name = "HISTORY_LOGS")
|
||||
public class HistoryLogs extends JpaBaseDomain implements Serializable {
|
||||
private static final long serialVersionUID = 6560201093784960493L;
|
||||
@Id
|
||||
@Column
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid")
|
||||
String id;
|
||||
@Column
|
||||
String serviceName;
|
||||
@Column
|
||||
String message;
|
||||
@Column
|
||||
String content;
|
||||
@Column
|
||||
String messageType;
|
||||
@Column
|
||||
String operateType;
|
||||
@Column
|
||||
String username;
|
||||
@Column
|
||||
String code;
|
||||
@Column
|
||||
String createdBy;
|
||||
@Column
|
||||
String createdDate;
|
||||
@Column
|
||||
String modifiedBy;
|
||||
@Column
|
||||
String modifiedDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6560201093784960493L;
|
||||
String id;
|
||||
String serviceName;
|
||||
String message;
|
||||
String content;
|
||||
String messageType;
|
||||
String operateType;
|
||||
String username;
|
||||
String code;
|
||||
String createdBy;
|
||||
String createdDate;
|
||||
String modifiedBy;
|
||||
String modifiedDate;
|
||||
String startDate;
|
||||
String endDate;
|
||||
|
||||
String startDate;
|
||||
String endDate;
|
||||
public HistoryLogs() {
|
||||
super();
|
||||
}
|
||||
|
||||
public HistoryLogs() {
|
||||
super();
|
||||
}
|
||||
/**
|
||||
* HistoryLogs.
|
||||
* @param serviceName String
|
||||
* @param code String
|
||||
* @param message String
|
||||
* @param content String
|
||||
* @param messageType String
|
||||
* @param operateType String
|
||||
* @param createdBy String
|
||||
* @param username String
|
||||
* @param cname String
|
||||
*/
|
||||
public HistoryLogs(String serviceName, String code,
|
||||
String message, String content,
|
||||
String messageType,String operateType,
|
||||
String createdBy, String username, String cname) {
|
||||
super();
|
||||
this.serviceName = serviceName;
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.content = content;
|
||||
this.messageType = messageType;
|
||||
this.operateType = operateType;
|
||||
this.createdBy = createdBy;
|
||||
this.username = username;
|
||||
|
||||
public HistoryLogs(String serviceName, String code, String message,
|
||||
String content, String messageType, String operateType,
|
||||
String createdBy, String username, String cname) {
|
||||
super();
|
||||
this.serviceName = serviceName;
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.content = content;
|
||||
this.messageType = messageType;
|
||||
this.operateType = operateType;
|
||||
this.createdBy = createdBy;
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
}
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
public String getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
public String getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
public void setMessageType(String messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public void setMessageType(String messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
public String getOperateType() {
|
||||
return operateType;
|
||||
}
|
||||
|
||||
public String getOperateType() {
|
||||
return operateType;
|
||||
}
|
||||
public void setOperateType(String operateType) {
|
||||
this.operateType = operateType;
|
||||
}
|
||||
|
||||
public void setOperateType(String operateType) {
|
||||
this.operateType = operateType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the username
|
||||
*/
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param username
|
||||
* the username to set
|
||||
*/
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code
|
||||
* the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public String getModifiedBy() {
|
||||
return modifiedBy;
|
||||
}
|
||||
|
||||
public void setModifiedBy(String modifiedBy) {
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
|
||||
public void setModifiedDate(String modifiedDate) {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public String getModifiedBy() {
|
||||
return modifiedBy;
|
||||
}
|
||||
|
||||
public void setModifiedBy(String modifiedBy) {
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
|
||||
public void setModifiedDate(String modifiedDate) {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,114 +6,113 @@ import java.sql.SQLException;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
|
||||
public class UserInfoRowMapper implements RowMapper<UserInfo> {
|
||||
public class UserInfoRowMapper implements RowMapper<UserInfo> {
|
||||
|
||||
@Override
|
||||
public UserInfo mapRow(ResultSet rs, int rowNum)throws SQLException {
|
||||
@Override
|
||||
public UserInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
|
||||
UserInfo userInfo=new UserInfo();
|
||||
userInfo.setId(rs.getString("ID"));
|
||||
userInfo.setUsername(rs.getString("USERNAME"));
|
||||
userInfo.setPassword(rs.getString("PASSWORD"));
|
||||
userInfo.setSharedSecret(rs.getString("SHAREDSECRET"));
|
||||
userInfo.setSharedCounter(rs.getString("SHAREDCOUNTER"));
|
||||
userInfo.setDecipherable(rs.getString("DECIPHERABLE"));
|
||||
userInfo.setWindowsAccount(rs.getString("WINDOWSACCOUNT"));
|
||||
userInfo.setUserType(rs.getString("USERTYPE"));
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setId(rs.getString("ID"));
|
||||
userInfo.setUsername(rs.getString("USERNAME"));
|
||||
userInfo.setPassword(rs.getString("PASSWORD"));
|
||||
userInfo.setSharedSecret(rs.getString("SHAREDSECRET"));
|
||||
userInfo.setSharedCounter(rs.getString("SHAREDCOUNTER"));
|
||||
userInfo.setDecipherable(rs.getString("DECIPHERABLE"));
|
||||
userInfo.setWindowsAccount(rs.getString("WINDOWSACCOUNT"));
|
||||
userInfo.setUserType(rs.getString("USERTYPE"));
|
||||
|
||||
userInfo.setDisplayName(rs.getString("DISPLAYNAME"));
|
||||
userInfo.setNickName(rs.getString("NICKNAME"));
|
||||
userInfo.setNameZHSpell(rs.getString("NAMEZHSPELL"));//nameZHSpell
|
||||
userInfo.setNameZHShortSpell(rs.getString("NAMEZHSHORTSPELL"));//nameZHSpell
|
||||
userInfo.setGivenName(rs.getString("GIVENNAME"));
|
||||
userInfo.setMiddleName(rs.getString("MIDDLENAME"));
|
||||
userInfo.setFamilyName(rs.getString("FAMILYNAME"));
|
||||
userInfo.setHonorificPrefix(rs.getString("HONORIFICPREFIX"));
|
||||
userInfo.setHonorificSuffix(rs.getString("HONORIFICSUFFIX"));
|
||||
userInfo.setFormattedName(rs.getString("FORMATTEDNAME"));
|
||||
userInfo.setDisplayName(rs.getString("DISPLAYNAME"));
|
||||
userInfo.setNickName(rs.getString("NICKNAME"));
|
||||
userInfo.setNameZhSpell(rs.getString("NAMEZHSPELL"));// nameZHSpell
|
||||
userInfo.setNameZhShortSpell(rs.getString("NAMEZHSHORTSPELL"));// nameZHSpell
|
||||
userInfo.setGivenName(rs.getString("GIVENNAME"));
|
||||
userInfo.setMiddleName(rs.getString("MIDDLENAME"));
|
||||
userInfo.setFamilyName(rs.getString("FAMILYNAME"));
|
||||
userInfo.setHonorificPrefix(rs.getString("HONORIFICPREFIX"));
|
||||
userInfo.setHonorificSuffix(rs.getString("HONORIFICSUFFIX"));
|
||||
userInfo.setFormattedName(rs.getString("FORMATTEDNAME"));
|
||||
|
||||
userInfo.setGender(rs.getInt("GENDER"));
|
||||
userInfo.setBirthDate(rs.getString("BIRTHDATE"));
|
||||
userInfo.setPicture(rs.getBytes("PICTURE"));
|
||||
userInfo.setMarried(rs.getInt("MARRIED"));
|
||||
userInfo.setIdType(rs.getInt("IDTYPE"));
|
||||
userInfo.setIdCardNo(rs.getString("IDCARDNO"));
|
||||
userInfo.setWebSite(rs.getString("WEBSITE"));
|
||||
userInfo.setGender(rs.getInt("GENDER"));
|
||||
userInfo.setBirthDate(rs.getString("BIRTHDATE"));
|
||||
userInfo.setPicture(rs.getBytes("PICTURE"));
|
||||
userInfo.setMarried(rs.getInt("MARRIED"));
|
||||
userInfo.setIdType(rs.getInt("IDTYPE"));
|
||||
userInfo.setIdCardNo(rs.getString("IDCARDNO"));
|
||||
userInfo.setWebSite(rs.getString("WEBSITE"));
|
||||
|
||||
userInfo.setAuthnType(rs.getInt("AUTHNTYPE"));
|
||||
userInfo.setMobile(rs.getString("MOBILE"));
|
||||
userInfo.setMobileVerified(rs.getInt("MOBILEVERIFIED"));
|
||||
userInfo.setEmail(rs.getString("EMAIL"));
|
||||
userInfo.setEmailVerified(rs.getInt("EMAILVERIFIED"));
|
||||
userInfo.setPasswordQuestion(rs.getString("PASSWORDQUESTION"));
|
||||
userInfo.setPasswordAnswer(rs.getString("PASSWORDANSWER"));
|
||||
userInfo.setAuthnType(rs.getInt("AUTHNTYPE"));
|
||||
userInfo.setMobile(rs.getString("MOBILE"));
|
||||
userInfo.setMobileVerified(rs.getInt("MOBILEVERIFIED"));
|
||||
userInfo.setEmail(rs.getString("EMAIL"));
|
||||
userInfo.setEmailVerified(rs.getInt("EMAILVERIFIED"));
|
||||
userInfo.setPasswordQuestion(rs.getString("PASSWORDQUESTION"));
|
||||
userInfo.setPasswordAnswer(rs.getString("PASSWORDANSWER"));
|
||||
|
||||
userInfo.setAppLoginAuthnType(rs.getInt("APPLOGINAUTHNTYPE"));
|
||||
userInfo.setAppLoginPassword(rs.getString("APPLOGINPASSWORD"));
|
||||
userInfo.setProtectedApps(rs.getString("PROTECTEDAPPS"));
|
||||
userInfo.setAppLoginAuthnType(rs.getInt("APPLOGINAUTHNTYPE"));
|
||||
userInfo.setAppLoginPassword(rs.getString("APPLOGINPASSWORD"));
|
||||
userInfo.setProtectedApps(rs.getString("PROTECTEDAPPS"));
|
||||
|
||||
userInfo.setPasswordLastSetTime(rs.getString("PASSWORDLASTSETTIME"));
|
||||
userInfo.setPasswordSetType(rs.getInt("PASSWORDSETTYPE"));
|
||||
userInfo.setBadPasswordCount(rs.getInt("BADPASSWORDCOUNT"));
|
||||
userInfo.setUnLockTime(rs.getString("UNLOCKTIME"));
|
||||
userInfo.setIsLocked(rs.getInt("ISLOCKED"));
|
||||
userInfo.setLastLoginTime(rs.getString("LASTLOGINTIME"));
|
||||
userInfo.setLastLoginIp(rs.getString("LASTLOGINIP"));
|
||||
userInfo.setLastLogoffTime(rs.getString("LASTLOGOFFTIME"));
|
||||
userInfo.setLoginCount(rs.getInt("LOGINCOUNT"));
|
||||
userInfo.setPasswordLastSetTime(rs.getString("PASSWORDLASTSETTIME"));
|
||||
userInfo.setPasswordSetType(rs.getInt("PASSWORDSETTYPE"));
|
||||
userInfo.setBadPasswordCount(rs.getInt("BADPASSWORDCOUNT"));
|
||||
userInfo.setUnLockTime(rs.getString("UNLOCKTIME"));
|
||||
userInfo.setIsLocked(rs.getInt("ISLOCKED"));
|
||||
userInfo.setLastLoginTime(rs.getString("LASTLOGINTIME"));
|
||||
userInfo.setLastLoginIp(rs.getString("LASTLOGINIP"));
|
||||
userInfo.setLastLogoffTime(rs.getString("LASTLOGOFFTIME"));
|
||||
userInfo.setLoginCount(rs.getInt("LOGINCOUNT"));
|
||||
|
||||
userInfo.setTimeZone(rs.getString("TIMEZONE"));
|
||||
userInfo.setLocale(rs.getString("LOCALE"));
|
||||
userInfo.setPreferredLanguage(rs.getString("PREFERREDLANGUAGE"));
|
||||
userInfo.setTimeZone(rs.getString("TIMEZONE"));
|
||||
userInfo.setLocale(rs.getString("LOCALE"));
|
||||
userInfo.setPreferredLanguage(rs.getString("PREFERREDLANGUAGE"));
|
||||
|
||||
userInfo.setWorkEmail(rs.getString("WORKEMAIL"));
|
||||
userInfo.setWorkPhoneNumber(rs.getString("WORKPHONENUMBER"));
|
||||
userInfo.setWorkCountry(rs.getString("WORKCOUNTRY"));
|
||||
userInfo.setWorkRegion(rs.getString("WORKREGION"));
|
||||
userInfo.setWorkLocality(rs.getString("WORKLOCALITY"));
|
||||
userInfo.setWorkStreetAddress(rs.getString("WORKSTREETADDRESS"));
|
||||
userInfo.setWorkAddressFormatted(rs.getString("WORKADDRESSFORMATTED"));
|
||||
userInfo.setWorkPostalCode(rs.getString("WORKPOSTALCODE"));
|
||||
userInfo.setWorkFax(rs.getString("WORKFAX"));
|
||||
|
||||
userInfo.setWorkEmail(rs.getString("WORKEMAIL"));
|
||||
userInfo.setWorkPhoneNumber(rs.getString("WORKPHONENUMBER"));
|
||||
userInfo.setWorkCountry(rs.getString("WORKCOUNTRY"));
|
||||
userInfo.setWorkRegion(rs.getString("WORKREGION"));
|
||||
userInfo.setWorkLocality(rs.getString("WORKLOCALITY"));
|
||||
userInfo.setWorkStreetAddress(rs.getString("WORKSTREETADDRESS"));
|
||||
userInfo.setWorkAddressFormatted(rs.getString("WORKADDRESSFORMATTED"));
|
||||
userInfo.setWorkPostalCode(rs.getString("WORKPOSTALCODE"));
|
||||
userInfo.setWorkFax(rs.getString("WORKFAX"));
|
||||
userInfo.setHomeEmail(rs.getString("HOMEEMAIL"));
|
||||
userInfo.setHomePhoneNumber(rs.getString("HOMEPHONENUMBER"));
|
||||
userInfo.setHomeCountry(rs.getString("HOMECOUNTRY"));
|
||||
userInfo.setHomeRegion(rs.getString("HOMEREGION"));
|
||||
userInfo.setHomeLocality(rs.getString("HOMELOCALITY"));
|
||||
userInfo.setHomeStreetAddress(rs.getString("HOMESTREETADDRESS"));
|
||||
userInfo.setHomeAddressFormatted(rs.getString("HOMEADDRESSFORMATTED"));
|
||||
userInfo.setHomePostalCode(rs.getString("HOMEPOSTALCODE"));
|
||||
userInfo.setHomeFax(rs.getString("HOMEFAX"));
|
||||
|
||||
userInfo.setHomeEmail(rs.getString("HOMEEMAIL"));
|
||||
userInfo.setHomePhoneNumber(rs.getString("HOMEPHONENUMBER"));
|
||||
userInfo.setHomeCountry(rs.getString("HOMECOUNTRY"));
|
||||
userInfo.setHomeRegion(rs.getString("HOMEREGION"));
|
||||
userInfo.setHomeLocality(rs.getString("HOMELOCALITY"));
|
||||
userInfo.setHomeStreetAddress(rs.getString("HOMESTREETADDRESS"));
|
||||
userInfo.setHomeAddressFormatted(rs.getString("HOMEADDRESSFORMATTED"));
|
||||
userInfo.setHomePostalCode(rs.getString("HOMEPOSTALCODE"));
|
||||
userInfo.setHomeFax(rs.getString("HOMEFAX"));
|
||||
userInfo.setEmployeeNumber(rs.getString("EMPLOYEENUMBER"));
|
||||
userInfo.setDivision(rs.getString("DIVISION"));
|
||||
userInfo.setCostCenter(rs.getString("COSTCENTER"));
|
||||
userInfo.setOrganization(rs.getString("ORGANIZATION"));
|
||||
userInfo.setDepartmentId(rs.getString("DEPARTMENTID"));
|
||||
userInfo.setDepartment(rs.getString("DEPARTMENT"));
|
||||
userInfo.setJobTitle(rs.getString("JOBTITLE"));
|
||||
userInfo.setJobLevel(rs.getString("JOBLEVEL"));
|
||||
userInfo.setManagerId(rs.getString("MANAGERID"));
|
||||
userInfo.setManager(rs.getString("MANAGER"));
|
||||
userInfo.setAssistantId(rs.getString("ASSISTANTID"));
|
||||
userInfo.setAssistant(rs.getString("ASSISTANT"));
|
||||
userInfo.setEntryDate(rs.getString("ENTRYDATE"));//
|
||||
userInfo.setQuitDate(rs.getString("QUITDATE"));
|
||||
userInfo.setStartWorkDate(rs.getString("STARTWORKDATE"));// STARTWORKDATE
|
||||
|
||||
userInfo.setEmployeeNumber(rs.getString("EMPLOYEENUMBER"));
|
||||
userInfo.setDivision(rs.getString("DIVISION"));
|
||||
userInfo.setCostCenter(rs.getString("COSTCENTER"));
|
||||
userInfo.setOrganization(rs.getString("ORGANIZATION"));
|
||||
userInfo.setDepartmentId(rs.getString("DEPARTMENTID"));
|
||||
userInfo.setDepartment(rs.getString("DEPARTMENT"));
|
||||
userInfo.setJobTitle(rs.getString("JOBTITLE"));
|
||||
userInfo.setJobLevel(rs.getString("JOBLEVEL"));
|
||||
userInfo.setManagerId(rs.getString("MANAGERID"));
|
||||
userInfo.setManager(rs.getString("MANAGER"));
|
||||
userInfo.setAssistantId(rs.getString("ASSISTANTID"));
|
||||
userInfo.setAssistant(rs.getString("ASSISTANT"));
|
||||
userInfo.setEntryDate(rs.getString("ENTRYDATE"));//
|
||||
userInfo.setQuitDate(rs.getString("QUITDATE"));
|
||||
userInfo.setStartWorkDate(rs.getString("STARTWORKDATE"));//STARTWORKDATE
|
||||
userInfo.setExtraAttribute(rs.getString("EXTRAATTRIBUTE"));
|
||||
|
||||
userInfo.setExtraAttribute(rs.getString("EXTRAATTRIBUTE"));
|
||||
userInfo.setCreatedBy(rs.getString("CREATEDBY"));
|
||||
userInfo.setCreatedDate(rs.getString("CREATEDDATE"));
|
||||
userInfo.setModifiedBy(rs.getString("MODIFIEDBY"));
|
||||
userInfo.setModifiedDate(rs.getString("MODIFIEDDATE"));
|
||||
|
||||
userInfo.setCreatedBy(rs.getString("CREATEDBY"));
|
||||
userInfo.setCreatedDate(rs.getString("CREATEDDATE"));
|
||||
userInfo.setModifiedBy(rs.getString("MODIFIEDBY"));
|
||||
userInfo.setModifiedDate(rs.getString("MODIFIEDDATE"));
|
||||
userInfo.setStatus(rs.getInt("STATUS"));
|
||||
userInfo.setGridList(rs.getInt("GRIDLIST"));
|
||||
userInfo.setDescription(rs.getString("DESCRIPTION"));
|
||||
|
||||
userInfo.setStatus(rs.getInt("STATUS"));
|
||||
userInfo.setGridList(rs.getInt("GRIDLIST"));
|
||||
userInfo.setDescription(rs.getString("DESCRIPTION"));
|
||||
|
||||
return userInfo;
|
||||
}
|
||||
return userInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,174 @@
|
||||
package org.maxkey.web;
|
||||
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.maxkey.web.WebConstants;
|
||||
import org.maxkey.config.ApplicationConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.google.code.kaptcha.Producer;
|
||||
|
||||
/**
|
||||
* ImageEndpoint Producer Image and captcha.
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class ImageEndpoint {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(ImageEndpoint.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(ImageEndpoint.class);
|
||||
|
||||
@Autowired
|
||||
private Producer captchaProducer;
|
||||
@Autowired
|
||||
private Producer captchaProducer;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("applicationConfig")
|
||||
ApplicationConfig applicationConfig;
|
||||
|
||||
/**
|
||||
* captcha image Producer.
|
||||
*
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
*/
|
||||
@RequestMapping(value = "/captcha")
|
||||
public void captchaHandleRequest(HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
|
||||
String kaptchaText = captchaProducer.createText();
|
||||
if (applicationConfig.getLoginConfig().getCaptchaType()
|
||||
.equalsIgnoreCase("Arithmetic")) {
|
||||
Integer intParamA = Integer.valueOf(kaptchaText.substring(0, 1));
|
||||
Integer intParamB = Integer.valueOf(kaptchaText.substring(1, 2));
|
||||
Integer calculateValue = 0;
|
||||
if ((intParamA > intParamB) && ((intParamA + intParamB) % 5 > 3)) {
|
||||
calculateValue = intParamA - intParamB;
|
||||
kaptchaText = intParamA + "-" + intParamB + "=?";
|
||||
} else {
|
||||
calculateValue = intParamA + intParamB;
|
||||
kaptchaText = intParamA + "+" + intParamB + "=?";
|
||||
}
|
||||
_logger.trace("Sesssion id " + request.getSession().getId()
|
||||
+ " , Arithmetic calculate Value is " + calculateValue);
|
||||
request.getSession().setAttribute(
|
||||
WebConstants.KAPTCHA_SESSION_KEY, calculateValue + "");
|
||||
} else {
|
||||
// store the text in the session
|
||||
request.getSession().setAttribute(WebConstants.KAPTCHA_SESSION_KEY, kaptchaText);
|
||||
}
|
||||
_logger.trace("Sesssion id " + request.getSession().getId()
|
||||
+ " , Captcha Text is " + kaptchaText);
|
||||
|
||||
/**
|
||||
* captcha image Producer
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@RequestMapping(value = "/captcha")
|
||||
public void captchaHandleRequest(HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
// Set to expire far in the past.
|
||||
response.setDateHeader("Expires", 0);
|
||||
// Set standard HTTP/1.1 no-cache headers.
|
||||
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
|
||||
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
|
||||
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
|
||||
// Set standard HTTP/1.0 no-cache header.
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
// return a jpeg
|
||||
response.setContentType("image/jpeg");
|
||||
// create the text for the image
|
||||
String capText = captchaProducer.createText();
|
||||
_logger.trace("Sesssion id " + request.getSession().getId() + " , Captcha Text is " + capText);
|
||||
// store the text in the session
|
||||
request.getSession().setAttribute(WebConstants.KAPTCHA_SESSION_KEY, capText);
|
||||
// create the image with the text
|
||||
BufferedImage bi = captchaProducer.createImage(capText);
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// write the data out
|
||||
ImageIO.write(bi, "jpg", out);
|
||||
|
||||
out.flush();
|
||||
out.close();
|
||||
}catch(Exception e) {
|
||||
_logger.error("captcha Producer Error " + e.getMessage());
|
||||
BufferedImage bufferedImage = captchaProducer.createImage(kaptchaText);
|
||||
producerImage(request,response,bufferedImage);
|
||||
} catch (Exception e) {
|
||||
_logger.error("captcha Producer Error " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* image Producer
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
/**
|
||||
* Session Image Producer.
|
||||
*
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
*/
|
||||
|
||||
@RequestMapping("/image/{id}")
|
||||
public void imageHandleRequest(HttpServletRequest request,HttpServletResponse response,@PathVariable("id") String id) throws Exception {
|
||||
// Set to expire far in the past.
|
||||
response.setDateHeader("Expires", 0);
|
||||
// Set standard HTTP/1.1 no-cache headers.
|
||||
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
|
||||
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
|
||||
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
|
||||
// Set standard HTTP/1.0 no-cache header.
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
// return a jpeg/gif
|
||||
response.setContentType("image/gif");
|
||||
// create the text for the image
|
||||
byte[]image=(byte[]) request.getSession().getAttribute(id);
|
||||
//request.getSession().removeAttribute(id);
|
||||
// create the image with the text
|
||||
if(image!=null){
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// write the data out
|
||||
ImageIO.write(byte2BufferedImage(image), "gif", out);
|
||||
try{
|
||||
out.flush();
|
||||
}finally{
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
@RequestMapping("/image/{id}")
|
||||
public void imageHandleRequest(HttpServletRequest request, HttpServletResponse response,
|
||||
@PathVariable("id") String id) {
|
||||
try {
|
||||
// get session image bytes
|
||||
byte[] image = (byte[]) request.getSession().getAttribute(id);
|
||||
producerImage(request,response,byte2BufferedImage(image));
|
||||
} catch (Exception e) {
|
||||
_logger.error("captcha Producer Error " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public static BufferedImage byte2BufferedImage(byte[]imageByte){
|
||||
/**
|
||||
* producerImage.
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @param bufferedImage BufferedImage
|
||||
* @throws IOException error
|
||||
*/
|
||||
public static void producerImage(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
BufferedImage bufferedImage) throws IOException {
|
||||
// Set to expire far in the past.
|
||||
response.setDateHeader("Expires", 0);
|
||||
// Set standard HTTP/1.1 no-cache headers.
|
||||
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
|
||||
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
|
||||
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
|
||||
// Set standard HTTP/1.0 no-cache header.
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
// return a jpeg/gif
|
||||
response.setContentType("image/gif");
|
||||
|
||||
// create the image
|
||||
if (bufferedImage != null) {
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// write the data out
|
||||
ImageIO.write(bufferedImage, "gif", out);
|
||||
try {
|
||||
out.flush();
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* byte2BufferedImage.
|
||||
* @param imageByte bytes
|
||||
* @return
|
||||
*/
|
||||
public static BufferedImage byte2BufferedImage(byte[] imageByte) {
|
||||
try {
|
||||
InputStream in = new ByteArrayInputStream(imageByte);
|
||||
BufferedImage bufferedImage = ImageIO.read(in);
|
||||
return bufferedImage;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
InputStream in = new ByteArrayInputStream(imageByte);
|
||||
BufferedImage bufferedImage = ImageIO.read(in);
|
||||
return bufferedImage;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static byte[] bufferedImage2Byte(BufferedImage bufferedImage ){
|
||||
/**
|
||||
* bufferedImage2Byte.
|
||||
* @param bufferedImage BufferedImage
|
||||
* @return
|
||||
*/
|
||||
public static byte[] bufferedImage2Byte(BufferedImage bufferedImage) {
|
||||
try {
|
||||
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
|
||||
ImageIO.write(bufferedImage,"gif",byteArrayOutputStream);
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
ImageIO.write(bufferedImage, "gif", byteArrayOutputStream);
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Producer getCaptchaProducer() {
|
||||
return captchaProducer;
|
||||
}
|
||||
|
||||
public void setCaptchaProducer(Producer captchaProducer) {
|
||||
this.captchaProducer = captchaProducer;
|
||||
}
|
||||
public void setCaptchaProducer(Producer captchaProducer) {
|
||||
this.captchaProducer = captchaProducer;
|
||||
}
|
||||
|
||||
public void setApplicationConfig(ApplicationConfig applicationConfig) {
|
||||
this.applicationConfig = applicationConfig;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,211 +15,213 @@ import org.springframework.validation.FieldError;
|
||||
|
||||
/**
|
||||
* message类定义
|
||||
*
|
||||
* @author Crystal.Sea
|
||||
*
|
||||
*/
|
||||
public class Message {
|
||||
final static Logger _logger = LoggerFactory.getLogger(Message.class);
|
||||
//服务名称
|
||||
private String serviceName;
|
||||
//信息内容
|
||||
private String message;
|
||||
//信息代码
|
||||
private String code;
|
||||
//信息对象
|
||||
private Object messageObject;
|
||||
//错误信息
|
||||
private ArrayList<HashMap<String,Object>> errors;
|
||||
//类型
|
||||
private MessageType messageType=MessageType.info;
|
||||
//操作类型
|
||||
private OperateType operateType=OperateType.unknown;
|
||||
//范围
|
||||
MessageScope messageScope=MessageScope.JSON;
|
||||
static final Logger _logger = LoggerFactory.getLogger(Message.class);
|
||||
// 服务名称
|
||||
private String serviceName;
|
||||
// 信息内容
|
||||
private String message;
|
||||
// 信息代码
|
||||
private String code;
|
||||
// 信息对象
|
||||
private Object messageObject;
|
||||
// 错误信息
|
||||
private ArrayList<HashMap<String, Object>> errors;
|
||||
// 类型
|
||||
private MessageType messageType = MessageType.info;
|
||||
// 操作类型
|
||||
private OperateType operateType = OperateType.unknown;
|
||||
// 范围
|
||||
MessageScope messageScope = MessageScope.JSON;
|
||||
|
||||
public Message() {
|
||||
public Message() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Message(String message) {
|
||||
this.message = message;
|
||||
this.messageType = MessageType.info;
|
||||
}
|
||||
public Message(String message) {
|
||||
this.message = message;
|
||||
this.messageType = MessageType.info;
|
||||
}
|
||||
|
||||
public Message(BindingResult result) {
|
||||
setFieldErrors(result);
|
||||
}
|
||||
|
||||
public Message(BindingResult result) {
|
||||
setFieldErrors(result);
|
||||
}
|
||||
public Message(String message, String code) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
this.messageType = MessageType.info;
|
||||
}
|
||||
|
||||
public Message(String message, String code) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
this.messageType = MessageType.info;
|
||||
}
|
||||
public Message(String message, MessageType messageType) {
|
||||
this.message = message;
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public Message(String message, MessageType messageType) {
|
||||
this.message = message;
|
||||
this.messageType = messageType;
|
||||
}
|
||||
public Message(String message, BindingResult result) {
|
||||
this.message = message;
|
||||
setFieldErrors(result);
|
||||
}
|
||||
|
||||
public Message(String message,BindingResult result) {
|
||||
this.message = message;
|
||||
setFieldErrors(result);
|
||||
}
|
||||
public Message(String message, String code, MessageType messageType) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public Message(String message, String code, MessageType messageType) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
this.messageType = messageType;
|
||||
}
|
||||
public Message(String message, Object messageObject, MessageType messageType, OperateType operateType) {
|
||||
this.message = message;
|
||||
this.messageType = messageType;
|
||||
this.operateType = operateType;
|
||||
this.messageObject = messageObject;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
|
||||
public Message(String message,Object messageObject, MessageType messageType,
|
||||
OperateType operateType) {
|
||||
this.message = message;
|
||||
this.messageType = messageType;
|
||||
this.operateType = operateType;
|
||||
this.messageObject = messageObject;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
public Message(String message, Object messageObject, MessageType messageType, OperateType operateType,
|
||||
MessageScope messageScope) {
|
||||
this.message = message;
|
||||
this.messageObject = messageObject;
|
||||
this.messageType = messageType;
|
||||
this.operateType = operateType;
|
||||
this.messageScope = messageScope;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
|
||||
public Message(String message, Object messageObject, BindingResult result, MessageType messageType,
|
||||
OperateType operateType, MessageScope messageScope) {
|
||||
this.message = message;
|
||||
this.messageObject = messageObject;
|
||||
this.operateType = operateType;
|
||||
this.messageScope = messageScope;
|
||||
setFieldErrors(result);
|
||||
this.messageType = messageType;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
|
||||
public Message(String message,Object messageObject, MessageType messageType,
|
||||
OperateType operateType,MessageScope messageScope) {
|
||||
this.message = message;
|
||||
this.messageObject = messageObject;
|
||||
this.messageType = messageType;
|
||||
this.operateType = operateType;
|
||||
this.messageScope= messageScope;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
public Message(String serviceName, String message, Object messageObject, BindingResult result,
|
||||
MessageType messageType, OperateType operateType, MessageScope messageScope) {
|
||||
this.serviceName = serviceName;
|
||||
this.message = message;
|
||||
this.messageObject = messageObject;
|
||||
this.operateType = operateType;
|
||||
this.messageScope = messageScope;
|
||||
setFieldErrors(result);
|
||||
this.messageType = messageType;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
|
||||
public Message(String message,Object messageObject,BindingResult result, MessageType messageType,
|
||||
OperateType operateType,MessageScope messageScope) {
|
||||
this.message = message;
|
||||
this.messageObject = messageObject;
|
||||
this.operateType = operateType;
|
||||
this.messageScope= messageScope;
|
||||
setFieldErrors(result);
|
||||
this.messageType = messageType;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
public Message(String serviceName, String message, Object messageObject, BindingResult result,
|
||||
MessageType messageType, OperateType operateType, MessageScope messageScope, String code) {
|
||||
this(serviceName, message, messageObject, result, messageType, operateType, messageScope);
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Message(String serviceName,String message,Object messageObject,BindingResult result, MessageType messageType,
|
||||
OperateType operateType,MessageScope messageScope) {
|
||||
this.serviceName = serviceName;
|
||||
this.message = message;
|
||||
this.messageObject = messageObject;
|
||||
this.operateType = operateType;
|
||||
this.messageScope= messageScope;
|
||||
setFieldErrors(result);
|
||||
this.messageType = messageType;
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
/**
|
||||
* 验证错误组装
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
public void setFieldErrors(BindingResult result) {
|
||||
if (result == null)
|
||||
return;
|
||||
this.messageType = MessageType.error;
|
||||
this.errors = new ArrayList<HashMap<String, Object>>();
|
||||
List<FieldError> listFieldError = result.getFieldErrors();
|
||||
|
||||
public Message(String serviceName,String message,Object messageObject,BindingResult result, MessageType messageType,
|
||||
OperateType operateType,MessageScope messageScope,String code) {
|
||||
this(serviceName, message, messageObject, result, messageType, operateType, messageScope);
|
||||
this.code = code;
|
||||
}
|
||||
for (FieldError fieldError : listFieldError) {
|
||||
HashMap<String, Object> error = new HashMap<String, Object>();
|
||||
error.put("field", fieldError.getField());
|
||||
error.put("type", fieldError.getCode());
|
||||
error.put("objectName", fieldError.getObjectName());
|
||||
String defaultMessageSourceResolvable = fieldError.getCodes()[0];
|
||||
String errorMessage = WebContext.getI18nValue(defaultMessageSourceResolvable);
|
||||
if (errorMessage == null) {
|
||||
error.put("message", /* fieldError.getField()+" "+ */fieldError.getDefaultMessage());
|
||||
} else {
|
||||
error.put("message", errorMessage);
|
||||
}
|
||||
_logger.debug("" + error);
|
||||
this.errors.add(error);
|
||||
}
|
||||
_logger.debug("" + this.errors);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证错误组装
|
||||
* @param result
|
||||
*/
|
||||
public void setFieldErrors(BindingResult result) {
|
||||
if(result==null)
|
||||
return;
|
||||
this.messageType = MessageType.error;
|
||||
this.errors=new ArrayList<HashMap<String,Object>>();
|
||||
List<FieldError> listFieldError=result.getFieldErrors();
|
||||
public void setApplication() {
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
|
||||
for(FieldError fieldError : listFieldError){
|
||||
HashMap<String,Object> error=new HashMap<String,Object>();
|
||||
error.put("field", fieldError.getField());
|
||||
error.put("type", fieldError.getCode());
|
||||
error.put("objectName", fieldError.getObjectName());
|
||||
String defaultMessageSourceResolvable=fieldError.getCodes()[0];
|
||||
String errorMessage=WebContext.getI18nValue(defaultMessageSourceResolvable);
|
||||
if(errorMessage==null){
|
||||
error.put("message", /*fieldError.getField()+" "+*/fieldError.getDefaultMessage());
|
||||
}else{
|
||||
error.put("message", errorMessage);
|
||||
}
|
||||
_logger.debug(""+error);
|
||||
this.errors.add(error);
|
||||
}
|
||||
_logger.debug(""+this.errors);
|
||||
}
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setApplication(){
|
||||
WebContext.setMessage(this);
|
||||
}
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
/**
|
||||
* @param code the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public MessageType getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
public void setMessageType(MessageType messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
public MessageType getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
public ArrayList<HashMap<String, Object>> getErrors() {
|
||||
return errors;
|
||||
}
|
||||
public void setMessageType(MessageType messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public void setErrors(ArrayList<HashMap<String, Object>> errors) {
|
||||
this.errors = errors;
|
||||
}
|
||||
public ArrayList<HashMap<String, Object>> getErrors() {
|
||||
return errors;
|
||||
}
|
||||
|
||||
public OperateType getOperateType() {
|
||||
return operateType;
|
||||
}
|
||||
public void setErrors(ArrayList<HashMap<String, Object>> errors) {
|
||||
this.errors = errors;
|
||||
}
|
||||
|
||||
public void setOperateType(OperateType operateType) {
|
||||
this.operateType = operateType;
|
||||
}
|
||||
public OperateType getOperateType() {
|
||||
return operateType;
|
||||
}
|
||||
|
||||
public Object getMessageObject() {
|
||||
return messageObject;
|
||||
}
|
||||
public void setOperateType(OperateType operateType) {
|
||||
this.operateType = operateType;
|
||||
}
|
||||
|
||||
public void setMessageObject(Object messageObject) {
|
||||
this.messageObject = messageObject;
|
||||
}
|
||||
public Object getMessageObject() {
|
||||
return messageObject;
|
||||
}
|
||||
|
||||
public MessageScope getMessageScope() {
|
||||
return messageScope;
|
||||
}
|
||||
public void setMessageObject(Object messageObject) {
|
||||
this.messageObject = messageObject;
|
||||
}
|
||||
|
||||
public void setMessageScope(MessageScope messageScope) {
|
||||
this.messageScope = messageScope;
|
||||
}
|
||||
public MessageScope getMessageScope() {
|
||||
return messageScope;
|
||||
}
|
||||
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
public void setMessageScope(MessageScope messageScope) {
|
||||
this.messageScope = messageScope;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,14 +43,15 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
return (UserInfoMapper)super.getMapper();
|
||||
}
|
||||
|
||||
public boolean insert(UserInfo userinfo) {
|
||||
if(super.insert(userinfo)){
|
||||
public boolean insert(UserInfo userInfo) {
|
||||
userInfo = passwordEncoder(userInfo);
|
||||
if (super.insert(userInfo)) {
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean update(UserInfo userinfo) {
|
||||
if(super.update(userinfo)){
|
||||
@@ -103,19 +104,24 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
}
|
||||
}
|
||||
|
||||
public UserInfo passwordEncoder(UserInfo userInfo) {
|
||||
String password = passwordEncoder.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword()));
|
||||
userInfo.setDecipherable(ReciprocalUtils.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword())));
|
||||
_logger.debug("decipherable : "+userInfo.getDecipherable());
|
||||
userInfo.setPassword(password);
|
||||
userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString());
|
||||
|
||||
userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString());
|
||||
|
||||
return userInfo;
|
||||
}
|
||||
public boolean changePassword(UserInfo userInfo) {
|
||||
try {
|
||||
if(WebContext.getUserInfo() != null) {
|
||||
userInfo.setModifiedBy(WebContext.getUserInfo().getId());
|
||||
|
||||
}
|
||||
String password = passwordEncoder.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword()));
|
||||
userInfo.setDecipherable(ReciprocalUtils.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword())));
|
||||
_logger.debug("decipherable : "+userInfo.getDecipherable());
|
||||
userInfo.setPassword(password);
|
||||
userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString());
|
||||
|
||||
userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString());
|
||||
userInfo = passwordEncoder(userInfo);
|
||||
|
||||
if(getMapper().changePassword(userInfo) > 0){
|
||||
ChangePassword changePassword=new ChangePassword();
|
||||
|
||||
Binary file not shown.
BIN
maxkey-lib/mybatis-jpa-extra-2.0.jar
Normal file
BIN
maxkey-lib/mybatis-jpa-extra-2.0.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
maxkey-lib/mybatis-jpa-extra-2.1-api-2.0.jar
Normal file
BIN
maxkey-lib/mybatis-jpa-extra-2.1-api-2.0.jar
Normal file
Binary file not shown.
@@ -199,7 +199,7 @@ public class UserInfoController {
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value="/delete",method=RequestMethod.DELETE)
|
||||
@RequestMapping(value="/delete")
|
||||
public Message deleteUsersById(@RequestParam("id") String id) {
|
||||
_logger.debug(id);
|
||||
if(userInfoService.batchDelete(StringUtils.string2List(id, ","))) {
|
||||
|
||||
@@ -51,6 +51,8 @@ config.characterencoding.tocharset=UTF-8
|
||||
############################################################################
|
||||
# Login
|
||||
config.login.captcha=false
|
||||
#text or arithmetic
|
||||
config.login.captcha.type=text
|
||||
config.login.socialAuth=true
|
||||
config.login.msad.kerberos=false
|
||||
# End Login
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
<!--<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">-->
|
||||
<bean id="sqlSessionFactory" class="org.apache.mybatis.jpa.MyBatisSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="dialect" value="mysql" />
|
||||
<property name="timeout" value="30" />
|
||||
<property name="transactionFactory">
|
||||
<bean class="org.apache.ibatis.transaction.managed.ManagedTransactionFactory" />
|
||||
</property>
|
||||
@@ -70,32 +72,13 @@
|
||||
org.maxkey.domain,
|
||||
org.maxkey.domain.apps,
|
||||
" />
|
||||
<property name="timeout" value="30" />
|
||||
<property name="mapperLocations" value="classpath*:org/maxkey/dao/persistence/xml/#{dataSoruceConfig.database}/*.xml" />
|
||||
<property name="interceptors">
|
||||
<list>
|
||||
<ref bean="StatementHandlerInterceptor"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="StatementHandlerInterceptor" class="org.apache.mybatis.jpa.StatementHandlerInterceptor">
|
||||
<!-- dialect need bean dialect
|
||||
<property name="dialect">
|
||||
<bean id="dialect" class="org.apache.mybatis.jpa.dialect.MySQLDialect"/>
|
||||
</property>
|
||||
-->
|
||||
<!-- from database type -->
|
||||
<property name="dialectString" value="#{dataSoruceConfig.dialect}"/>
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="sqlSessionFactory" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- scan for mappers and let them be autowired -->
|
||||
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
||||
<property name="basePackage"
|
||||
|
||||
@@ -117,24 +117,23 @@
|
||||
|
||||
<!-- Captcha Producer Config -->
|
||||
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha">
|
||||
<property name="config">
|
||||
<bean class="com.google.code.kaptcha.util.Config">
|
||||
<constructor-arg type="java.util.Properties">
|
||||
<props>
|
||||
<prop key="kaptcha.image.width">70</prop>
|
||||
<prop key="kaptcha.image.height">25</prop>
|
||||
<prop key="kaptcha.border">no</prop>
|
||||
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
|
||||
<prop key="kaptcha.textproducer.font.size">23</prop>
|
||||
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
|
||||
<prop key="kaptcha.textproducer.char.length">4</prop>
|
||||
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
|
||||
<!-- <prop key="kaptcha.noise.color">white</prop>
|
||||
-->
|
||||
</props>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="config" >
|
||||
<bean id="kaptchaConfig" class="com.google.code.kaptcha.util.Config">
|
||||
<constructor-arg type="java.util.Properties">
|
||||
<props>
|
||||
<prop key="kaptcha.image.width">80</prop>
|
||||
<prop key="kaptcha.image.height">25</prop>
|
||||
<prop key="kaptcha.border">no</prop>
|
||||
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
|
||||
<prop key="kaptcha.textproducer.font.size">23</prop>
|
||||
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
|
||||
<prop key="kaptcha.textproducer.char.length">4</prop>
|
||||
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
|
||||
<!-- <prop key="kaptcha.noise.color">white</prop> -->
|
||||
</props>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="savedRequestSuccessHandler" class="org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler"> </bean>
|
||||
|
||||
@@ -51,11 +51,11 @@ $(function () {
|
||||
</tr>
|
||||
<tr>
|
||||
<td > <@locale code="org.name" />:</td>
|
||||
<td><input type="text" id="name" name="name" class="form-control"/></td>
|
||||
<td><input type="text" id="name" name="name" required="" class="form-control"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td > <@locale code="org.fullname" />:</td>
|
||||
<td><input type="text" id="fullName" name="fullName" class="form-control"/></td>
|
||||
<td><input type="text" id="fullName" name="fullName" required="" class="form-control"/></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td > <@locale code="org.xpath" /> :
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
<td style="width:15%;"><@locale code="userinfo.username" />:</td>
|
||||
<td style="width:35%;">
|
||||
<input type="hidden" id="id" name="id" value=""/>
|
||||
<input class="form-control" type="text" id="username" name="username" title="" value=""/>
|
||||
<input class="form-control" type="text" required="" id="username" name="username" title="" value=""/>
|
||||
</td>
|
||||
<td style="width:15%;"><@locale code="login.text.password" />:</td>
|
||||
<td style="width:35%;">
|
||||
<input class="form-control" type="password" id="password" name="password" title="" value=""/>
|
||||
<input class="form-control" type="password" required="" id="password" name="password" title="" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -88,7 +88,7 @@
|
||||
<tr>
|
||||
<td><@locale code="userinfo.displayName" />:</td>
|
||||
<td>
|
||||
<input class="form-control" type="text" id="displayName" name="displayName" title="" value=""/>
|
||||
<input class="form-control" type="text" required="" id="displayName" name="displayName" title="" value=""/>
|
||||
</td>
|
||||
<td rowspan="4"><@locale code="userinfo.picture" />:</td>
|
||||
<td rowspan="4">
|
||||
|
||||
@@ -40,12 +40,12 @@ config.datasource.password.encrypt=false
|
||||
############################################################################
|
||||
# EMAIL configuration
|
||||
############################################################################
|
||||
config.email.username=test@maxkey.org
|
||||
config.email.password=3&8Ujbnm5hkjhFD
|
||||
config.email.smtpHost=smtp.exmail.qq.com
|
||||
config.email.port=25
|
||||
config.email.senderMail=test@maxkey.org
|
||||
config.email.ssl=false
|
||||
config.email.username=shimingxy@163.com
|
||||
config.email.password=seamingxy99
|
||||
config.email.smtpHost=smtp.163.com
|
||||
config.email.port=465
|
||||
config.email.senderMail=shimingxy@163.com
|
||||
config.email.ssl=true
|
||||
|
||||
############################################################################
|
||||
# CharacterEncoding configuration
|
||||
@@ -79,6 +79,8 @@ config.redis.pool.testonborrow=true
|
||||
# Login configuration
|
||||
#enable captcha
|
||||
config.login.captcha=true
|
||||
#text or arithmetic
|
||||
config.login.captcha.type=text
|
||||
#enable two factor,use one time password
|
||||
config.login.onetimepwd=true
|
||||
#enable social sign on
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
<!--<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">-->
|
||||
<bean id="sqlSessionFactory" class="org.apache.mybatis.jpa.MyBatisSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="dialect" value="mysql" />
|
||||
<property name="timeout" value="30" />
|
||||
<property name="transactionFactory">
|
||||
<bean class="org.apache.ibatis.transaction.managed.ManagedTransactionFactory" />
|
||||
</property>
|
||||
@@ -68,27 +70,9 @@
|
||||
org.maxkey.domain,
|
||||
org.maxkey.domain.apps,
|
||||
" />
|
||||
<property name="timeout" value="30" />
|
||||
<property name="mapperLocations" value="classpath*:/org/maxkey/dao/persistence/xml/#{dataSoruceConfig.database}/*.xml" />
|
||||
<property name="interceptors">
|
||||
<list>
|
||||
<ref bean="StatementHandlerInterceptor"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="StatementHandlerInterceptor" class="org.apache.mybatis.jpa.StatementHandlerInterceptor">
|
||||
<!-- dialect need bean dialect
|
||||
<property name="dialect">
|
||||
<bean id="dialect" class="org.apache.mybatis.jpa.dialect.MySQLDialect"/>
|
||||
</property>
|
||||
-->
|
||||
<!-- from database type -->
|
||||
<property name="dialectString" value="#{dataSoruceConfig.dialect}"/>
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg index="0" ref="sqlSessionFactory" />
|
||||
</bean>
|
||||
|
||||
@@ -127,26 +127,28 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Captcha Producer Config -->
|
||||
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha">
|
||||
<property name="config">
|
||||
<bean class="com.google.code.kaptcha.util.Config">
|
||||
<constructor-arg type="java.util.Properties">
|
||||
<props>
|
||||
<prop key="kaptcha.image.width">70</prop>
|
||||
<prop key="kaptcha.image.height">25</prop>
|
||||
<prop key="kaptcha.border">no</prop>
|
||||
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
|
||||
<prop key="kaptcha.textproducer.font.size">23</prop>
|
||||
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
|
||||
<prop key="kaptcha.textproducer.char.length">4</prop>
|
||||
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
|
||||
<!-- <prop key="kaptcha.noise.color">white</prop>
|
||||
-->
|
||||
</props>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</property>
|
||||
<bean id="kaptchaConfig" class="com.google.code.kaptcha.util.Config">
|
||||
<constructor-arg type="java.util.Properties">
|
||||
<props>
|
||||
<prop key="kaptcha.image.width">80</prop>
|
||||
<prop key="kaptcha.image.height">25</prop>
|
||||
<prop key="kaptcha.border">no</prop>
|
||||
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
|
||||
<prop key="kaptcha.textproducer.font.size">23</prop>
|
||||
<prop key="kaptcha.textproducer.char.string">0123456789</prop>
|
||||
<prop key="kaptcha.textproducer.char.length">4</prop>
|
||||
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
|
||||
<!-- 干扰线
|
||||
<prop key="kaptcha.noise.color">white</prop>
|
||||
-->
|
||||
</props>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="savedRequestSuccessHandler" class="org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler"> </bean>
|
||||
|
||||
Reference in New Issue
Block a user