Commit 7be6056c authored by Spencer Chang's avatar Spencer Chang

[fix] 参数简单脱敏处理

parent b6776e88
......@@ -9,6 +9,7 @@ import com.hand.hls.dp.service.SysDpExecuteHistoryService;
import com.hand.hls.dp.util.IPUtils;
import leaf.bean.LeafRequestData;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
/**
......@@ -39,7 +41,8 @@ public class SysDpExecuteHistoryController extends BaseController {
IRequest requestContext = createRequestContext(request);
RequestHelper.setCurrentRequest(requestContext);
final String ip = IPUtils.getIpAddress(request);
final String dpContext = (String) requestData.get("parameter");
final String param = (String) requestData.get("parameter");
final String dpContext = URLDecoder.decode(new String(Base64.decodeBase64(param), StandardCharsets.UTF_8),"UTF-8");
if (ck == 0){
service.query4ck(requestContext, ip, dpContext);
}else if(ck == 1){
......
......@@ -8,6 +8,7 @@ import com.hand.hls.dp.service.SysDpDownloadLogService;
import com.hand.hls.dp.service.SysDpExecuteHistoryService;
import com.hand.hls.dp.util.IPUtils;
import leaf.bean.LeafRequestData;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
/**
* @author <a href="mailto:zhangnet14@gmail.com">Spencer Chang</a>
......@@ -35,7 +38,8 @@ public class SysDpExecuteHistoryV2Controller extends BaseController {
IRequest requestContext = createRequestContext(request);
RequestHelper.setCurrentRequest(requestContext);
final String ip = IPUtils.getIpAddress(request);
final String dpContext = (String) requestData.get("parameter");
final String param = (String) requestData.get("parameter");
final String dpContext = URLDecoder.decode(new String(Base64.decodeBase64(param), StandardCharsets.UTF_8),"UTF-8");
return service.execute(requestContext, ip, dpContext);
}
......
......@@ -5,7 +5,8 @@
<script><![CDATA[
function dp001_query() {
$('dp001_query_btn').disable();
let dpContext = document.getElementById('context_tta').value;
let tmp = document.getElementById('context_tta').value;
let dpContext = window.btoa(window.encodeURIComponent(tmp));
Leaf.showConfirm('${l:HLS.PROMPT}', '确认执行当前语句吗?', function okFun() {
Leaf.Masker.mask(Ext.getBody(), '正在执行...');
Leaf.request({
......@@ -52,7 +53,8 @@
function dp001_exec() {
$('dp001_exec_btn').disable();
let dpContext = document.getElementById('context_tta').value;
let tmp = document.getElementById('context_tta').value;
let dpContext = window.btoa(window.encodeURIComponent(tmp));
Leaf.showConfirm('${l:HLS.PROMPT}', '确认执行当前语句吗?', function okFun() {
document.getElementById('result_tta').value = null;
Leaf.Masker.mask(Ext.getBody(), '正在执行...');
......
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