Commit f5f1108e by WeiCong

调通e结算第一版

parent df85524c
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</repositories> </repositories>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>GBK</project.build.sourceEncoding>
<maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version> <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
<spring.version>5.1.3.RELEASE</spring.version> <spring.version>5.1.3.RELEASE</spring.version>
<slf4j-api_version>1.7.25</slf4j-api_version> <slf4j-api_version>1.7.25</slf4j-api_version>
......
package cn.com.brilliance.eibs.auth; package cn.com.brilliance.eibs.auth;
import java.sql.Connection;
import java.util.Map;
import org.sss.common.impl.AbstractLoginContext; import org.sss.common.impl.AbstractLoginContext;
import org.sss.common.model.IMenuItem; import org.sss.common.model.IMenuItem;
import java.sql.Connection;
import java.util.Map;
public class EmptyLoginContext extends AbstractLoginContext { public class EmptyLoginContext extends AbstractLoginContext {
private String userId; private String userId;
...@@ -31,12 +31,30 @@ public class EmptyLoginContext extends AbstractLoginContext { ...@@ -31,12 +31,30 @@ public class EmptyLoginContext extends AbstractLoginContext {
} }
@Override @Override
protected String getParameter(Map arg0, String arg1) { protected String getParameter(Map map, String key) {
if (map == null){
return null; return null;
} }
Object o = map.get(key);
if (o == null){
return null;
}
else if (o instanceof String){
return (String) o;
}
else if (o instanceof String[]){
return ((String[]) o)[0];
}
else{
return o.toString();
}
}
@Override @Override
public Object getValue(String arg0) { public Object getValue(String key) {
if ("usrinr".equals(key)){
return userId;
}
return null; return null;
} }
......
...@@ -34,11 +34,6 @@ public class EhcacheCacheEventListener implements CacheEventListener { ...@@ -34,11 +34,6 @@ public class EhcacheCacheEventListener implements CacheEventListener {
@Override @Override
public void notifyElementExpired(Ehcache ehcache, Element element) { public void notifyElementExpired(Ehcache ehcache, Element element) {
System.out.println("销毁" + element.getObjectKey() + ":" + element.getObjectValue());
}
@Override
public void notifyElementEvicted(Ehcache ehcache, Element element) {
//获取过期的key //获取过期的key
String expireKey = String.valueOf(element.getObjectKey()); String expireKey = String.valueOf(element.getObjectKey());
log.debug("expireKey is:" + expireKey); log.debug("expireKey is:" + expireKey);
...@@ -57,6 +52,11 @@ public class EhcacheCacheEventListener implements CacheEventListener { ...@@ -57,6 +52,11 @@ public class EhcacheCacheEventListener implements CacheEventListener {
} }
@Override @Override
public void notifyElementEvicted(Ehcache ehcache, Element element) {
}
@Override
public void notifyRemoveAll(Ehcache ehcache) { public void notifyRemoveAll(Ehcache ehcache) {
} }
......
package org.sss.presentation.noui.common; package org.sss.presentation.noui.common;
import java.nio.charset.Charset;
public class Constants { public class Constants {
public final static String PARAMS = "params"; public final static String PARAMS = "params";
public final static String DATA = "data"; public final static String DATA = "data";
public final static String DISPLAY = "display"; public final static String DISPLAY = "display";
public final static String ENCODING = "UTF-8"; public final static String ENCODING = "UTF-8";
public static final Charset ENCODING_CHARSET = Charset.forName(ENCODING);
public final static String USERNAME = "username"; public final static String USERNAME = "username";
public final static String PASSWORD = "password"; public final static String PASSWORD = "password";
public final static String DNCODE = "dncode"; public final static String DNCODE = "dncode";
......
...@@ -50,7 +50,6 @@ public abstract class AbstractCommonController { ...@@ -50,7 +50,6 @@ public abstract class AbstractCommonController {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public Object event(String mappingUrl, String eventType, Map<String, Object> dataMap, MultipartFile file, HttpServletRequest request, HttpServletResponse response) { public Object event(String mappingUrl, String eventType, Map<String, Object> dataMap, MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
NoUiContext context = null; NoUiContext context = null;
Result ret = null; Result ret = null;
String serverEnc = null; String serverEnc = null;
...@@ -295,12 +294,9 @@ public abstract class AbstractCommonController { ...@@ -295,12 +294,9 @@ public abstract class AbstractCommonController {
// 不能修改 // 不能修改
for (String key : modifyMap.keySet()) { for (String key : modifyMap.keySet()) {
if (!containsKeys.contains(key)) { if (!containsKeys.contains(key)) {
System.out.println("modify test:" + modifyMap.get(key).getClass()); if (key == null){
System.out.println("modify datafield:" + (modifyMap.get(key) instanceof IDatafield));
System.out.println("modify module:" + (modifyMap.get(key) instanceof IModule));
System.out.println("modify moduleList:" + (modifyMap.get(key) instanceof IModuleList));
if (key == null)
continue; continue;
}
Object baseObject = modifyMap.get(key); Object baseObject = modifyMap.get(key);
if( baseObject instanceof IModuleList) if( baseObject instanceof IModuleList)
{ {
......
...@@ -9,6 +9,7 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; ...@@ -9,6 +9,7 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import org.sss.presentation.noui.api.response.ErrorCodes; import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.api.response.NoUiVersion; import org.sss.presentation.noui.api.response.NoUiVersion;
import org.sss.presentation.noui.api.response.Result; import org.sss.presentation.noui.api.response.Result;
import org.sss.presentation.noui.common.Constants;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -43,7 +44,7 @@ public class FileTypeInterceptor extends HandlerInterceptorAdapter { ...@@ -43,7 +44,7 @@ public class FileTypeInterceptor extends HandlerInterceptorAdapter {
if (checkLimitFile(filename)) { if (checkLimitFile(filename)) {
//限制文件类型,请求转发到原始请求页面,并携带错误提示信息 //限制文件类型,请求转发到原始请求页面,并携带错误提示信息
flag = false; flag = false;
response.setContentType("application/json; charset=utf-8"); response.setContentType("application/json; charset="+ Constants.ENCODING);
Result result = new Result(ErrorCodes.ERROR, "不支持的文件类型!", null, noUiVersion.getVersion()); Result result = new Result(ErrorCodes.ERROR, "不支持的文件类型!", null, noUiVersion.getVersion());
PrintWriter out = response.getWriter(); PrintWriter out = response.getWriter();
String json = new Gson().toJson(result); String json = new Gson().toJson(result);
......
...@@ -7,10 +7,9 @@ import cfca.sadk.util.HashUtil; ...@@ -7,10 +7,9 @@ import cfca.sadk.util.HashUtil;
import log.Log; import log.Log;
import log.LogFactory; import log.LogFactory;
import org.sss.common.model.IFilter; import org.sss.common.model.IFilter;
import org.sss.presentation.noui.common.Constants;
import org.sss.util.ContainerUtils; import org.sss.util.ContainerUtils;
import java.nio.charset.StandardCharsets;
/** /**
* 密码过滤器实现(国密) * 密码过滤器实现(国密)
* *
...@@ -32,7 +31,7 @@ public class PasswordSM2Filter ...@@ -32,7 +31,7 @@ public class PasswordSM2Filter
return value; return value;
byte[] encodedPassword = null; byte[] encodedPassword = null;
try { try {
encodedPassword = HashUtil.SM2HashMessageByBCWithoutZValue(value.getBytes(StandardCharsets.UTF_8)); encodedPassword = HashUtil.SM2HashMessageByBCWithoutZValue(value.getBytes(Constants.ENCODING));
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
for (int i = 0; i < encodedPassword.length; i++) { for (int i = 0; i < encodedPassword.length; i++) {
if ((encodedPassword[i] & 0xff) < 0x10) { if ((encodedPassword[i] & 0xff) < 0x10) {
......
...@@ -4,6 +4,7 @@ import log.Log; ...@@ -4,6 +4,7 @@ import log.Log;
import log.LogFactory; import log.LogFactory;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.util.NoUiUtils; import org.sss.presentation.noui.util.NoUiUtils;
import org.sss.presentation.noui.util.ResourceAcccessEncryptUtil; import org.sss.presentation.noui.util.ResourceAcccessEncryptUtil;
import org.sss.presentation.noui.util.StringUtil; import org.sss.presentation.noui.util.StringUtil;
...@@ -14,14 +15,13 @@ import javax.servlet.http.HttpServletResponse; ...@@ -14,14 +15,13 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.charset.StandardCharsets;
public class ResourceAccessFilter implements Filter { public class ResourceAccessFilter implements Filter {
public static final String NO_FOUND_PDF = "/WEB-INF/classes/forbidden.pdf"; public static final String NO_FOUND_PDF = "/WEB-INF/classes/forbidden.pdf";
protected static final Log log = LogFactory.getLog(ResourceAccessFilter.class); protected static final Log log = LogFactory.getLog(ResourceAccessFilter.class);
private static final String _JSON_CONTENT = "application/json; charset=UTF-8"; private static final String _JSON_CONTENT = "application/json; charset="+Constants.ENCODING;
private static final String _HTML_CONTENT = "text/html; charset=UTF-8"; private static final String _HTML_CONTENT = "text/html; charset="+ Constants.ENCODING;
private static final String _403_JSON = "{\"code\": \"403\", \"msg\": \"Access Forbidden, Unauthorized!\"}"; private static final String _403_JSON = "{\"code\": \"403\", \"msg\": \"Access Forbidden, Unauthorized!\"}";
private static final String _403_HTML = "<html><body><div style='text-align:center'><h1 style='margin-top: 10px;'>Access Forbidden, Unauthorized!</h1></div></body></html>"; private static final String _403_HTML = "<html><body><div style='text-align:center'><h1 style='margin-top: 10px;'>Access Forbidden, Unauthorized!</h1></div></body></html>";
private static final String DSPPTH = "/data/dsp/"; private static final String DSPPTH = "/data/dsp/";
...@@ -77,7 +77,7 @@ public class ResourceAccessFilter implements Filter { ...@@ -77,7 +77,7 @@ public class ResourceAccessFilter implements Filter {
File file = new File(sb.toString()); File file = new File(sb.toString());
if (file.exists()) { if (file.exists()) {
response.setContentType(_JSON_CONTENT); response.setContentType(_JSON_CONTENT);
response.getWriter().print(FileUtils.readFileToString(file, StandardCharsets.UTF_8)); response.getWriter().print(FileUtils.readFileToString(file, Constants.ENCODING));
return; return;
} else { } else {
log.warn("Dsp Is Not Exists"); log.warn("Dsp Is Not Exists");
......
...@@ -36,7 +36,7 @@ public class OpenTransInterceptor implements HandlerInterceptor { ...@@ -36,7 +36,7 @@ public class OpenTransInterceptor implements HandlerInterceptor {
// 拦截每个请求 // 拦截每个请求
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding(Constants.ENCODING);
NoUiRequest noUiRequest = new NoUiRequest(request, "", null); NoUiRequest noUiRequest = new NoUiRequest(request, "", null);
String token = noUiRequest.getToken(); String token = noUiRequest.getToken();
String userId = noUiRequest.getUserId(); String userId = noUiRequest.getUserId();
...@@ -79,7 +79,7 @@ public class OpenTransInterceptor implements HandlerInterceptor { ...@@ -79,7 +79,7 @@ public class OpenTransInterceptor implements HandlerInterceptor {
// 请求不通过,返回错误信息给客户端 // 请求不通过,返回错误信息给客户端
private void responseMessage(HttpServletResponse response, PrintWriter out, Result result) { private void responseMessage(HttpServletResponse response, PrintWriter out, Result result) {
response.setContentType("application/json; charset=utf-8"); response.setContentType("application/json; charset="+Constants.ENCODING);
String json = new Gson().toJson(result); String json = new Gson().toJson(result);
out.print(json); out.print(json);
out.flush(); out.flush();
......
...@@ -28,7 +28,7 @@ public class TokenInterceptor implements HandlerInterceptor { ...@@ -28,7 +28,7 @@ public class TokenInterceptor implements HandlerInterceptor {
// 拦截每个请求 // 拦截每个请求
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding(Constants.ENCODING);
NoUiRequest noUiRequest = new NoUiRequest(request, "", null); NoUiRequest noUiRequest = new NoUiRequest(request, "", null);
String token = noUiRequest.getToken(); String token = noUiRequest.getToken();
String userId = noUiRequest.getUserId(); String userId = noUiRequest.getUserId();
...@@ -96,7 +96,7 @@ public class TokenInterceptor implements HandlerInterceptor { ...@@ -96,7 +96,7 @@ public class TokenInterceptor implements HandlerInterceptor {
// 请求不通过,返回错误信息给客户端 // 请求不通过,返回错误信息给客户端
private void responseMessage(HttpServletResponse response, PrintWriter out, Result result) { private void responseMessage(HttpServletResponse response, PrintWriter out, Result result) {
response.setContentType("application/json; charset=utf-8"); response.setContentType("application/json; charset="+Constants.ENCODING);
String json = new Gson().toJson(result); String json = new Gson().toJson(result);
out.print(json); out.print(json);
out.flush(); out.flush();
......
...@@ -4,12 +4,12 @@ package org.sss.presentation.noui.util; ...@@ -4,12 +4,12 @@ package org.sss.presentation.noui.util;
import com.auth0.jwt.internal.org.apache.commons.codec.binary.Hex; import com.auth0.jwt.internal.org.apache.commons.codec.binary.Hex;
import log.Log; import log.Log;
import log.LogFactory; import log.LogFactory;
import org.sss.presentation.noui.common.Constants;
import sun.misc.BASE64Decoder; import sun.misc.BASE64Decoder;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -23,7 +23,7 @@ public class AESUtil { ...@@ -23,7 +23,7 @@ public class AESUtil {
public static String decryptAES(String content, String code) throws Exception { public static String decryptAES(String content, String code) throws Exception {
//int len=content.length()-1; //int len=content.length()-1;
SecretKeySpec skeySpec = new SecretKeySpec(getKey(code).getBytes(StandardCharsets.UTF_8), KEY_ALGORITHM); SecretKeySpec skeySpec = new SecretKeySpec(getKey(code).getBytes(Constants.ENCODING), KEY_ALGORITHM);
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
IvParameterSpec iv = new IvParameterSpec(IV.getBytes()); IvParameterSpec iv = new IvParameterSpec(IV.getBytes());
cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv); cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
...@@ -35,7 +35,7 @@ public class AESUtil { ...@@ -35,7 +35,7 @@ public class AESUtil {
} }
}*/ }*/
byte[] encrypted1 = new BASE64Decoder().decodeBuffer(content);// 先用bAES64解密 byte[] encrypted1 = new BASE64Decoder().decodeBuffer(content);// 先用bAES64解密
return new String(cipher.doFinal(encrypted1), StandardCharsets.UTF_8); return new String(cipher.doFinal(encrypted1), Constants.ENCODING);
} }
public static String getKey(String code) { public static String getKey(String code) {
...@@ -63,10 +63,10 @@ public class AESUtil { ...@@ -63,10 +63,10 @@ public class AESUtil {
} }
try { try {
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
SecretKeySpec keySpec = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8), KEY_ALGORITHM); SecretKeySpec keySpec = new SecretKeySpec(password.getBytes(Constants.ENCODING), KEY_ALGORITHM);
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes(StandardCharsets.UTF_8)); IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes(Constants.ENCODING));
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivParameterSpec); cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivParameterSpec);
byte[] byteContent = content.getBytes(StandardCharsets.UTF_8); byte[] byteContent = content.getBytes(Constants.ENCODING);
byte[] result = cipher.doFinal(byteContent); byte[] result = cipher.doFinal(byteContent);
return Hex.encodeHexString(result); return Hex.encodeHexString(result);
// return Base64.getEncoder().encodeToString(result); // return Base64.getEncoder().encodeToString(result);
...@@ -88,12 +88,12 @@ public class AESUtil { ...@@ -88,12 +88,12 @@ public class AESUtil {
} }
try { try {
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
SecretKeySpec keySpec = new SecretKeySpec(password.getBytes(StandardCharsets.UTF_8), KEY_ALGORITHM); SecretKeySpec keySpec = new SecretKeySpec(password.getBytes(Constants.ENCODING), KEY_ALGORITHM);
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes(StandardCharsets.UTF_8)); IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes(Constants.ENCODING));
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivParameterSpec); cipher.init(Cipher.DECRYPT_MODE, keySpec, ivParameterSpec);
// byte[] result = cipher.doFinal(Base64.getDecoder().decode(content)); // byte[] result = cipher.doFinal(Base64.getDecoder().decode(content));
byte[] result = cipher.doFinal(Hex.decodeHex(content.toCharArray())); byte[] result = cipher.doFinal(Hex.decodeHex(content.toCharArray()));
return new String(result, StandardCharsets.UTF_8); return new String(result, Constants.ENCODING);
} catch (Exception ex) { } catch (Exception ex) {
log.warn("对数据进行aes加密异常:" + ex.getMessage(), ex); log.warn("对数据进行aes加密异常:" + ex.getMessage(), ex);
} }
......
...@@ -8,8 +8,8 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory; ...@@ -8,8 +8,8 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.sss.presentation.noui.common.Constants;
import java.nio.charset.StandardCharsets;
import java.util.Map; import java.util.Map;
public class HttpClientUtil { public class HttpClientUtil {
...@@ -20,7 +20,7 @@ public class HttpClientUtil { ...@@ -20,7 +20,7 @@ public class HttpClientUtil {
factory.setConnectTimeout(15000); factory.setConnectTimeout(15000);
factory.setReadTimeout(30000); factory.setReadTimeout(30000);
restTemplate = new RestTemplate(factory); restTemplate = new RestTemplate(factory);
restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8)); restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(Constants.ENCODING_CHARSET));
} }
/** /**
......
...@@ -40,7 +40,6 @@ public class NoUiPresentationUtil { ...@@ -40,7 +40,6 @@ public class NoUiPresentationUtil {
IBaseObject baseObject = null; IBaseObject baseObject = null;
try { try {
System.out.println("url=" + url);
baseObject = context.getSession().getBaseObject(context.getRoot(), url); baseObject = context.getSession().getBaseObject(context.getRoot(), url);
if (null == baseObject) { if (null == baseObject) {
throw new NoUiException("not found url :" + url + " ,alias name is:" + aliasKey); throw new NoUiException("not found url :" + url + " ,alias name is:" + aliasKey);
...@@ -84,7 +83,6 @@ public class NoUiPresentationUtil { ...@@ -84,7 +83,6 @@ public class NoUiPresentationUtil {
IBaseObject baseObject = null; IBaseObject baseObject = null;
try { try {
System.out.println("url=" + url);
baseObject = context.getSession().getBaseObject(context.getRoot(), url); baseObject = context.getSession().getBaseObject(context.getRoot(), url);
if (null == baseObject) { if (null == baseObject) {
throw new NoUiException("not found url :" + url + " ,alias name is:" + aliasKey); throw new NoUiException("not found url :" + url + " ,alias name is:" + aliasKey);
......
package org.sss.presentation.noui.util; package org.sss.presentation.noui.util;
import java.io.File; import org.apache.commons.io.IOUtils;
import java.io.FileInputStream; import org.sss.presentation.noui.common.Constants;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import org.apache.commons.io.IOUtils;
/** /**
* Properties文件工具 * Properties文件工具
* *
...@@ -125,7 +120,7 @@ public class PropertyUtil { ...@@ -125,7 +120,7 @@ public class PropertyUtil {
} }
private static Properties load(File f) throws IOException { private static Properties load(File f) throws IOException {
return load(f, "GBK"); return load(f, Constants.ENCODING);
} }
public static Properties load(String name) throws IOException { public static Properties load(String name) throws IOException {
...@@ -152,7 +147,7 @@ public class PropertyUtil { ...@@ -152,7 +147,7 @@ public class PropertyUtil {
} }
public static Properties getProperties(String propertyFile) throws IOException { public static Properties getProperties(String propertyFile) throws IOException {
return getProperties(propertyFile, "GBK"); return getProperties(propertyFile, Constants.ENCODING);
} }
public static Properties getProperties(String propertyFile, String encoding) throws IOException { public static Properties getProperties(String propertyFile, String encoding) throws IOException {
......
package org.sss.presentation.noui.util; package org.sss.presentation.noui.util;
import cfca.sadk.algorithm.sm2.SM3Digest; import cfca.sadk.algorithm.sm2.SM3Digest;
import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.jwt.RedisLoginInfo; import org.sss.presentation.noui.jwt.RedisLoginInfo;
import java.nio.charset.StandardCharsets;
public class ResourceAcccessEncryptUtil { public class ResourceAcccessEncryptUtil {
private static final String KEY = "session.##.WEB"; private static final String KEY = "session.##.WEB";
private static final String SALT = "1314520@Brilliance;"; private static final String SALT = "1314520@Brilliance;";
...@@ -39,7 +38,7 @@ public class ResourceAcccessEncryptUtil { ...@@ -39,7 +38,7 @@ public class ResourceAcccessEncryptUtil {
} }
private static String sm3(String msg) { private static String sm3(String msg) {
byte[] z = msg.getBytes(StandardCharsets.UTF_8); byte[] z = msg.getBytes(Constants.ENCODING_CHARSET);
SM3Digest sm3 = new SM3Digest(); SM3Digest sm3 = new SM3Digest();
sm3.update(z, 0, z.length); sm3.update(z, 0, z.length);
byte[] hash = new byte[32]; byte[] hash = new byte[32];
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<service class="org.sss.presentation.noui.util.NoUiUtils" <service class="org.sss.presentation.noui.util.NoUiUtils"
initMethodName="init" deinitMethodName="deinit"> initMethodName="init" deinitMethodName="deinit">
<property name="datapath" value="D:/"/> <property name="datapath" value="D:/"/>
<property name="fieldencode" value="true" class="boolean"/> <property name="fieldencode" value="false" class="boolean"/>
<property name="connectKeeped" value="true" class="boolean"/> <property name="connectKeeped" value="true" class="boolean"/>
<property name="debugMode" value="false" class="boolean"/> <property name="debugMode" value="false" class="boolean"/>
<!-- WAR包本身的目录为变量$ROOT,WAR/WEB-INF/classes目录为变量$HOME --> <!-- WAR包本身的目录为变量$ROOT,WAR/WEB-INF/classes目录为变量$HOME -->
......
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