|
@@ -1,6 +1,5 @@
|
|
|
package com.qmth.teachcloud.exchange.common.service.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.boot.tools.signature.SignatureEntity;
|
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
|
import com.qmth.teachcloud.exchange.common.bean.params.OpenParams;
|
|
@@ -20,8 +19,8 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.net.URLDecoder;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.Objects;
|
|
|
-import java.util.Optional;
|
|
|
import java.util.StringJoiner;
|
|
|
|
|
|
/**
|
|
@@ -87,16 +86,16 @@ public class CommonServiceImpl implements CommonService {
|
|
|
StringJoiner stringJoiner = new StringJoiner("")
|
|
|
.add(teachcloudLoginUrl)
|
|
|
.add(SystemConstant.GET_UNKNOWN).add(SystemConstant.HEADER_TIME).add(SystemConstant.GET_EQUAL).add(String.valueOf(timestamp))
|
|
|
- .add(SystemConstant.GET_SYMBOL).add(SystemConstant.SIGNATURE).add(SystemConstant.GET_EQUAL).add(signature)
|
|
|
- .add(SystemConstant.GET_SYMBOL).add(SystemConstant.USER).add(SystemConstant.GET_EQUAL).add(account);
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add(SystemConstant.SIGNATURE).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(signature, SystemConstant.CHARSET_NAME))
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add(SystemConstant.USER).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(account, SystemConstant.CHARSET_NAME));
|
|
|
|
|
|
if (Objects.nonNull(returnUrl) && !Objects.equals(returnUrl, "")) {
|
|
|
- stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.RETURN_URL).add(SystemConstant.GET_EQUAL).add(returnUrl);
|
|
|
+ stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.RETURN_URL).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(returnUrl, SystemConstant.CHARSET_NAME));
|
|
|
}
|
|
|
if (Objects.nonNull(params) && !Objects.equals(params, "")) {
|
|
|
String decodeJson = URLDecoder.decode(params, SystemConstant.CHARSET_NAME);
|
|
|
OpenParams openParams = JacksonUtil.readJson(decodeJson, OpenParams.class);
|
|
|
- stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.PARAMS).add(SystemConstant.GET_EQUAL).add(JacksonUtil.parseJson(openParams));
|
|
|
+ stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.PARAMS).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(JacksonUtil.parseJson(openParams), SystemConstant.CHARSET_NAME));
|
|
|
}
|
|
|
// String redirectUrl = URLEncoder.encode(stringJoiner.toString(), SystemConstant.CHARSET);
|
|
|
// log.info("path:{},timestamp:{},account:{},signature:{},redirectUrl:{},redirectUrl_urlencode:{}", path, timestamp, account, signature, stringJoiner.toString(), redirectUrl);
|