Commit 843cb1b1 authored by 李良停's avatar 李良停

Initial Commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
# Default ignored files
/workspace.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="sh-authcenter-agent" />
<module name="sh-authcenter-log" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/sh-authcenter-agent" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/sh-authcenter-log" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$/sh-authcenter-agent" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8.0_151" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sh-authcenter</artifactId>
<groupId>com.chineseall.authcenter</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sh-authcenter-agent</artifactId>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>cn.sh.chineseall</groupId>
<artifactId>alpha-framework-springboot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>cn.sh.chineseall</groupId>
<artifactId>alpha-framework-core</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>
<dependency>
<groupId>com.chineseall.authcenter</groupId>
<artifactId>sh-authcenter-log</artifactId>
<version>${project.version}</version>
</dependency>
<!--因配置外部TOMCAT 而配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
package com.chineseall.authcenter.agent;
import cn.sh.chineseall.framework.starter.annotation.AlphaFrameworkApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
@AlphaFrameworkApplication
@ComponentScan(basePackages = {"com.chineseall.authcenter.agent", "com.chineseall.authcenter.log"})
public class EdenAuthcenterAgentApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(EdenAuthcenterAgentApplication.class);
}
public static void main(String[] args) {
cn.sh.chineseall.framework.springboot.bootstrap.application.AlphaFrameworkSpringApplication.run(EdenAuthcenterAgentApplication.class, args);
}
}
package com.chineseall.authcenter.agent.client;
import lombok.Data;
/**
* @author zhangjiaquan
*/
@Data
public class AuthUserInfo {
private String id;//uuid
private String realName;//姓名
private String loginName;//姓名
private String userType;//教师、学生
private String source;//来源
/**
* 学生
*/
private String studentId;//学生id
private String studentCode;//学籍号
private String studentStage;//学段
private String studentGrade;//年级
private String studentClass;//班级
private String studentStageName;//学段名称
private String studentGradeName;//年级名称
private String studentClassName;//班级名称
private String studentSchoolId;//学籍学校id
private String studentCodeStatus;//学籍当前状态
private String studentSchoolCode;//学籍学校代码
private String studentSchoolName;//学籍学校名称
private String studentRegionCode;//学籍区县代码
private String studentRegionName;//学籍区县名称
/**
* 教师
*/
private String teacherTrainingNo;//师训号
private String teacherCertificateNo;
private String teacherTrainingUserName;//师训用户名
private String teacherRegionCode;//师训区县id
private String teacherCampusCode;//师训学区id
private String teacherTrainingSchoolType;//师训学校类型
private String teacherStage;//师训学段id
private String teacherGrade;//师训年级id
private String teacherSubject;//师训专业
private String teacherSchoolId;//师训学校id
private String teacherSchoolName;//师训学校名称
}
package com.chineseall.authcenter.agent.client;
import com.chineseall.authcenter.agent.oauth.OauthType;
import lombok.Data;
@Data
public class ClientDataInfo {
private AuthUserInfo authUserInfo;
private String returnUrl;
private OauthType oauthType;
}
package com.chineseall.authcenter.agent.client;
import lombok.Data;
import java.io.Serializable;
/**
* Created by yuchunlin on 2019/5/28.
*/
@Data
public class ClientItem implements Serializable{
private String clientName;
private String clientId;
private String clientSecret;
private String loginSuccessUrl;
private String logoutSuccessUrl;
}
package com.chineseall.authcenter.agent.client;
import lombok.Getter;
/**
* @author liuyp
*/
public enum ClientUserType {
Student("1001","学生"),
Teacher("2001","老师"),
Mentor("2002","老师");
@Getter
private final String code;
@Getter
private final String description;
ClientUserType(String code, String description) {
this.code = code;
this.description = description;
}
public static ClientUserType getValue(String name) {
try {
return ClientUserType.valueOf(name);
} catch (Exception ex) {
return null;
}
}
}
package com.chineseall.authcenter.agent.client;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Created by yuchunlin on 2019/5/28.
*/
@Data
@Component
@ConfigurationProperties(prefix = "oauthclient")
public class OauthClient {
private List<ClientItem> clients;
}
package com.chineseall.authcenter.agent.controller;
import cn.sh.chineseall.framework.core.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.chineseall.authcenter.agent.client.ClientDataInfo;
import com.chineseall.authcenter.agent.utils.EncodeUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
@Controller
@RequestMapping("sample")
public class SampleController {
// 认证系统提供client_id
private static final String CLIENT_ID = "jsydClentId";
// 认证系统提供client_secret
private static final String CLIENT_SECRET = "jsydClientSecret";
// 登录地址
private static final String LOGIN_URL = "https://sp.etextbook.cn/authcenter/auth/login";
// 登出地址
private static final String LOGOUT_URL = "https://sp.etextbook.cn/authcenter/auth/logout";
// 登录回调地址
private static final String LOGIN_SUCCESS_URL = "https://sp.etextbook.cn/authcenter/sample/loginsuccess";
// 登出回调地址
private static final String LOGOUT_SUCCESS_URL = "https://sp.etextbook.cn/authcenter/sample/logoutsuccess";
@RequestMapping("login")
public ModelAndView login(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
try {
String loginType = request.getParameter("login_type");
String sign = EncodeUtil.md5(CLIENT_ID + "$$" + CLIENT_SECRET);
String loginUrl = LOGIN_URL + "?client_id=" + CLIENT_ID + "&sign=" + sign + "&redirect_uri=" + URLEncoder.encode(LOGIN_SUCCESS_URL);
if(loginType!=null){
loginUrl = loginUrl + "&login_type=" + loginType;
}
response.sendRedirect(loginUrl);
return null;
} catch (IOException e) {
e.printStackTrace();
}
return modelAndView;
}
@RequestMapping("logout")
public ModelAndView logout(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
try {
String sign = EncodeUtil.md5(CLIENT_ID + "$$" + CLIENT_SECRET);
String loginUrl = LOGOUT_URL + "?client_id=" + CLIENT_ID + "&sign=" + sign + "&service="
+ URLEncoder.encode(LOGOUT_SUCCESS_URL) ;
response.sendRedirect(loginUrl);
return null;
} catch (IOException e) {
e.printStackTrace();
}
return modelAndView;
}
@RequestMapping("loginsuccess")
@ResponseBody
public String loginsuccess(ClientDataInfo clientDataInfo) {
return JSON.toJSONString(clientDataInfo);
}
@RequestMapping("logoutsuccess")
@ResponseBody
public String logoutsuccess(ClientDataInfo clientDataInfo) {
return "登出成功!";
}
}
package com.chineseall.authcenter.agent.oauth;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.io.Serializable;
import java.util.Map;
@Data
@Component
@ConfigurationProperties(prefix = "oauth")
public class OauthConfig implements Serializable {
Map<String,OauthConfigItem> items;
}
package com.chineseall.authcenter.agent.oauth;
import lombok.Data;
import java.io.Serializable;
/**
* Created by yuchunlin on 2019/1/3.
*/
@Data
public class OauthConfigItem implements Serializable {
//http://castest.edu.sh.cn/CAS/oauth2.0
private String oauthUrl;
private String clientId;
private String clientSecret;
private String loginSuccessUrl;
private String logoutSuccessUrl;
}
package com.chineseall.authcenter.agent.oauth;
import lombok.Getter;
public enum OauthType {
dianjiaoguan("dianjiaoguan","电教馆账号认证"),
edenoperation("edenoperation","数字教材账号认证");
@Getter
private final String code;
@Getter
private final String description;
OauthType(String code, String description) {
this.code = code;
this.description = description;
}
public static OauthType getValue(String name) {
try {
return OauthType.valueOf(name);
} catch (Exception ex) {
return null;
}
}
}
package com.chineseall.authcenter.agent.utils;
import cn.sh.chineseall.framework.core.repackaged.org.apache.commons.lang3.StringUtils;
import com.chineseall.authcenter.agent.client.AuthUserInfo;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class ConvertMessageMapToBean {
public static AuthUserInfo converDianjiaoguanData(Map<String, Object> dataMap){
List<Map<String, String>> attributes = (List<Map<String, String>>) dataMap.get("attributes");
Map<String, String> map = new LinkedHashMap<>();
if(null != attributes) {
attributes.stream().forEach(stringMap -> {
for (Map.Entry entry : stringMap.entrySet()) {
map.put(entry.getKey().toString(), entry.getValue().toString());
}
});
}
AuthUserInfo authUserInfo = new AuthUserInfo();
if(StringUtils.isNotBlank(map.get("ID")))
authUserInfo.setId(map.get("ID").toString());
if(StringUtils.isNotBlank(map.get("XM")))
authUserInfo.setRealName(map.get("XM").toString());
if(StringUtils.isNotBlank(map.get("ROLE"))) {
}
if(StringUtils.isNotBlank(map.get("XJXSID")))
authUserInfo.setStudentId(map.get("XJXSID").toString());
if(StringUtils.isNotBlank(map.get("XJFH")))
authUserInfo.setStudentCode(map.get("XJFH").toString());
if(StringUtils.isNotBlank(map.get("XJXD"))) {
}
if(StringUtils.isNotBlank(map.get("XJNJ"))){
}
if(StringUtils.isNotBlank(map.get("XJBJ")))
authUserInfo.setStudentClass(map.get("XJBJ").toString());
if(authUserInfo.getStudentStage() != null)
if(authUserInfo.getStudentGrade() != null)
if(StringUtils.isNotBlank(map.get("XJBJMC")))
authUserInfo.setStudentClassName(map.get("XJBJMC").toString());
if(StringUtils.isNotBlank(map.get("XJXXID")))
authUserInfo.setStudentSchoolId(map.get("XJXXID").toString());
if(StringUtils.isNotBlank(map.get("XJDQZT")))
authUserInfo.setStudentCodeStatus(map.get("XJDQZT").toString());
if(StringUtils.isNotBlank(map.get("XJXXDM")))
authUserInfo.setStudentSchoolCode(map.get("XJXXDM").toString());
if(StringUtils.isNotBlank(map.get("XJXXMC")))
authUserInfo.setStudentSchoolName(map.get("XJXXMC").toString());
if(StringUtils.isNotBlank(map.get("XJQXDM")))
authUserInfo.setStudentRegionCode(map.get("XJQXDM").toString());
if(StringUtils.isNotBlank(map.get("XJQXMC")))
authUserInfo.setStudentRegionName(map.get("XJQXMC").toString());
if(StringUtils.isNotBlank(map.get("SXTEACHNUMBER")))
authUserInfo.setTeacherTrainingNo(map.get("SXTEACHNUMBER").toString());
if(StringUtils.isNotBlank(map.get("SXENAME")))
authUserInfo.setTeacherTrainingUserName(map.get("SXENAME").toString());
if(StringUtils.isNotBlank(map.get("SXQUXIANID")))
authUserInfo.setTeacherRegionCode(map.get("SXQUXIANID").toString());
if(StringUtils.isNotBlank(map.get("SXXUQUID")))
authUserInfo.setTeacherCampusCode(map.get("SXXUQUID").toString());
if(StringUtils.isNotBlank(map.get("SXSCHOOL_TYPEID")))
authUserInfo.setTeacherTrainingSchoolType(map.get("SXSCHOOL_TYPEID").toString());
if(StringUtils.isNotBlank(map.get("SXXUEDUANID"))){
}
if(StringUtils.isNotBlank(map.get("SXNIANJIID"))){
}
if(StringUtils.isNotBlank(map.get("SXMASTERSUBJECT"))) {
}
if(StringUtils.isNotBlank(map.get("SXSCHOOLID")))
authUserInfo.setTeacherSchoolId(map.get("SXSCHOOLID").toString());
if(StringUtils.isNotBlank(map.get("SXSCHOOL_NAME")))
authUserInfo.setTeacherSchoolName(map.get("SXSCHOOL_NAME").toString());
return authUserInfo;
}
public static AuthUserInfo converEdenoperationData(Map<String, Object> dataMap){
Map<String, String> map = (Map<String, String>) dataMap.get("authUserInfo");
AuthUserInfo authUserInfo = new AuthUserInfo();
if(StringUtils.isNotBlank(map.get("id")))
authUserInfo.setId(map.get("id").toString());
if(StringUtils.isNotBlank(map.get("real_name")))
authUserInfo.setRealName(map.get("real_name").toString());
if(StringUtils.isNotBlank(map.get("user_type")))
if(StringUtils.isNotBlank(map.get("student_id")))
authUserInfo.setStudentId(map.get("student_id").toString());
if(StringUtils.isNotBlank(map.get("student_code")))
authUserInfo.setStudentCode(map.get("student_code").toString());
if(StringUtils.isNotBlank(map.get("student_stage")))
if(StringUtils.isNotBlank(map.get("student_grade")))
if(StringUtils.isNotBlank(map.get("student_class")))
if(StringUtils.isNotBlank(map.get("student_stage_name")))
authUserInfo.setStudentStageName(map.get("student_stage_name").toString());
if(authUserInfo.getStudentGrade() != null)
if(StringUtils.isNotBlank(map.get("student_class_name")))
authUserInfo.setStudentClassName(map.get("student_class_name").toString());
if(StringUtils.isNotBlank(map.get("student_school_id")))
authUserInfo.setStudentSchoolId(map.get("student_school_id").toString());
if(StringUtils.isNotBlank(map.get("student_code_status")))
authUserInfo.setStudentCodeStatus(map.get("student_code_status").toString());
if(StringUtils.isNotBlank(map.get("student_school_code")))
authUserInfo.setStudentSchoolCode(map.get("student_school_code").toString());
if(StringUtils.isNotBlank(map.get("student_school_name")))
authUserInfo.setStudentSchoolName(map.get("student_school_name").toString());
if(StringUtils.isNotBlank(map.get("student_region_code")))
authUserInfo.setStudentRegionCode(map.get("student_region_code").toString());
if(StringUtils.isNotBlank(map.get("student_region_name")))
authUserInfo.setStudentRegionName(map.get("student_region_name").toString());
if(StringUtils.isNotBlank(map.get("teacher_training_no")))
authUserInfo.setTeacherTrainingNo(map.get("teacher_training_no").toString());
if(StringUtils.isNotBlank(map.get("teacher_training_user_name")))
authUserInfo.setTeacherTrainingUserName(map.get("teacher_training_user_name").toString());
if(StringUtils.isNotBlank(map.get("teacher_region_code")))
authUserInfo.setTeacherRegionCode(map.get("teacher_region_code").toString());
if(StringUtils.isNotBlank(map.get("teacher_campus_code")))
authUserInfo.setTeacherCampusCode(map.get("teacher_campus_code").toString());
if(StringUtils.isNotBlank(map.get("teacher_training_school_type")))
authUserInfo.setTeacherTrainingSchoolType(map.get("teacher_training_school_type").toString());
if(StringUtils.isNotBlank(map.get("teacher_stage")))
if(StringUtils.isNotBlank(map.get("teacher_grade")))
if(StringUtils.isNotBlank(map.get("teacher_subject")))
if(StringUtils.isNotBlank(map.get("teacher_school_id")))
authUserInfo.setTeacherSchoolId(map.get("teacher_school_id").toString());
if(StringUtils.isNotBlank(map.get("teacher_school_name")))
authUserInfo.setTeacherSchoolName(map.get("teacher_school_name").toString());
return authUserInfo;
}
}
package com.chineseall.authcenter.agent.utils;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CookiesUtil {
public static String getSessionId(HttpServletRequest request) {
String sessionId = request.getParameter("JSESSIONID");
if (sessionId == null) {
return getCookie(request, "JSESSIONID");
}
return sessionId;
}
public static String getCookie(HttpServletRequest request, String cookieName) {
Cookie[] cookies = request.getCookies();
String str = null;
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
Cookie c = cookies[i];
if (c.getName().equalsIgnoreCase(cookieName)) {
str = c.getValue();
}
}
}
return str;
}
public static void setCookie(HttpServletResponse response, String domain,
String cookieName, String cookieValue, Integer days) {
Cookie cookies = null;
cookies = new Cookie(cookieName, cookieValue);
if (days != null) {
cookies.setMaxAge(60 * 60 * 24 * days);
}
cookies.setPath("/");
if (domain != null) {
cookies.setDomain(domain);
}
response.addCookie(cookies);
}
public static void delCookie(HttpServletResponse response, String domain,
String path, String cookieName, String cookieValue) {
Cookie cookies = new Cookie(cookieName, cookieValue);
if (domain != null) {
cookies.setDomain(domain);
}
cookies.setPath(path);
cookies.setMaxAge(0);
response.addCookie(cookies);
}
public static void delAllCookie(HttpServletRequest request,
HttpServletResponse response) {
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
Cookie c = cookies[i];
c.setValue("");
c.setMaxAge(0);
response.addCookie(c);
}
}
}
}
package com.chineseall.authcenter.agent.utils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import javax.crypto.*;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
public class EncodeUtil {
private static final String charset = "utf-8";
private static final String KEY_ALGORITHM = "AES";
private static final String CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";
private static final String key = "ChineseAllShanghai!@#$%^&*()";
public static String encodePassword(String originPassword) {
return EncodeUtil.base64Encode(
EncodeUtil.md5(originPassword + key), "UTF-8").trim();
}
/**
* 根据指定的字符串生成密钥
* @param len 密钥长度;支持128、192、256三种长度,本项目采用128位。
*
* @return String 密钥
*/
public static String getKey(String key, int len) throws Exception {
if (len != 128 && len != 192 && len != 256)
return null;
key = EncodeUtil.md5(key);
key = key.substring(0, len / 8);
byte[] kb = key.getBytes(charset);
key = EncodeUtil.encodeBase64(kb);
return key;
}
private static Key toKey(byte[] key)
{
return new SecretKeySpec(key, KEY_ALGORITHM);
}
public static String encrypt(String data, String key) throws Exception
{
//Key k = toKey(Base64.decode(key));
Key k = toKey(EncodeUtil.decodeBase64(key).getBytes(charset));
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, k);
String content = parseByte2HexStr(Base64.encodeBase64((cipher.doFinal(data.getBytes(charset)))));
return content;
}
public static String decrypt(String data, String key) throws Exception
{
Key k = toKey(EncodeUtil.decodeBase64(key).getBytes(charset));
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, k);
String content = new String(cipher.doFinal(Base64.decodeBase64(parseHexStr2Byte(data))), charset);
return content;
}
/**将16进制转换为二进制
* @param hexStr
* @return
*/
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1)
return null;
byte[] result = new byte[hexStr.length()/2];
for (int i = 0;i< hexStr.length()/2; i++) {
int high = Integer.parseInt(hexStr.substring(i*2, i*2+1), 16);
int low = Integer.parseInt(hexStr.substring(i*2+1, i*2+2), 16);
result[i] = (byte) (high * 16 + low);
}
return result;
}
/**将二进制转换成16进制
* @param buf
* @return
*/
public static String parseByte2HexStr(byte buf[]) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < buf.length; i++) {
String hex = Integer.toHexString(buf[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}
/**
* 传入字符串,返回一个加密串
*
* @param s
* @return
*/
public static String encode(String s , String key) {
try {
byte[] encryptedData = encrypt(s , HEXStringToByte(key));
s = byteToHEXString(encryptedData);
} catch (Exception e) {
e.printStackTrace();
}
return s;
}
/**
* 传入加密串,返回解密串
*
* @param s
* @return
*/
public static String decode(String s , String key) {
try {
return decrypt(HEXStringToByte(s) , HEXStringToByte(key));
} catch (Exception e) {
}
return s;
}
/**
* 传入字符串,返回一个加密串
*
* @param s
* @return
*/
public static String encodeBase64(String s) {
byte[] binaryData = null;
try {
binaryData = s.getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
return s;
}
// byte[] newbt = Base64.encodeBase64(binaryData);
return encodeBase64(binaryData);// new String(newbt);
}
public static String encodeBase64(byte[] binaryData) {
byte[] newbt = Base64.encodeBase64(binaryData);
return new String(newbt);
}
public static byte[] enBase64(byte[] binaryData) {
return Base64.encodeBase64(binaryData);
}
public static byte[] deBase64(byte[] bytes) throws IOException {
return Base64.decodeBase64(bytes);
}
public static String stringEncode(String str) {
try {
return java.net.URLEncoder.encode(str, "utf-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str;
}
/**
* 传入加密串,返回解密串
*
* @param s
* @return
*/
public static String decodeBase64(String s) {
try {
return decodeBase64(s.getBytes("utf-8"));
} catch (UnsupportedEncodingException e) {
return s;
}
}
public static String decodeBase64(byte[] bytes) {
byte[] oldbt = null;
String t = null;
try {
oldbt = Base64.decodeBase64(bytes);
t = new String(oldbt, "utf-8");
} catch (UnsupportedEncodingException e) {
}
return t;
}
public static String byteToHEXString(byte[] bArray) {
StringBuilder sb = new StringBuilder(100);
for (int i = 0; i < bArray.length; i++) {
String hex = Integer.toHexString(bArray[i] & 0xff);
if (hex.length() == 1) {
sb.append("0").append(hex);
} else {
sb.append(hex);
}
}
return sb.toString().toUpperCase();
}
public static byte[] HEXStringToByte(String strString) {
byte[] ret = new byte[strString.length() / 2];
for (int i = 0; i < ret.length; i++) {
ret[i] = Integer
.decode("#" + strString.substring(2 * i, 2 * i + 2))
.byteValue();
}
return ret;
}
/**
* 加密方法
*
* @param rawKeyData
* @param str
* @return
* @throws InvalidKeyException
* @throws NoSuchAlgorithmException
* @throws IllegalBlockSizeException
* @throws BadPaddingException
* @throws NoSuchPaddingException
* @throws InvalidKeySpecException
* @throws UnsupportedEncodingException
*/
public static byte[] encrypt(String str , byte [] rawKeyData) throws InvalidKeyException,
NoSuchAlgorithmException, IllegalBlockSizeException,
BadPaddingException, NoSuchPaddingException,
InvalidKeySpecException, UnsupportedEncodingException {
// DES算法要求有一个可信任的随机数源
// SecureRandom sr = new SecureRandom();
// 从原始密匙数据创建一个DESKeySpec对象
DESKeySpec dks = new DESKeySpec(rawKeyData);
// 创建一个密匙工厂,然后用它把DESKeySpec转换成一个SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey key = keyFactory.generateSecret(dks);
// Cipher对象实际完成加密操作
Cipher cipher = Cipher.getInstance("DES");
// 用密匙初始化Cipher对象
cipher.init(Cipher.ENCRYPT_MODE, key);
// 现在,获取数据并加密
byte data[] = str.getBytes("utf-8");
// 正式执行加密操作
byte[] encryptedData = cipher.doFinal(data);
return encryptedData;
}
/**
* 解密方法
*
* @param rawKeyData
* @param encryptedData
* @throws IllegalBlockSizeException
* @throws BadPaddingException
* @throws InvalidKeyException
* @throws NoSuchAlgorithmException
* @throws NoSuchPaddingException
* @throws InvalidKeySpecException
* @throws UnsupportedEncodingException
*/
public static String decrypt(byte[] encryptedData , byte[] rawKeyData)
throws IllegalBlockSizeException, BadPaddingException,
InvalidKeyException, NoSuchAlgorithmException,
NoSuchPaddingException, InvalidKeySpecException,
UnsupportedEncodingException {
// DES算法要求有一个可信任的随机数源
// SecureRandom sr = new SecureRandom();
// 从原始密匙数据创建一个DESKeySpec对象
DESKeySpec dks = new DESKeySpec(rawKeyData);
// 创建一个密匙工厂,然后用它把DESKeySpec对象转换成一个SecretKey对象
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey key = keyFactory.generateSecret(dks);
// Cipher对象实际完成解密操作
Cipher cipher = Cipher.getInstance("DES");
// 用密匙初始化Cipher对象
cipher.init(Cipher.DECRYPT_MODE, key);
// 正式执行解密操作
byte decryptedData[] = cipher.doFinal(encryptedData);
return new String(decryptedData, "utf-8");
}
public String getCurrentMillyTime() {
return Long.valueOf(System.currentTimeMillis()).toString();
}
public static String md5(String content) {
return DigestUtils.md5Hex(content);
}
public static String sha(String content) {
return DigestUtils.shaHex(content);
}
public static String base64Encode(String content, String charset) {
byte[] bytes = null;
try {
bytes = Base64.encodeBase64(content.getBytes(charset), true);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return new String(bytes);
}
public static String base64Decode(String content, String charset) {
byte[] bytes = null;
try {
bytes = Base64.decodeBase64(content.getBytes(charset));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return new String(bytes);
}
}
server:
port: 9600
context-path: /authcenter
spring:
application:
name: eden-authcenter-agent
mvc:
static-path-pattern: /static/**
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
mode: LEGACYHTML5
encoding: UTF-8
enabled: true
content-type: text/html
jackson:
property-naming-strategy: CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES
default-property-inclusion: non_null
serialization: true
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
http:
multipart:
max-file-size: 200MB
max-request-size: 300MB
oauth:
items:
dianjiaoguan: #电教馆
#oauthUrl: https://castest.edu.sh.cn/CAS
oauthUrl: https://cas2.edu.sh.cn/CAS
clientId: clientid
clientSecret: clientSecret
loginSuccessUrl: https://ds.etextbook.cn/authcenter/auth/loginsuccess
logoutSuccessUrl: https://ds.etextbook.cn/authcenter/auth/logoutsuccess
edenoperation: #运营中心
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl: https://operator-api.sh-genius.cn/cas/
clientId: testClentId
clientSecret: testClientSecret
loginSuccessUrl: https://ds.etextbook.cn/authcenter/auth/loginsuccess
logoutSuccessUrl: https://ds.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient:
clients:
- clientName: 金山阅读
clientId: jsydClentId
clientSecret: jsydClientSecret
- clientName: 接入样例
clientId: testClentId2
clientSecret: testClientSecret2
{
"mongo": [
{
"connectionName": "mongo",
"host": "dds-uf6124f9044c34741.mongodb.rds.aliyuncs.com",
"port": 3717,
"replicaSet": "dds-uf6124f9044c34741.mongodb.rds.aliyuncs.com:3717",
"maxConnectionsPerHost": 3000,
"threadsAllowedToBlockForConnectionMultiplier": 10,
"authentication": true,
"connectTimeout": 10000,
"password": "ChineseAll&0219",
"userName": "spuser",
"dbName": "splog"
}
],
"mongotest": [
{
"connectionName": "mongo",
"host": "localhost",
"port": 27017,
"replicaSet": "localhost:27017",
"maxConnectionsPerHost": 3000,
"threadsAllowedToBlockForConnectionMultiplier": 10,
"authentication": false,
"connectTimeout": 10000,
"password": "123456",
"userName": "root",
"dbName": "dslog"
}
]
}
\ No newline at end of file
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big,
cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl,
dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, thead, tr, th, td, header {
margin: 0;
padding: 0;
border: 0;
}
ul li{ list-style:none;}
a{ text-decoration:none; outline:none;}
h1, h2, h3, h4 {
font-weight:normal;
}
html{
font-size:14px;
font-family:"Microsoft Yahei","微软雅黑"; color:#323232;
}
ul li{ list-style:none; margin: 0; padding: 0; border: 0;}
a{ text-decoration:none; -webkit-tap-highlight-color: transparent; }
.fl{ float:left; display:inline;}
.fr{ float:right; display:inline;}
.none{ display:none;}
.clearfix{overflow:hidden;_zoom:1;}
.clear{ clear:both;}
::-webkit-input-placeholder { /* WebKit browsers */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
.top{ width:100%; height:115px; border-top:solid 5px #87abe0;}
.main{ width:1070px; height:auto; margin-left:auto; margin-right:auto;}
.bottom{ width:100%; height:239px; background:#fff url(../images/Login-b.jpg) no-repeat top center; }
.pbottom{ position:absolute; bottom:0px;}
.bottom > p{ color:#aab9c5; font-size:12px; line-height:75px; text-align:center; }
.login-c{ width:100%; height:603px; background:url(../images/login-bg.jpg) no-repeat center center;}
.login-list{ padding-top:95px; padding-left:62px; }
ul.login-list-ul{ width:442px; height:285px; padding-left:30px; padding-top:25px; background:url(../images/login-list-bg.png) no-repeat top left;}
ul.login-list-ul > li > a{ padding-left:26px; width:416px; display:block; height:35px; line-height:35px; background:url(../images/li-icon.png) no-repeat left center; color:#313131; font-size:14px; }
ul.login-list-ul > li > a:hover{ text-decoration:underline;}
.login-form{ background-color:#fbfbfb; border-radius:3px; box-shadow:0px 0px 3px rgba(0,0,0,.15); width:270px; margin-top:90px;}
.login-form-h2{ border-bottom:solid 1px #f2f2f2; text-align:center; color:#565656; font-size:16px; line-height:55px; }
.login-form-tip{ background:url(../images/tip-tline.jpg) repeat-x top left; padding-top:16px; padding-bottom:20px; width:260px; margin-left:auto; margin-right:auto; }
.login-form-tip > p{ color:#9b9b9b; font-size:12px; -webkit-transform:scale(0.95,0.95) ; *font-size:11px; line-height:1.8em;}
.login-form-tip > p > a{ color:#5c5c5b; text-decoration:underline;}
.login-jump{height:110px; padding-top:50px; padding-bottom:50px;}
dl.jump-select-dl{ width:213px; height:38px; border:solid 1px #c1c1c1; margin-left:auto; margin-right:auto;}
dl.jump-select-dl dt{ width:37px; height:28px; padding-top:5px; padding-bottom:5px; float:left; display:inline; background:url(../images/user.png) no-repeat center center;}
dl.jump-select-dl > dt >span{ display:block; width:36px; height:28px; border-right:solid 1px #c1c1c1;}
dl.jump-select-dl dd{ width:176px; height:38px; float:right; display:inline;}
select.jump-select {
width: 176px;
padding-left:15px;
padding-right:30px;
font-family:"Microsoft Yahei","微软雅黑";
font-size:14px;
color: #c1c1c1;
height:38px;
-moz-appearance:none;
appearance: none;
-webkit-appearance: none;
outline:none;
border:none;
background:url(../images/select-arrow.png) no-repeat center right;
/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
order: solid 1px #000;
}
.login-jump-btn{ width:215px; height:37px; margin-top:30px; margin-left:auto; margin-right:auto; }
select::-ms-expand { display: none; }
a.jump-btn{ width:135px; height:37px; display:block; background:url(../images/login-jump-btn1.jpg) no-repeat left center;}
a.help-btn{ width:65px; height:37px; display:block; background:url(../images/help-btn.jpg) no-repeat left center;}
.login-eduroam{ padding-top:65px; height:465px;}
.login-eduroam-form{ width:462px; height:465px; margin-left:auto; margin-right:auto; background-color:#fdfcfc; border-radius:3px; box-shadow:0px 0px 3px rgba(0,0,0,.15); }
.login-eduroam-form > h2{ color:#565656; font-size:18px; padding-top:12px; line-height:2em; text-align:center;}
.login-eduroam-form > h3{ width:100%; background:url(../images/line2.jpg) repeat-x left center; height:20px; text-align:center; }
.login-eduroam-form > h3 > span{color:#85b4ed; font-family:Arial; font-size:12px; -webkit-transform:scale(0.95,0.95) ; *font-size:11px; line-height:1.8em; text-transform:uppercase; background-color:#fcfcfc; display:inline-block; padding-left:10px; padding-right:10px;}
.login-eduroam-tip{background: url(../images/tip-tline.jpg) repeat-x top left; padding-top:15px; padding-bottom:15px; text-align:center;}
ul.eduroam-ul{ margin-left:60px; width:315px;}
ul.eduroam-ul > li > a{ width:300px; padding-left:15px; display:block; text-align:left; background:url(../images/eduroam-li.png) no-repeat left center; color:#959595; font-size:12px; line-height:20px;}
ul.eduroam-ul > li > a > span{ color:#729dd1; font-family:Arial; font-size:12px; -webkit-transform:scale(0.95,0.95) ; *font-size:11px; text-transform:uppercase; display:inline-block; padding-left:5px;}
.login-eduroam-line{ width:346px; height:auto; margin-left:auto; margin-right:auto; margin-top:10px;}
a.login-btn{ width:346px; height:44px; margin-bottom:25px; margin-top:35px; display:block; background:url(../images/login-btn.png) no-repeat top center; }
dl.login-eduroam-txt{ border:solid 1px #c1c1c1; height:38px; width:344px; margin-top:25px;}
dl.login-eduroam-txt dt{ width:37px; height:38px; float:left; display:inline;}
dl.login-eduroam-txt dd{ width:305px; height:28px; padding-top:5px; padding-bottom:5px; float:right; display:inline;}
dl.login-eduroam-txt-user dt{ background:url(../images/user.png) no-repeat center center;}
dl.login-eduroam-txt-password dt{ background:url(../images/password.png) no-repeat center center;}
.login-eduroam-input{ border-left:solid 1px #c1c1c1; width:284px; height:28px; padding:0px 10px; margin:0px; border-bottom:0px; border-right:0px; border-top:0px; outline:none; font-size:14px; line-height:28px; color:#565656;}
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title></title>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<span th:text="${message}"></span>
</body></html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>上海数字教材运营管理中心</title>
<link rel="stylesheet" th:href="@{/static/css/main_0216.css}"/>
<link rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{/static/css/normalize.css}"/>
<script type="text/javascript" th:src="@{/static/js/jquery-1.10.2.min.js}"></script>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a
href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div class="bg">
<div class="bg-form">
<div class="loginContainer">
<!--<h1>上海数字教材运营管理中心</h1>-->
<div class="login-box">
<!-- <div class="bg-form" style="width: 80%;margin: 0 auto"></div> -->
<button onclick="toLogin(1)" accesskey="l" class="login-btn" id="login-button" name="button" style="outline:0;" type="button">登录
</button>
<div class="login-span"><span>如果您曾经参与上海市中小学数字教材试验项目,</span><span><a style="color:red;"onclick="toLogin(2)">请点击此处使用数字教材账号登录>></a></span></div> <!-- </div> -->
</div>
</div>
</div>
</div>
<script th:inline="javascript">
/*<![CDATA[*/
var loginUrl1 = [[${loginUrl1}]];
var loginUrl2 = [[${loginUrl2}]];
var logId = [[${logId}]];
var ctxPath = /*[[@{/}]]*/ '';
/*]]>*/
</script>
<script type="text/javascript">
function toLogin (num) {
var baseUrl = ctxPath + "auth/tologin?logId="+logId+"&oauthType=";
//var baseUrl = ctxPath + "auth/tologin?oauthType=";
if (num === 1) {
window.location.href = baseUrl+ "dianjiaoguan&loginUrl=" + encodeURIComponent(loginUrl1);
} else if (num === 2) {
window.location.href = baseUrl+ "edenoperation&loginUrl=" + encodeURIComponent(loginUrl2);
}
return false;
}
</script>
</body></html>
\ No newline at end of file
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>上海数字教材运营管理中心</title>
<script type="text/javascript" th:src="@{/static/js/jquery.js}"></script>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<form th:action="${successPostUrl}" method="post" th:object="${clientDataInfo}">
<input type="hidden" th:value="${clientDataInfo.authUserInfo.id}" name="authUserInfo.id"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.loginName}" name="authUserInfo.loginName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.realName}" name="authUserInfo.realName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.userType}" name="authUserInfo.userType"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.source}" name="authUserInfo.source"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentId}" name="authUserInfo.studentId"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentCode}" name="authUserInfo.studentCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentStage}" name="authUserInfo.studentStage"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentGrade}" name="authUserInfo.studentGrade"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentClass}" name="authUserInfo.studentClass"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentStageName}" name="authUserInfo.studentStageName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentGradeName}" name="authUserInfo.studentGradeName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentClassName}" name="authUserInfo.studentClassName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentSchoolId}" name="authUserInfo.studentSchoolId"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentCodeStatus}" name="authUserInfo.studentCodeStatus"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentSchoolCode}" name="authUserInfo.studentSchoolCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentSchoolName}" name="authUserInfo.studentSchoolName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentRegionCode}" name="authUserInfo.studentRegionCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentRegionName}" name="authUserInfo.studentRegionName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherTrainingNo}" name="authUserInfo.teacherTrainingNo"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherTrainingUserName}" name="authUserInfo.teacherTrainingUserName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherRegionCode}" name="authUserInfo.teacherRegionCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherCampusCode}" name="authUserInfo.teacherCampusCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherTrainingSchoolType}" name="authUserInfo.teacherTrainingSchoolType"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherStage}" name="authUserInfo.teacherStage"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherGrade}" name="authUserInfo.teacherGrade"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherSubject}" name="authUserInfo.teacherSubject"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherSchoolId}" name="authUserInfo.teacherSchoolId"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherSchoolName}" name="authUserInfo.teacherSchoolName"/>
<input type="hidden" th:value="${clientDataInfo.returnUrl}" name="returnUrl"/>
<input type="hidden" th:value="${clientDataInfo.oauthType}" name="oauthType"/>
</form>
<script type="text/javascript">
$(function(){
$("form").submit();
})
</script>
</body></html>
\ No newline at end of file
server:
port: 9600
context-path: /authcenter
spring:
application:
name: eden-authcenter-agent
mvc:
static-path-pattern: /static/**
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
mode: LEGACYHTML5
encoding: UTF-8
enabled: true
content-type: text/html
jackson:
property-naming-strategy: CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES
default-property-inclusion: non_null
serialization: true
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
http:
multipart:
max-file-size: 200MB
max-request-size: 300MB
oauth:
items:
dianjiaoguan: #电教馆
#oauthUrl: https://castest.edu.sh.cn/CAS
oauthUrl: https://cas2.edu.sh.cn/CAS
clientId: clientid
clientSecret: clientSecret
loginSuccessUrl: https://ds.etextbook.cn/authcenter/auth/loginsuccess
logoutSuccessUrl: https://ds.etextbook.cn/authcenter/auth/logoutsuccess
edenoperation: #运营中心
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl: https://operator-api.sh-genius.cn/cas/
clientId: testClentId
clientSecret: testClientSecret
loginSuccessUrl: https://ds.etextbook.cn/authcenter/auth/loginsuccess
logoutSuccessUrl: https://ds.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient:
clients:
- clientName: 金山阅读
clientId: jsydClentId
clientSecret: jsydClientSecret
- clientName: 接入样例
clientId: testClentId2
clientSecret: testClientSecret2
{
"mongo": [
{
"connectionName": "mongo",
"host": "dds-uf6124f9044c34741.mongodb.rds.aliyuncs.com",
"port": 3717,
"replicaSet": "dds-uf6124f9044c34741.mongodb.rds.aliyuncs.com:3717",
"maxConnectionsPerHost": 3000,
"threadsAllowedToBlockForConnectionMultiplier": 10,
"authentication": true,
"connectTimeout": 10000,
"password": "ChineseAll&0219",
"userName": "spuser",
"dbName": "splog"
}
],
"mongotest": [
{
"connectionName": "mongo",
"host": "localhost",
"port": 27017,
"replicaSet": "localhost:27017",
"maxConnectionsPerHost": 3000,
"threadsAllowedToBlockForConnectionMultiplier": 10,
"authentication": false,
"connectTimeout": 10000,
"password": "123456",
"userName": "root",
"dbName": "dslog"
}
]
}
\ No newline at end of file
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big,
cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl,
dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, thead, tr, th, td, header {
margin: 0;
padding: 0;
border: 0;
}
ul li{ list-style:none;}
a{ text-decoration:none; outline:none;}
h1, h2, h3, h4 {
font-weight:normal;
}
html{
font-size:14px;
font-family:"Microsoft Yahei","微软雅黑"; color:#323232;
}
ul li{ list-style:none; margin: 0; padding: 0; border: 0;}
a{ text-decoration:none; -webkit-tap-highlight-color: transparent; }
.fl{ float:left; display:inline;}
.fr{ float:right; display:inline;}
.none{ display:none;}
.clearfix{overflow:hidden;_zoom:1;}
.clear{ clear:both;}
::-webkit-input-placeholder { /* WebKit browsers */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
font-size:14px;
color:#c1c1c1;
font-family:"Microsoft Yahei","微软雅黑";
}
.top{ width:100%; height:115px; border-top:solid 5px #87abe0;}
.main{ width:1070px; height:auto; margin-left:auto; margin-right:auto;}
.bottom{ width:100%; height:239px; background:#fff url(../images/Login-b.jpg) no-repeat top center; }
.pbottom{ position:absolute; bottom:0px;}
.bottom > p{ color:#aab9c5; font-size:12px; line-height:75px; text-align:center; }
.login-c{ width:100%; height:603px; background:url(../images/login-bg.jpg) no-repeat center center;}
.login-list{ padding-top:95px; padding-left:62px; }
ul.login-list-ul{ width:442px; height:285px; padding-left:30px; padding-top:25px; background:url(../images/login-list-bg.png) no-repeat top left;}
ul.login-list-ul > li > a{ padding-left:26px; width:416px; display:block; height:35px; line-height:35px; background:url(../images/li-icon.png) no-repeat left center; color:#313131; font-size:14px; }
ul.login-list-ul > li > a:hover{ text-decoration:underline;}
.login-form{ background-color:#fbfbfb; border-radius:3px; box-shadow:0px 0px 3px rgba(0,0,0,.15); width:270px; margin-top:90px;}
.login-form-h2{ border-bottom:solid 1px #f2f2f2; text-align:center; color:#565656; font-size:16px; line-height:55px; }
.login-form-tip{ background:url(../images/tip-tline.jpg) repeat-x top left; padding-top:16px; padding-bottom:20px; width:260px; margin-left:auto; margin-right:auto; }
.login-form-tip > p{ color:#9b9b9b; font-size:12px; -webkit-transform:scale(0.95,0.95) ; *font-size:11px; line-height:1.8em;}
.login-form-tip > p > a{ color:#5c5c5b; text-decoration:underline;}
.login-jump{height:110px; padding-top:50px; padding-bottom:50px;}
dl.jump-select-dl{ width:213px; height:38px; border:solid 1px #c1c1c1; margin-left:auto; margin-right:auto;}
dl.jump-select-dl dt{ width:37px; height:28px; padding-top:5px; padding-bottom:5px; float:left; display:inline; background:url(../images/user.png) no-repeat center center;}
dl.jump-select-dl > dt >span{ display:block; width:36px; height:28px; border-right:solid 1px #c1c1c1;}
dl.jump-select-dl dd{ width:176px; height:38px; float:right; display:inline;}
select.jump-select {
width: 176px;
padding-left:15px;
padding-right:30px;
font-family:"Microsoft Yahei","微软雅黑";
font-size:14px;
color: #c1c1c1;
height:38px;
-moz-appearance:none;
appearance: none;
-webkit-appearance: none;
outline:none;
border:none;
background:url(../images/select-arrow.png) no-repeat center right;
/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
order: solid 1px #000;
}
.login-jump-btn{ width:215px; height:37px; margin-top:30px; margin-left:auto; margin-right:auto; }
select::-ms-expand { display: none; }
a.jump-btn{ width:135px; height:37px; display:block; background:url(../images/login-jump-btn1.jpg) no-repeat left center;}
a.help-btn{ width:65px; height:37px; display:block; background:url(../images/help-btn.jpg) no-repeat left center;}
.login-eduroam{ padding-top:65px; height:465px;}
.login-eduroam-form{ width:462px; height:465px; margin-left:auto; margin-right:auto; background-color:#fdfcfc; border-radius:3px; box-shadow:0px 0px 3px rgba(0,0,0,.15); }
.login-eduroam-form > h2{ color:#565656; font-size:18px; padding-top:12px; line-height:2em; text-align:center;}
.login-eduroam-form > h3{ width:100%; background:url(../images/line2.jpg) repeat-x left center; height:20px; text-align:center; }
.login-eduroam-form > h3 > span{color:#85b4ed; font-family:Arial; font-size:12px; -webkit-transform:scale(0.95,0.95) ; *font-size:11px; line-height:1.8em; text-transform:uppercase; background-color:#fcfcfc; display:inline-block; padding-left:10px; padding-right:10px;}
.login-eduroam-tip{background: url(../images/tip-tline.jpg) repeat-x top left; padding-top:15px; padding-bottom:15px; text-align:center;}
ul.eduroam-ul{ margin-left:60px; width:315px;}
ul.eduroam-ul > li > a{ width:300px; padding-left:15px; display:block; text-align:left; background:url(../images/eduroam-li.png) no-repeat left center; color:#959595; font-size:12px; line-height:20px;}
ul.eduroam-ul > li > a > span{ color:#729dd1; font-family:Arial; font-size:12px; -webkit-transform:scale(0.95,0.95) ; *font-size:11px; text-transform:uppercase; display:inline-block; padding-left:5px;}
.login-eduroam-line{ width:346px; height:auto; margin-left:auto; margin-right:auto; margin-top:10px;}
a.login-btn{ width:346px; height:44px; margin-bottom:25px; margin-top:35px; display:block; background:url(../images/login-btn.png) no-repeat top center; }
dl.login-eduroam-txt{ border:solid 1px #c1c1c1; height:38px; width:344px; margin-top:25px;}
dl.login-eduroam-txt dt{ width:37px; height:38px; float:left; display:inline;}
dl.login-eduroam-txt dd{ width:305px; height:28px; padding-top:5px; padding-bottom:5px; float:right; display:inline;}
dl.login-eduroam-txt-user dt{ background:url(../images/user.png) no-repeat center center;}
dl.login-eduroam-txt-password dt{ background:url(../images/password.png) no-repeat center center;}
.login-eduroam-input{ border-left:solid 1px #c1c1c1; width:284px; height:28px; padding:0px 10px; margin:0px; border-bottom:0px; border-right:0px; border-top:0px; outline:none; font-size:14px; line-height:28px; color:#565656;}
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title></title>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<span th:text="${message}"></span>
</body></html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>上海数字教材运营管理中心</title>
<link rel="stylesheet" th:href="@{/static/css/main_0216.css}"/>
<link rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{/static/css/normalize.css}"/>
<script type="text/javascript" th:src="@{/static/js/jquery-1.10.2.min.js}"></script>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a
href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div class="bg">
<div class="bg-form">
<div class="loginContainer">
<!--<h1>上海数字教材运营管理中心</h1>-->
<div class="login-box">
<!-- <div class="bg-form" style="width: 80%;margin: 0 auto"></div> -->
<button onclick="toLogin(1)" accesskey="l" class="login-btn" id="login-button" name="button" style="outline:0;" type="button">登录
</button>
<div class="login-span"><span>如果您曾经参与上海市中小学数字教材试验项目,</span><span><a style="color:red;"onclick="toLogin(2)">请点击此处使用数字教材账号登录>></a></span></div> <!-- </div> -->
</div>
</div>
</div>
</div>
<script th:inline="javascript">
/*<![CDATA[*/
var loginUrl1 = [[${loginUrl1}]];
var loginUrl2 = [[${loginUrl2}]];
var logId = [[${logId}]];
var ctxPath = /*[[@{/}]]*/ '';
/*]]>*/
</script>
<script type="text/javascript">
function toLogin (num) {
var baseUrl = ctxPath + "auth/tologin?logId="+logId+"&oauthType=";
//var baseUrl = ctxPath + "auth/tologin?oauthType=";
if (num === 1) {
window.location.href = baseUrl+ "dianjiaoguan&loginUrl=" + encodeURIComponent(loginUrl1);
} else if (num === 2) {
window.location.href = baseUrl+ "edenoperation&loginUrl=" + encodeURIComponent(loginUrl2);
}
return false;
}
</script>
</body></html>
\ No newline at end of file
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<title>上海数字教材运营管理中心</title>
<script type="text/javascript" th:src="@{/static/js/jquery.js}"></script>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<form th:action="${successPostUrl}" method="post" th:object="${clientDataInfo}">
<input type="hidden" th:value="${clientDataInfo.authUserInfo.id}" name="authUserInfo.id"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.loginName}" name="authUserInfo.loginName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.realName}" name="authUserInfo.realName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.userType}" name="authUserInfo.userType"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.source}" name="authUserInfo.source"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentId}" name="authUserInfo.studentId"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentCode}" name="authUserInfo.studentCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentStage}" name="authUserInfo.studentStage"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentGrade}" name="authUserInfo.studentGrade"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentClass}" name="authUserInfo.studentClass"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentStageName}" name="authUserInfo.studentStageName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentGradeName}" name="authUserInfo.studentGradeName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentClassName}" name="authUserInfo.studentClassName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentSchoolId}" name="authUserInfo.studentSchoolId"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentCodeStatus}" name="authUserInfo.studentCodeStatus"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentSchoolCode}" name="authUserInfo.studentSchoolCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentSchoolName}" name="authUserInfo.studentSchoolName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentRegionCode}" name="authUserInfo.studentRegionCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.studentRegionName}" name="authUserInfo.studentRegionName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherTrainingNo}" name="authUserInfo.teacherTrainingNo"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherTrainingUserName}" name="authUserInfo.teacherTrainingUserName"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherRegionCode}" name="authUserInfo.teacherRegionCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherCampusCode}" name="authUserInfo.teacherCampusCode"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherTrainingSchoolType}" name="authUserInfo.teacherTrainingSchoolType"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherStage}" name="authUserInfo.teacherStage"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherGrade}" name="authUserInfo.teacherGrade"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherSubject}" name="authUserInfo.teacherSubject"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherSchoolId}" name="authUserInfo.teacherSchoolId"/>
<input type="hidden" th:value="${clientDataInfo.authUserInfo.teacherSchoolName}" name="authUserInfo.teacherSchoolName"/>
<input type="hidden" th:value="${clientDataInfo.returnUrl}" name="returnUrl"/>
<input type="hidden" th:value="${clientDataInfo.oauthType}" name="oauthType"/>
</form>
<script type="text/javascript">
$(function(){
$("form").submit();
})
</script>
</body></html>
\ No newline at end of file
#Generated by Apache Maven
#Mon Jul 27 18:29:45 CST 2020
version=1.0-SNAPSHOT
groupId=com.chineseall.authcenter
artifactId=sh-authcenter-agent
com\chineseall\authcenter\agent\utils\CookiesUtil.class
com\chineseall\authcenter\agent\client\ClientUserType.class
com\chineseall\authcenter\agent\utils\EncodeUtil.class
com\chineseall\authcenter\agent\client\OauthClient.class
com\chineseall\authcenter\agent\controller\SampleController.class
com\chineseall\authcenter\agent\EdenAuthcenterAgentApplication.class
com\chineseall\authcenter\agent\client\ClientDataInfo.class
com\chineseall\authcenter\agent\oauth\OauthType.class
com\chineseall\authcenter\agent\controller\AuthController.class
com\chineseall\authcenter\agent\oauth\OauthConfigItem.class
com\chineseall\authcenter\agent\client\ClientItem.class
com\chineseall\authcenter\agent\utils\ConvertMessageMapToBean.class
com\chineseall\authcenter\agent\client\AuthUserInfo.class
com\chineseall\authcenter\agent\oauth\OauthConfig.class
server:
port: 9600
context-path: /authcenter
spring:
application:
name: eden-authcenter-agent
mvc:
static-path-pattern: /static/**
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
mode: LEGACYHTML5
encoding: UTF-8
enabled: true
content-type: text/html
jackson:
property-naming-strategy: CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES
default-property-inclusion: non_null
serialization: true
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
http:
multipart:
max-file-size: 200MB
max-request-size: 300MB
oauth:
items:
dianjiaoguan: #电教馆
#oauthUrl: https://castest.edu.sh.cn/CAS
oauthUrl: https://cas2.edu.sh.cn/CAS
clientId: clientid
clientSecret: clientSecret
loginSuccessUrl: https://ds.etextbook.cn/authcenter/auth/loginsuccess
logoutSuccessUrl: https://ds.etextbook.cn/authcenter/auth/logoutsuccess
edenoperation: #运营中心
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl: https://operator-api.sh-genius.cn/cas/
clientId: testClentId
clientSecret: testClientSecret
loginSuccessUrl: https://ds.etextbook.cn/authcenter/auth/loginsuccess
logoutSuccessUrl: https://ds.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient:
clients:
- clientName: 金山阅读
clientId: jsydClentId
clientSecret: jsydClientSecret
- clientName: 接入样例
clientId: testClentId2
clientSecret: testClientSecret2
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment