Selaa lähdekoodia

加入uspa拦截器token验证

wangchao 4 vuotta sitten
vanhempi
commit
7a19aa2489

+ 7 - 0
location-rescue-service/pom.xml

@ -101,6 +101,13 @@
101 101
                </exclusion>
102 102
            </exclusions>
103 103
        </dependency>
104
       <!-- uspa登录拦截效验-->
105
        <dependency>
106
            <groupId>com.ai.bss</groupId>
107
            <artifactId>sso-util</artifactId>
108
            <version>1.0.0-RELEASE</version>
109
        </dependency>
110
104 111
    </dependencies>
105 112
106 113
    <repositories>

+ 18 - 0
location-rescue-service/src/main/java/com/ai/bss/location/rescue/config/MyCorsFilter.java

@ -1,11 +1,17 @@
1 1
package com.ai.bss.location.rescue.config;
2 2
3
import com.ai.sso.filter.SessionUserFilter;
4
import org.springframework.boot.web.servlet.FilterRegistrationBean;
3 5
import org.springframework.context.annotation.Bean;
4 6
import org.springframework.context.annotation.Configuration;
5 7
import org.springframework.web.cors.CorsConfiguration;
6 8
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7 9
import org.springframework.web.filter.CorsFilter;
8 10
11
import java.util.Arrays;
12
import java.util.HashMap;
13
import java.util.Map;
14
9 15
/**
10 16
 * 解决接口跨域问题
11 17
 *
@ -39,4 +45,16 @@ public class MyCorsFilter {
39 45
        return new CorsFilter(source);
40 46
    }
41 47
48
49
    @Bean
50
    public FilterRegistrationBean mySessionUserFilter(){
51
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
52
        registrationBean.setFilter(new SessionUserFilter());
53
        registrationBean.setUrlPatterns(Arrays.asList("/mySessionUserFilter"));
54
        Map<String, String> initParameters = new HashMap<String,String>();
55
        initParameters.put("impl-classname","com.ai.sso.external.DefaultPopedomImpl");
56
        initParameters.put("ALLOWPATH","gif;jpg;jpeg;png;login;checkLogin;genVerificationCode;logout;");
57
        registrationBean.setInitParameters(initParameters);
58
        return registrationBean;
59
    }
42 60
}

+ 2 - 2
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/WorkEmployeeController.java

@ -91,8 +91,8 @@ public class WorkEmployeeController {
91 91
	 */
92 92
	@ResponseBody
93 93
	@RequestMapping("/deleteWorkEmployee")
94
	public boolean deleteWorkEmployee(@RequestBody EmployeeDto employeeDto) throws Exception {
95
		boolean result = userManageService.deleteWorkEmployee(employeeDto);
94
	public boolean deleteWorkEmployee(@RequestBody List<EmployeeDto> employeeDtoList) throws Exception {
95
		boolean result = userManageService.deleteWorkEmployee(employeeDtoList);
96 96
		return result;
97 97
	}
98 98

+ 10 - 4
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/WorkEmployeeServiceImpl.java

@ -51,15 +51,21 @@ public class WorkEmployeeServiceImpl implements WorkEmployeeService {
51 51
    public boolean createWorkEmployee(EmployeeDto employeeDto) throws Exception {
52 52
        CommonRequest<EmployeeDto> request = CommonRequest.<EmployeeDto>builder().data(employeeDto).build();
53 53
        CommonResponse<Void> response = employeeService.createWorkEmployee(request);
54
        if(response==null){
55
            System.out.println(response);
56
        }
54 57
        boolean success = response.isSuccess();
55 58
        return success;
56 59
    }
57 60
58 61
    @Override
59
    public boolean deleteWorkEmployee(EmployeeDto employeeDto) {
60
        CommonRequest<EmployeeDto> request = CommonRequest.<EmployeeDto>builder().data(employeeDto).build();
61
        CommonResponse<Void> response = employeeService.deleteWorkEmployee(request);
62
        boolean success = response.isSuccess();
62
    public boolean deleteWorkEmployee(List<EmployeeDto> employeeDtoList) {
63
        boolean success = false;
64
        for(EmployeeDto employeeDto:employeeDtoList ){
65
            CommonRequest<EmployeeDto> request = CommonRequest.<EmployeeDto>builder().data(employeeDto).build();
66
            CommonResponse<Void> response = employeeService.deleteWorkEmployee(request);
67
            success = response.isSuccess();
68
        }
63 69
        return success;
64 70
    }
65 71

+ 1 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/interfaces/WorkEmployeeService.java

@ -18,5 +18,5 @@ public interface WorkEmployeeService {
18 18
19 19
	boolean createWorkEmployee(EmployeeDto employeeDto) throws Exception;
20 20
21
	boolean deleteWorkEmployee(EmployeeDto employeeDto);
21
	boolean deleteWorkEmployee(List<EmployeeDto> employeeDtoList);
22 22
}

+ 77 - 0
location-rescue-service/src/main/resources/sso.properties

@ -0,0 +1,77 @@
1
#\u7CFB\u7EDF\u57DF
2
SYSTEM_DOMAIN=LOGIN_CACHE_ROUTE
3
4
#------------------------------cookie\u914D\u7F6E-------------#
5
##COOKIE\u7684\u6709\u6548\u57DF,\u4E0D\u8BBE\u7F6E\uFF0C\u5219\u81EA\u52A8\u8BBE\u7F6E
6
#COOKIE_DOMAIN=crm.chinapost.yw.com
7
8
COOKIE_PATH=/
9
10
##Session \u8D85\u65F6\u65F6\u95F4(\u79D2)
11
SESSION_TIMEOUT=3600
12
COOKIE_MAXAGE=-1
13
14
15
TENANT_REGISTER_CLASS=com.ai.customermanager.services.impl.CustRegisterVercodeImpl
16
17
18
##\u8FDC\u7A0B\u7F13\u5B58\u8C03\u7528\u7C7B\uFF0C\u8FD9\u4E2A\u7C7B\u5FC5\u987B\u6709\u4E09\u4E2A\u51FD\u6570 
19
##    public boolean set(String key,String value)
20
##    public String get(String key)
21
##    public boolean del(String key);
22
COOKIE_CACHE_CLASS=com.ai.sso.util.SessionRedisCache
23
24
LOGGING_INTERFACE_CLASS=com.wframe.baseinfo.util.BaseInfoUtil
25
26
##COOKIE_IS_CACHE \u662F\u5426\u7F13\u5B58\u5230\u8FDC\u7AEF\u3002
27
COOKIE_IS_CACHE=1
28
29
30
##IS_CHECK_LOGIN \u662F\u5426\u68C0\u67E5\u767B\u9646\u3002
31
IS_CHECK_LOGIN=1
32
33
34
LOGIN_SERVICE=uspa_IOrgmodelClientCSV_loginIn
35
LOGINNOPASS_SERVICE=uspa_IOrgmodelClientCSV_loginWithNoPassword
36
37
38
Access-Control-Allow-origin=http://crm.chinapost.yw.com:18080/
39
40
##\u68C0\u67E5SesisonId,sign \u662F\u5426\u6B63\u786E
41
SESSION_CHECK_SIGN=com.ai.sso.util.SessionCheckSign
42
SESSION_CHECK_LOGIN=com.ai.sso.util.SessionCheckLogin
43
#redis
44
45
##MAIN_PAGE
46
#MAIN_PAGE=http://crm.chinapost.com:18880/
47
##RETURN TAG \u8FD4\u56DE\u5B57\u7B26\u4E32
48
49
RETURN_TAG={"MESSAGE":"NOLOGIN","CODE":999999,"FLAG":"FAIL","RESULT":{"URL":"http://crm.chinapost.yw.com:18080/"}}
50
#RETURN_TAG=<html><script language="javascript"> function init(){ if(window.parent!=null) { window.parent.location.href ="http://crm.chinapost.com:18880"; } else window.location.href ="http://crm.chinapost.com:18880"; } </script><body onload="init()"></body></html>
51
52
53
54
redis.single=10.11.20.117:6379
55
redis.pool.maxTotal=1000
56
redis.pool.minIdle=5
57
redis.pool.maxIdle=100
58
redis.pool.testOnBorrow=false
59
redis.pool.maxWait=5000
60
redis.pool.testOnReturn=true
61
redis.pool.testWhileIdle=true
62
redis.pool.timeBetweenEvictionRunsMillis=10000
63
redis.password=luMZulgbotmo71aa
64
65
SESSION_DEFAULT_VERCODE=Hiz#8uAqkjhoPmXu8%aaa
66
67
#\u662F\u5426\u8FDB\u884C\u63A5\u53E3\u6743\u9650\u63A7\u5236 1 \u8FDB\u884C\u63A5\u53E3\u6743\u9650\u63A7\u5236 
68
is_check_interface=0
69
70
71
#BJYM\u4F7F\u7528
72
#USER_LOGIN_AUTH_CLASS=com.wframe.msgmanager.services.impl.UserLoginAuth4TestImpl
73
##\u5C0F\u7A0B\u5E8F\u4F7F\u7528
74
USER_LOGIN_AUTH_CLASS=com.wframe.usermanager.services.impl.UserLoginAuthImpl
75
#USER_LOGIN_AUTH_CLASS=com.wframe.msgmanager.services.impl.UserLoginByTokenImpl
76
#USER_LOGIN_AUTH_CLASS=com.wframe.msgmanager.services.impl.UserLoginByToken4XblImpl
77
SIGN_KEY_CODE=TENANT_CODE