Commit 48a9ce55 authored by zhangc's avatar zhangc

修改重置盐值接口

parent c050d053
......@@ -6,7 +6,7 @@ CREATE TABLE `t_api_interface` (
`api_name` varchar(100) DEFAULT NULL COMMENT 'api名称',
`api_desc` varchar(300) DEFAULT NULL COMMENT 'api描述',
`api_protocl` varchar(32) DEFAULT NULL COMMENT 'api请求协议:http,https',
`api_path` varchar(100) DEFAULT NULL COMMENT '请求地址'
`api_path` varchar(100) DEFAULT NULL COMMENT '请求地址',
`target_url` varchar(100) DEFAULT NULL COMMENT '目标url',
`api_type` varchar(50) NULL DEFAULT '' COMMENT 'api类型:1 数据银行制作API 2 数据银行制作数据包, 3 API实时接入 6 标签查询 9自定义',
`api_function` varchar(200) DEFAULT NULL COMMENT '接口功能',
......@@ -136,7 +136,7 @@ CREATE TABLE `t_api_req_log` (
`trans_mode` varchar(20) DEFAULT NULL COMMENT '传输方式:POST,GET',
`request_token` varchar(64) DEFAULT NULL COMMENT '客户请求token',
`request_time` datetime DEFAULT NULL COMMENT '请求时间',
`remark` varchar(50) DEFAULT NULL COMMENT '状态:SUCCEED 请求成功, FAIL 请求失败',
`status` varchar(50) DEFAULT NULL COMMENT '状态:SUCCEED 请求成功, FAIL 请求失败',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_user` varchar(100) DEFAULT NULL COMMENT '创建人',
......
......@@ -96,11 +96,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--<dependency>
<!-- 校验-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>-->
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
......
......@@ -48,8 +48,6 @@ public enum GatewayResultCode implements ResultCode {
/** 无效路由类型 */
ILLEGAL_ROUTE_TYPE("ILLEGAL_ROUTE_TYPE", "无效路由类型"),
/** ip不允许访问 */
IP_NOT_ALLOW_ACCESS("IP_NOT_ALLOW_ACCESS", "ip不允许访问"),
/** 提交数据过大 */
POST_DATA_TOO_LARGE("POST_DATA_TOO_LARGE", "提交数据过大"),
......
package com.jz.dm.common.exception;
import com.jz.dm.common.util.ResultCode;
/**
* 签名异常
*
*/
public class SignatureException extends OpenApiException {
private static final long serialVersionUID = 6551962245794846748L;
/**
* 构造函数
*
* @param resultCode
*/
public SignatureException(ResultCode resultCode) {
super(resultCode);
}
/**
* 构造函数
* @param resultCode
* @param detailMessage
*/
public SignatureException(ResultCode resultCode, String detailMessage) {
super(resultCode, detailMessage);
}
/**
* 构造函数
* @param resultCode
* @param cause
*/
public SignatureException(ResultCode resultCode, Throwable cause) {
super(resultCode, cause);
}
/**
* 构造函数
* @param resultCode
* @param detailMessage
* @param cause
*/
public SignatureException(ResultCode resultCode, String detailMessage, Throwable cause) {
super(resultCode, detailMessage, cause);
}
}
......@@ -3,8 +3,11 @@ package com.jz.dm.common.util;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.util.*;
/**
* @author ZC
* @PACKAGE_NAME: com.jz.dm.common.util
......@@ -16,35 +19,59 @@ import java.util.*;
**/
public class MapUtil {
/**
* 对参数进行字典排序
* 获取签名参数
* @param apiKey
* @param method
* @param signType
* @param timestamp
* @return
*/
public static String getSignValue(String apiKey,String method,String signType,String timestamp){
StringBuilder builder = new StringBuilder();
builder.append("apiKey=").append(apiKey).append("&")
.append("method=").append(method).append("&")
.append("signType=").append(signType).append("&")
.append("timestamp=").append(timestamp);
return builder.toString();
}
/**
* 给map集合中的key实现字典排序
* @param map
* @return
*/
public static List directSort(Map map){
List list = new ArrayList();
Iterator iter = map.entrySet().iterator(); //获得map的Iterator
while(iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
public Map<String , Object> MapKeySort(Map<String , Object> map){
ArrayList list = new ArrayList();
for (Map.Entry<String, Object> entry : map.entrySet()) {
list.add(entry.getKey());
//System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue());
}
Collections.sort(list);
return list;
}
HashMap<String , Object> newMap = new HashMap<String , Object>();
//运用Collections的sort()方法对其进行排序 sort()方法需要传 连个参数,一个是需要进行排序的Collection 另一个是一个Comparator
Collections.sort(list, new SpellComparatorUtils());
for (int i = 0; i < list.size(); i++) {
newMap.put(list.get(i).toString() , map.get(list.get(i).toString()));
}
return newMap;
}
/**
* 将对象转成TreeMap,属性名为key,属性值为value
* @param object 对象
*
* @param object 对象
* @return
* @throws IllegalAccessException
*/
public static TreeMap<String, Object> objToMap(Object object) throws IllegalAccessException {
public static TreeMap<String, String> objToMap(Object object) throws IllegalAccessException {
Class clazz = object.getClass();
TreeMap<String, Object> treeMap = new TreeMap<String, Object>();
TreeMap<String, String> treeMap = new TreeMap<String, String>();
while ( null != clazz.getSuperclass() ) {
while (null != clazz.getSuperclass()) {
Field[] declaredFields1 = clazz.getDeclaredFields();
for (Field field : declaredFields1) {
......@@ -63,7 +90,7 @@ public class MapUtil {
if (value instanceof List) {
value = JSON.toJSONString(value);
}
treeMap.put(name, value);
treeMap.put(name, String.valueOf(value));
}
}
......@@ -74,6 +101,7 @@ public class MapUtil {
/**
* 按照指定的分割符将list转换为String
*
* @param list
* @param separator
* @return
......@@ -90,4 +118,53 @@ public class MapUtil {
}
return sb.toString();
}
/**
*   * 把数组所有元素排序,并按照“参数=参数值”的模式用“&”字符拼接成字符串
*   * @param params 需要排序并参与字符拼接的参数组
*   * @return 拼接后字符串
*   * @throws UnsupportedEncodingException
*/
public static String createLinkStringByGet(Map<String, String> params) {
List<String> keys = new ArrayList<String>(params.keySet());
Collections.sort(keys);
String prestr = "";
for (int i = 0; i < keys.size(); i++) {
String key = keys.get(i);
String value = params.get(key);
try {
value = URLEncoder.encode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if (i == keys.size() - 1) {//拼接时,不包括最后一个&字符
prestr = prestr + key + "=" + value;
} else {
prestr = prestr + key + "=" + value + "&";
}
}
return prestr;
}
class SpellComparatorUtils implements Comparator {
@Override
public int compare(Object o1, Object o2) {
try {
// 取得比较对象的汉字编码,并将其转换成字符串
String s1 = new String(o1.toString().getBytes("GB2312"), "ISO-8859-1");
String s2 = new String(o2.toString().getBytes("GB2312"), "ISO-8859-1");
// 运用String类的 compareTo()方法对两对象进行比较
return s1.compareTo(s2);
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
}
public static void main(String[] args) {
Map<String, String> map = new HashMap();
map.put("name", "hello");
map.put("value", "world");
System.out.println(createLinkStringByGet(map));
}
}
......@@ -40,12 +40,12 @@ public class OpenApiRequest {
}
}
public String getAppKey() {
public String getApiKey() {
return apiKey;
}
public void setAppKey(String appKey) {
this.apiKey = appKey;
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@SuppressWarnings("unchecked")
......
......@@ -25,7 +25,7 @@ import java.util.Map;
* @author zc
*/
@RestController
@RequestMapping("api/")
@RequestMapping("api")
@Api(tags = {"api请求controller"})
public class GatewayController {
......
......@@ -9,6 +9,7 @@ import com.jz.dm.common.enums.apiInterface.ApiStatusEnum;
import com.jz.dm.common.enums.org.OrgStatusEnum;
import com.jz.dm.common.exception.GatewayException;
import com.jz.dm.common.util.DateUtil;
import com.jz.dm.common.util.LogUtil;
import com.jz.dm.models.domian.ApiAuth;
import com.jz.dm.models.domian.ApiInterface;
import com.jz.dm.models.domian.ApiOrg;
......@@ -18,6 +19,8 @@ import com.jz.dm.service.ApiInterfaceService;
import com.jz.dm.service.AuthService;
import com.jz.dm.service.OrganizationManageService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -38,6 +41,7 @@ import java.util.Date;
@Component("authFilter")
@Slf4j
public class AuthFilter extends AbstractFilter {
private static final Logger LOGGER = LoggerFactory.getLogger(AuthFilter.class);
@Autowired
private AuthService authService;
......@@ -86,11 +90,21 @@ public class AuthFilter extends AbstractFilter {
}
checkBill(request, authCode, authAuth, apiOrg);
}
chain.doFilter(request, response);
} catch (Exception e) {
if (e instanceof GatewayException){
throw(GatewayException) e;
}
log.error("~~~~~~~~~~~~~~~~认证过滤异常~~~~~~~~~~~~~~~~~");
log.error("异常信息:{}", e.getMessage());
LogUtil.error(LOGGER, e,
"authFilter doFilter error. response=" + response.getResponse());
response.clearAttributes();
response.setCode(GatewayResultCode.UNKNOWN_EXCEPTION.getCode());
response.setMsg(GatewayResultCode.UNKNOWN_EXCEPTION.getMsg());
}
chain.doFilter(request, response);
}
/**
......@@ -127,6 +141,7 @@ public class AuthFilter extends AbstractFilter {
} catch (Exception ex) {
log.error("~~~~~~~~~~~~~~~~~~~~~~过滤计次信息异常~~~~~~~~~~~~~~~~~~~");
log.error("异常信息:{}", ex.getMessage());
throw new GatewayException(GatewayResultCode.REQUEST_LIMIT_EXCEPTION);
}
break;
case "RECORD_TIME_MODE": //按时间调用
......@@ -135,7 +150,7 @@ public class AuthFilter extends AbstractFilter {
Date currentDate = dateFormat.parse(formatDate);
Date validEndTime = authAuth.getValidEndTime();
//如果 date1 在 date2 之前,before 返回 true,否则返回 false
if (currentDate.before(validEndTime)) {//超出时间
if (currentDate.after(validEndTime)) {//超出时间
throw new GatewayException(GatewayResultCode.RATE_LIMIT_EXCEEDED);
}
break;
......
......@@ -8,10 +8,10 @@ import com.jz.dm.common.enums.GatewayResultCode;
import org.springframework.stereotype.Component;
/**
* 时间戳校验过滤器
*
* @author key
*/
* @Description:时间戳校验过滤器
* @Author: Mr.zhang
* @Date: 2021-1-6
*/
@Component
public class CheckTimestampFilter extends AbstractFilter {
......
......@@ -44,17 +44,8 @@ public class InvokeRouteFilter extends AbstractFilter {
//当前系统时间戳
long startTime = System.currentTimeMillis();
try {
//OpenApi openApi = (OpenApi) RequestContext.getCurrentContext().get("openApi");
//if (openApi.getRouteType() == null) {
// throw new GatewayException(GatewayResultCode.ILLEGAL_ROUTE_TYPE);
//}
//if (openApi.getRouteType() != RouteType.SRPING) {
// chain.doFilter(request, response);
// return;
//}
DispatchContext context = new DispatchContext();
context.setAppKey(request.getApiKey());//apiKey
context.setApiKey(request.getApiKey());//apiKey
context.setOpenApiMethod(request.getMethod()); //方法 例如:tradd.add
context.setOpenApiParams(request.getParams());//入参
context.setOpenApiVersion(request.getVersion()); //版本号
......@@ -64,7 +55,6 @@ public class InvokeRouteFilter extends AbstractFilter {
context.setExtAttribute(attribute.name, attribute.value);
}
}
openApiResponse = defaultOpenApiDispatcher.doDispatch(context);
JSONObject jsonObject = (JSONObject) JSON.parse(openApiResponse);
......
......@@ -2,30 +2,30 @@ package com.jz.dm.filter;
import com.alibaba.fastjson.JSONObject;
import com.jz.dm.common.constant.Constants;
import com.jz.dm.common.constant.LoggingConstants;
import com.jz.dm.common.enums.GatewayResultCode;
import com.jz.dm.common.exception.GatewayException;
import com.jz.dm.common.exception.SignatureException;
import com.jz.dm.common.util.LogUtil;
import com.jz.dm.common.util.MapUtil;
import com.jz.dm.common.util.Md5;
import com.jz.dm.models.domian.ApiAuth;
import com.jz.dm.models.enity.GatewayRequest;
import com.jz.dm.models.enity.GatewayResponse;
import com.jz.dm.service.ApiInterfaceService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.TreeMap;
/**
* 验签过滤器(验证签名信息)
*/
@Slf4j
* @Description: 验签过滤器(验证签名信息)
* @Author: Mr.zhang
* @Date: 2021-1-6
*/
@Component
public class VerifySignFilter extends AbstractFilter {
private static final Logger LOGGER = LoggerFactory.getLogger(VerifySignFilter.class);
@Autowired
private ApiInterfaceService apiInterfaceService;
@Override
......@@ -41,36 +41,39 @@ public class VerifySignFilter extends AbstractFilter {
protected void internalDoFilter(GatewayRequest request, GatewayResponse response,
FilterChain chain) {
try {
TreeMap<String, Object> map = MapUtil.objToMap(request);
if (null == map){
log.info("~~~~~~~~~~~~~~~签名数据转换map异常~~~~~~~~~~~~~~~~~~");
throw new GatewayException(GatewayResultCode.UNKNOWN_EXCEPTION);
}
List signParams = MapUtil.directSort(map);
if (CollectionUtils.isNotEmpty(signParams)){
String signParams = MapUtil.getSignValue(request.getApiKey(),request.getMethod(),
request.getSignType(),String.valueOf(request.getTimestamp()));
if (StringUtils.isNotBlank(signParams)){
JSONObject jsonObject = JSONObject.parseObject(request.getParams());
//需要传入授权码
ApiAuth apiAuthInfo = apiInterfaceService.getApiAuthInfo(request.getApiKey(), jsonObject.getString("authCode"));
if (null == apiAuthInfo){
throw new GatewayException(GatewayResultCode.ILLEGAL_REQUEST);
}
String paramStr = MapUtil.listToString(signParams, LoggingConstants.AND_SPILT);
String salt = Md5.encrypt(paramStr, apiAuthInfo.getSalt());
String salt = Md5.encrypt(signParams, apiAuthInfo.getSalt());
if (!request.getSign().equals(salt)){
throw new GatewayException(GatewayResultCode.SIGN_ERROR);
}
}else {
throw new GatewayException(GatewayResultCode.SIGN_ERROR);
}
} catch(Exception e) {
log.error("~~~~~~~~~~~~~~签名过滤异常~~~~~~~~~~~~~~~~~~");
log.error("异常信息:{}",e.getMessage());
chain.doFilter(request, response);
} catch (SignatureException ex) {
LogUtil.error(LOGGER, ex,
"sign response error. response=" + response.getResponse());
response.clearAttributes();
response.setCode(ex.getResultCode().getCode());
response.setMsg(ex.getResultCode().getMsg());
} catch (Throwable ex) {
if(ex instanceof GatewayException){
throw(GatewayException) ex;
}
LogUtil.error(LOGGER, ex,
"signatureFilter doFilter error. response=" + response.getResponse());
response.clearAttributes();
response.setCode(GatewayResultCode.UNKNOWN_EXCEPTION.getCode());
response.setMsg(GatewayResultCode.UNKNOWN_EXCEPTION.getMsg());
}
// 后期再扩展
//OpenApi openApi = new OpenApi();
//openApi.setApplication("JZ_API_GATEWAY");//应用
//openApi.setRouteType(RouteType.SRPING);//漏油类型
//RequestContext.getCurrentContext().set("openApi", openApi);
chain.doFilter(request, response);
}
}
......@@ -68,7 +68,7 @@ public class DefaultOpenApiDispatcher implements OpenApiDispatcher {
try {
OpenApiRequest request = new OpenApiRequest(context.getOpenApiParams());
request.setAppKey(context.getAppKey());
request.setApiKey(context.getApiKey());
request.setExtAttributes(context.getExtAttributes());
openApiService.doService(request, response);
} catch (Throwable ex) {
......
......@@ -20,7 +20,7 @@ public class DispatchContext implements Serializable {
/**
* api唯一标识
*/
private String appKey;
private String apiKey;
/**
* openapi接口
......
......@@ -19,9 +19,9 @@ import java.io.Serializable;
@Data
@ApiModel("盐值重置请求体")
public class SaltResetReq implements Serializable {
@ApiModelProperty(value = "id",required = true)
@NotNull(message = "id不能为空")
private Long id;
@ApiModelProperty(value = "授权码",required = true)
@NotNull(message = "授权码不能为空")
private String authCode;
/*@ApiModelProperty(value = "盐值",required = true)
@NotNull(message = "盐值不能为空")
......
......@@ -263,7 +263,11 @@ public class AuthServiceImpl implements AuthService {
@Override
public Result updateSaltInfo(SaltResetReq req) {
AuthUserResponse response = new AuthUserResponse();
ApiAuth apiAuth = apiAuthMapper.selectById(req.getId());
QueryWrapper<ApiAuth> query = new QueryWrapper<>();
query.eq("auth_code",req.getAuthCode());
query.eq("is_deleted",0);
query.eq("status",GeneralStatusTypeEnum.VALID);
ApiAuth apiAuth = apiAuthMapper.selectOne(query);
if (null == apiAuth) {
return Result.of_error("认证用户不存在");
}
......@@ -272,7 +276,7 @@ public class AuthServiceImpl implements AuthService {
update.set("salt", salt);
update.set("create_date", new Date());
update.set("create_user", "");
update.eq("id", req.getId());
update.eq("id", apiAuth.getId());
if (apiAuthMapper.update(null, update) > 0) {
response.setSalt(salt);
return Result.of_success(ResultMsg.UPDATE_SUCCESS,response);
......
......@@ -60,10 +60,10 @@ public class ApiQueryService implements OpenApiService {
String selectType = parameter.getString("selectType");
String reqParams = parameter.getString("reqParams");
Map paramMap =null;
if (StringUtils.isNotBlank(reqParams)) {
if (null !=reqParams && reqParams.length() > 0) {
paramMap = (Map) JSONObject.parseObject(reqParams);
}
String apiInterface = redisUtils.get(request.getAppKey());
String apiInterface = redisUtils.get(request.getApiKey());
if (StringUtils.isNotBlank(selectType)) {
try {
switch (selectType) {
......@@ -77,7 +77,7 @@ public class ApiQueryService implements OpenApiService {
String targetUrl = jsonBigData.getString("targetUrl");
rangRequestTarget(ApiInfoOutTypeEnum.JSON.name(),targetUrl,paramMap,response);
}else { //缓存中不存在 查询数据库
ApiInterface apiInfo= apiInterfaceService.getApiInfo(request.getAppKey());
ApiInterface apiInfo= apiInterfaceService.getApiInfo(request.getApiKey());
if (apiInfo == null){
throw new GatewayException(GatewayResultCode.REQUEST_INFO_UNEXIST);
}
......@@ -91,7 +91,7 @@ public class ApiQueryService implements OpenApiService {
rangRequestTarget(ApiInfoOutTypeEnum.JSON.name(),targetUrl,null,response);
}else {//redis中不存在,查询数据库
ApiInterface apiReqDto =
apiInterfaceService.getReqTargetInfo(request.getAppKey());
apiInterfaceService.getReqTargetInfo(request.getApiKey());
if (null == apiReqDto) {
throw new GatewayException(GatewayResultCode.REQUEST_INFO_UNEXIST);
}
......@@ -106,7 +106,7 @@ public class ApiQueryService implements OpenApiService {
rangRequestTarget(outputType, targetUrl, paramMap, response);
} else {//不存在查询数据库
ApiInterface apiReqDto =
apiInterfaceService.getReqTargetInfo(request.getAppKey());
apiInterfaceService.getReqTargetInfo(request.getApiKey());
if (null == apiReqDto) {
throw new GatewayException(GatewayResultCode.REQUEST_INFO_UNEXIST);
}
......@@ -121,7 +121,7 @@ public class ApiQueryService implements OpenApiService {
rangRequestTarget(outputType, targetUrl, paramMap, response);
}else {//不存在查询数据库
ApiInterface apiReqDto =
apiInterfaceService.getReqTargetInfo(request.getAppKey());
apiInterfaceService.getReqTargetInfo(request.getApiKey());
if (null == apiReqDto) {
throw new GatewayException(GatewayResultCode.REQUEST_INFO_UNEXIST);
}
......@@ -130,13 +130,14 @@ public class ApiQueryService implements OpenApiService {
}
break;
default:
response.setCode(GatewayResultCode.ILLEGAL_REQUEST.getCode());
response.setMsg(GatewayResultCode.ILLEGAL_REQUEST.getMsg());
break;
throw new GatewayException(GatewayResultCode.ILLEGAL_REQUEST);
}
} catch (Exception ex) {
if (ex instanceof GatewayException){
throw(GatewayException) ex;
}
} catch (Exception e) {
log.error("~~~~~~~~~~~~~~~请求api信息异常~~~~~~~~~~~~~");
log.error("异常信息:{}", e.getMessage());
log.error("异常信息:{}", ex.getMessage());
response.setCode(GatewayResultCode.ILLEGAL_REQUEST.getCode());
response.setMsg(GatewayResultCode.ILLEGAL_REQUEST.getMsg());
}
......@@ -147,8 +148,9 @@ public class ApiQueryService implements OpenApiService {
if (ApiInfoOutTypeEnum.FLOW.name().equals(outputType)) {//文件流形式请求
// httpsUtils.doGetImg()TODO 流形式未实现
} else if (ApiInfoOutTypeEnum.JSON.name().equals(outputType)) {
String respResult = httpsUtils.doGet(targetUrl, param);
response.setAttribute(respResult);
response.setAttribute("调用成功!");
/*String respResult = httpsUtils.doGet(targetUrl, param);
response.setAttribute(respResult);*/
} else {
throw new GatewayException(GatewayResultCode.OUTPUT_TYPE_EXCEPTION);
}
......
......@@ -54,18 +54,14 @@ spring:
public-key: rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
redis:
#database: 0
host: 47.115.53.1
port: 6379
password: 123456
#timeout: 5000
# cluster:
# nodes:
# - 192.168.31.167:6379
# - 192.168.31.167:6380
# - 192.168.31.167:6381
# - 192.168.31.167:6382
# - 192.168.31.167:6383
# - 192.168.31.167:6384
cluster:
nodes:
- 192.168.1.146:6379
- 192.168.1.146:6380
- 192.168.1.146:6381
- 192.168.1.146:6382
- 192.168.1.146:6383
- 192.168.1.146:6384
#使用redis管理session设置为redis,否则none
session:
store-type: none
......
......@@ -24,7 +24,7 @@ public class UrlUtil {
int port = request.getServerPort();
// 访问项目名
String contextPath = request.getContextPath();
String url = "%s://%s%s%s%s";
String url = "%s://%s%s%s";
String portStr = "";
if (port != 80) {
portStr += ":" + port;
......
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