Commit cc8f6c09 by huluobin

update

parent e06d249c
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
</dependency> </dependency>
<!--mp 代码生成工具--> <!--mp 代码生成工具-->SessionHandlerInterceptor
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId> <artifactId>mybatis-plus-generator</artifactId>
......
package com.blt.other.common.annotation;
import java.lang.annotation.*;
/**
* <p>
* 忽略授权校验
* </p>
*
* @author robbendev
* @since 2020/7/23 11:54 上午
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface AuthIgnore {
}
package com.blt.other.common.annotation;
import java.lang.annotation.*;
@Target(value = {ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DictParam {
/**
* 字典编码
*
* @return
*/
String dictCode() default "";
/**
* 字典翻译列
*
* @return
*/
String dictValueParam() default "";
}
package com.blt.other.common.annotation;
import java.lang.annotation.*;
/**
* <p>
* 忽略登陆校验
* </p>
*
* @author robbendev
* @since 2020/7/23 11:43 上午
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface LoginIgnore {
}
...@@ -23,7 +23,8 @@ public class MvcInterceptorConfig extends WebMvcConfigurationSupport { ...@@ -23,7 +23,8 @@ public class MvcInterceptorConfig extends WebMvcConfigurationSupport {
protected void addInterceptors(InterceptorRegistry registry) { protected void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(sessionHandlerInterceptor); registry.addInterceptor(sessionHandlerInterceptor)
.excludePathPatterns();
super.addInterceptors(registry); super.addInterceptors(registry);
......
package com.blt.other.common.interceptor; package com.blt.other.common.interceptor;
import com.bailuntec.common.SpringContextUtil; import com.bailuntec.common.SpringContextUtil;
import com.blt.other.common.annotation.LoginIgnore;
import com.blt.other.common.base.SysUser; import com.blt.other.common.base.SysUser;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.JwtUtil; import com.blt.other.common.util.JwtUtil;
...@@ -9,10 +10,12 @@ import com.google.common.collect.Lists; ...@@ -9,10 +10,12 @@ import com.google.common.collect.Lists;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
@Component @Component
@AllArgsConstructor @AllArgsConstructor
...@@ -22,6 +25,12 @@ public class SessionHandlerInterceptor implements HandlerInterceptor { ...@@ -22,6 +25,12 @@ public class SessionHandlerInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
if (method.isAnnotationPresent(LoginIgnore.class)) {
return true;
}
try { try {
String token = Lists.newArrayList(request.getHeader("Cookie").split(";")) String token = Lists.newArrayList(request.getHeader("Cookie").split(";"))
.stream() .stream()
......
...@@ -6,6 +6,7 @@ import com.bailuntec.cost.api.dto.CostListPrintDto; ...@@ -6,6 +6,7 @@ import com.bailuntec.cost.api.dto.CostListPrintDto;
import com.bailuntec.cost.api.response.CostResult; import com.bailuntec.cost.api.response.CostResult;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.blt.other.common.annotation.LoginIgnore;
import com.blt.other.module.cost.dao.CostDao; import com.blt.other.module.cost.dao.CostDao;
import com.blt.other.module.cost.dto.request.CheckCostListReq; import com.blt.other.module.cost.dto.request.CheckCostListReq;
import com.blt.other.module.cost.dto.response.*; import com.blt.other.module.cost.dto.response.*;
...@@ -310,6 +311,7 @@ public class CostController { ...@@ -310,6 +311,7 @@ public class CostController {
return CostResult.success(); return CostResult.success();
} }
@LoginIgnore
@ApiOperation("财务审核回调") @ApiOperation("财务审核回调")
@PostMapping({"check/ApplyCallbackUrl", "check/lendCashierCallbackUrl"}) @PostMapping({"check/ApplyCallbackUrl", "check/lendCashierCallbackUrl"})
public Map<String, Object> applyCallbackUrl(@RequestBody ApplyCallbackUrlVo applyCallbackUrlVo) { public Map<String, Object> applyCallbackUrl(@RequestBody ApplyCallbackUrlVo applyCallbackUrlVo) {
...@@ -327,6 +329,7 @@ public class CostController { ...@@ -327,6 +329,7 @@ public class CostController {
return result; return result;
} }
@LoginIgnore
@ApiOperation("财务付款回调接口") @ApiOperation("财务付款回调接口")
@PostMapping(value = {"check/CashierCallbackUrl", "check/lend/CashierCallbackUrl"}) @PostMapping(value = {"check/CashierCallbackUrl", "check/lend/CashierCallbackUrl"})
public Map<String, Object> cashierCallbackUrl(@RequestBody CashierCallbackUrlVo cashierCallbackUrlVo) { public Map<String, Object> cashierCallbackUrl(@RequestBody CashierCallbackUrlVo cashierCallbackUrlVo) {
......
...@@ -2,6 +2,7 @@ package com.blt.other.module.purchasing.controller; ...@@ -2,6 +2,7 @@ package com.blt.other.module.purchasing.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.bailuntec.cost.api.domain.BuyDomain; import com.bailuntec.cost.api.domain.BuyDomain;
import com.blt.other.common.annotation.LoginIgnore;
import com.blt.other.common.config.property.CostUrlProperties; import com.blt.other.common.config.property.CostUrlProperties;
import com.blt.other.common.util.AxiosUtil; import com.blt.other.common.util.AxiosUtil;
import com.blt.other.common.util.IpUtil; import com.blt.other.common.util.IpUtil;
...@@ -25,6 +26,7 @@ import com.blt.other.module.purchasing.vo.CashierCallbackUrlVo; ...@@ -25,6 +26,7 @@ import com.blt.other.module.purchasing.vo.CashierCallbackUrlVo;
import com.blt.other.module.sku.service.SysProductService; import com.blt.other.module.sku.service.SysProductService;
import com.blt.other.module.supplier.service.SupplierService; import com.blt.other.module.supplier.service.SupplierService;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.java.Log;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -449,6 +451,7 @@ public class PurchasingListDetailController { ...@@ -449,6 +451,7 @@ public class PurchasingListDetailController {
* @param request * @param request
* @return * @return
*/ */
@LoginIgnore
@PostMapping(value = "ApplyCallbackUrl", consumes = "application/json") @PostMapping(value = "ApplyCallbackUrl", consumes = "application/json")
public String applyCallbackUrl(HttpServletRequest request) { public String applyCallbackUrl(HttpServletRequest request) {
String result = null; String result = null;
...@@ -525,6 +528,7 @@ public class PurchasingListDetailController { ...@@ -525,6 +528,7 @@ public class PurchasingListDetailController {
* @param request * @param request
* @return * @return
*/ */
@LoginIgnore
@PostMapping(value = "CashierCallbackUrl", consumes = "application/json") @PostMapping(value = "CashierCallbackUrl", consumes = "application/json")
public String cashierCallbackUrl(HttpServletRequest request) { public String cashierCallbackUrl(HttpServletRequest request) {
String result = null; String result = null;
......
...@@ -2,8 +2,8 @@ spring: ...@@ -2,8 +2,8 @@ spring:
# 数据源配置 # 数据源配置
datasource: datasource:
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true
url: jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true # url: jdbc:mysql://10.0.8.2:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
username: root username: root
password: "#7kfnymAM$Y9-Ntf" password: "#7kfnymAM$Y9-Ntf"
hikari: hikari:
...@@ -13,7 +13,7 @@ spring: ...@@ -13,7 +13,7 @@ spring:
thymeleaf: thymeleaf:
prefix: classpath:/templates/ prefix: classpath:/templates/
suffix: .html suffix: .htmlcost/list/getAllCost
cache: false cache: false
resources: resources:
static-locations: classpath:/resources/, classpath:/static/ static-locations: classpath:/resources/, classpath:/static/
......
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