Przeglądaj źródła

登录功能开发完成

wuxw7 7 lat temu
rodzic
commit
8e35f181e2

+ 1 - 1
WebService/src/main/java/com/java110/web/controller/CallComponentController.java

@@ -19,7 +19,7 @@ import java.lang.reflect.Method;
 @RestController
 public class CallComponentController extends BaseController {
 
-    private final static Logger logger = LoggerFactory.getLogger(LoginServiceSMOImpl.class);
+    private final static Logger logger = LoggerFactory.getLogger(CallComponentController.class);
 
     /**
      * 调用组件方法

+ 1 - 1
WebService/src/main/java/com/java110/web/smo/impl/LoginServiceSMOImpl.java

@@ -44,7 +44,7 @@ public class LoginServiceSMOImpl extends BaseServiceSMO implements ILoginService
         loginInfo.put("passwd", AuthenticationFactory.passwdMd5(loginInfo.getString("passwd")));
         responseEntity = this.callCenterService(restTemplate,pd,loginInfo.toJSONString(),ServiceConstant.SERVICE_API_URL+"/api/user.service.login",HttpMethod.POST);
         if(responseEntity.getStatusCode() == HttpStatus.OK){
-            pd.setToken(responseEntity.getBody());
+            pd.setToken(JSONObject.parseObject(responseEntity.getBody()).getString("token"));
         }
         return responseEntity;
     }

+ 1 - 1
java110-core/src/main/java/com/java110/core/base/smo/BaseServiceSMO.java

@@ -71,7 +71,7 @@ public class BaseServiceSMO extends AppBase {
         header.add(CommonConstant.HTTP_APP_ID.toLowerCase(), CommonConstant.HC_WEB_APP_ID);
         header.add(CommonConstant.HTTP_USER_ID.toLowerCase(), CommonConstant.ORDER_DEFAULT_USER_ID);
         header.add(CommonConstant.HTTP_TRANSACTION_ID.toLowerCase(), pd.getTransactionId());
-        header.add(CommonConstant.HTTP_REQ_TIME.toLowerCase(), pd.getReqData());
+        header.add(CommonConstant.HTTP_REQ_TIME.toLowerCase(), pd.getRequestTime());
         header.add(CommonConstant.HTTP_SIGN.toLowerCase(), "");
         HttpEntity<String> httpEntity = new HttpEntity<String>(param, header);
         try{

+ 2 - 0
java110-core/src/main/java/com/java110/core/context/IPageData.java

@@ -25,6 +25,8 @@ public interface IPageData {
 
     public String getResponseTime();
 
+    public String getRequestTime();
+
 
     public ResponseEntity getResponseEntity();
 

+ 16 - 0
java110-core/src/test/java/com/java110/core/factory/AuthenticationFactoryTest.java

@@ -0,0 +1,16 @@
+package com.java110.core.factory;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by wuxw on 2019/3/20.
+ */
+public class AuthenticationFactoryTest {
+    @Test
+    public void passwdMd5() throws Exception {
+        System.out.println(AuthenticationFactory.passwdMd5("admin"));
+    }
+
+}

+ 1 - 1
java110-service/src/main/java/com/java110/service/configuration/ServiceConfiguration.java

@@ -14,7 +14,7 @@ public class ServiceConfiguration {
     public FilterRegistrationBean jwtFilter() {
         final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
         registrationBean.setFilter(new JwtFilter());
-        //registrationBean.addUrlPatterns("/");
+        registrationBean.addUrlPatterns("/");
         registrationBean.addUrlPatterns("/console/*");
 
         return registrationBean;