From d421c08bece029a7ca21e20a7e3085bd97a58256 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Wed, 3 Jun 2020 11:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eapp=E7=99=BB=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=92=8C=E6=B3=A8=E5=86=8CURL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cm/common/config/TransactionConfig.java | 3 ++- .../java/com/cm/common/filter/AppFilter.java | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cloud-common/src/main/java/com/cm/common/config/TransactionConfig.java b/cloud-common/src/main/java/com/cm/common/config/TransactionConfig.java index 309ee09..bc8d3ba 100644 --- a/cloud-common/src/main/java/com/cm/common/config/TransactionConfig.java +++ b/cloud-common/src/main/java/com/cm/common/config/TransactionConfig.java @@ -44,6 +44,7 @@ public class TransactionConfig { NameMatchTransactionAttributeSource source = new NameMatchTransactionAttributeSource(); source.addTransactionalMethod("add*", required); source.addTransactionalMethod("save*", required); + source.addTransactionalMethod("insert*", required); source.addTransactionalMethod("delete*", required); source.addTransactionalMethod("remove*", required); @@ -54,7 +55,7 @@ public class TransactionConfig { source.addTransactionalMethod("exec*", required); source.addTransactionalMethod("set*", required); - source.addTransactionalMethod("login", required); + source.addTransactionalMethod("login*", required); source.addTransactionalMethod("get*", readOnly); source.addTransactionalMethod("query*", readOnly); diff --git a/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java b/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java index bdfc197..c4a9094 100644 --- a/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java +++ b/cloud-common/src/main/java/com/cm/common/filter/AppFilter.java @@ -11,7 +11,6 @@ import com.cm.common.token.app.entity.AppTokenUser; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.util.AntPathMatcher; @@ -35,9 +34,17 @@ public class AppFilter implements Filter { private static final Logger LOG = LoggerFactory.getLogger(AppFilter.class); private AntPathMatcher antPathMatcher; /** - * APP登录 + * APP登录(用户名密码) */ - private static final String URL_LOGIN = "/**/app/sign/login"; + private static final String URL_LOGIN_DEFAULT = "/**/app/sign/login"; + /** + * APP登录(手机验证码) + */ + private static final String URL_LOGIN_PHONE = "/**/app/sign/loginphone"; + /** + * APP注册 + */ + private static final String URL_REGISTER = "/**/app/register/saveregisteruser"; /** * APP下载 */ @@ -61,7 +68,9 @@ public class AppFilter implements Filter { HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; String requestUri = request.getRequestURI(); - boolean matcher = antPathMatcher.match(URL_LOGIN, requestUri) + boolean matcher = antPathMatcher.match(URL_LOGIN_DEFAULT, requestUri) + || antPathMatcher.match(URL_LOGIN_PHONE, requestUri) + || antPathMatcher.match(URL_REGISTER, requestUri) || antPathMatcher.match(URL_DOWNLOAD_APP, requestUri) || antPathMatcher.match(URL_RELEASE_APP, requestUri) || antPathMatcher.match(URL_RELEASE_APP_ROUTE, requestUri);