|
@@ -15,12 +15,12 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.web.util.UriUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
-import java.net.URLEncoder;
|
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
import java.util.StringJoiner;
|
|
import java.util.StringJoiner;
|
|
@@ -88,16 +88,16 @@ public class CommonServiceImpl implements CommonService {
|
|
StringJoiner stringJoiner = new StringJoiner("")
|
|
StringJoiner stringJoiner = new StringJoiner("")
|
|
.add(teachcloudLoginUrl)
|
|
.add(teachcloudLoginUrl)
|
|
.add(SystemConstant.GET_UNKNOWN).add(SystemConstant.HEADER_TIME).add(SystemConstant.GET_EQUAL).add(String.valueOf(timestamp))
|
|
.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(URLEncoder.encode(signature, SystemConstant.CHARSET_NAME))
|
|
|
|
- .add(SystemConstant.GET_SYMBOL).add(SystemConstant.USER).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(account, SystemConstant.CHARSET_NAME));
|
|
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add(SystemConstant.SIGNATURE).add(SystemConstant.GET_EQUAL).add(UriUtils.encode(signature, SystemConstant.CHARSET_NAME))
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add(SystemConstant.USER).add(SystemConstant.GET_EQUAL).add(UriUtils.encode(account, SystemConstant.CHARSET_NAME));
|
|
|
|
|
|
if (Objects.nonNull(returnUrl) && !Objects.equals(returnUrl, "")) {
|
|
if (Objects.nonNull(returnUrl) && !Objects.equals(returnUrl, "")) {
|
|
- stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.RETURN_URL).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(returnUrl, SystemConstant.CHARSET_NAME));
|
|
|
|
|
|
+ stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.RETURN_URL).add(SystemConstant.GET_EQUAL).add(UriUtils.encode(returnUrl, SystemConstant.CHARSET_NAME));
|
|
}
|
|
}
|
|
if (Objects.nonNull(params) && !Objects.equals(params, "")) {
|
|
if (Objects.nonNull(params) && !Objects.equals(params, "")) {
|
|
String decodeJson = URLDecoder.decode(params, SystemConstant.CHARSET_NAME);
|
|
String decodeJson = URLDecoder.decode(params, SystemConstant.CHARSET_NAME);
|
|
OpenParams openParams = JacksonUtil.readJson(decodeJson, OpenParams.class);
|
|
OpenParams openParams = JacksonUtil.readJson(decodeJson, OpenParams.class);
|
|
- stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.PARAMS).add(SystemConstant.GET_EQUAL).add(URLEncoder.encode(JacksonUtil.parseJson(openParams), SystemConstant.CHARSET_NAME));
|
|
|
|
|
|
+ stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.PARAMS).add(SystemConstant.GET_EQUAL).add(UriUtils.encode(JacksonUtil.parseJson(openParams), SystemConstant.CHARSET_NAME));
|
|
}
|
|
}
|
|
// String redirectUrl = URLEncoder.encode(stringJoiner.toString(), SystemConstant.CHARSET);
|
|
// String redirectUrl = URLEncoder.encode(stringJoiner.toString(), SystemConstant.CHARSET);
|
|
// log.info("path:{},timestamp:{},account:{},signature:{},redirectUrl:{},redirectUrl_urlencode:{}", path, timestamp, account, signature, stringJoiner.toString(), redirectUrl);
|
|
// log.info("path:{},timestamp:{},account:{},signature:{},redirectUrl:{},redirectUrl_urlencode:{}", path, timestamp, account, signature, stringJoiner.toString(), redirectUrl);
|