@SpringCloudApplication

This commit is contained in:
冷冷 2018-04-27 20:55:43 +08:00
parent 60c6f34ce4
commit 4e1d61786b
4 changed files with 5 additions and 13 deletions

View File

@ -1,6 +1,5 @@
package com.github.pig.auth.component.mobile;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pig.common.constant.CommonConstant;
import com.xiaoleilu.hutool.map.MapUtil;
@ -58,12 +57,6 @@ public class MobileLoginSuccessHandler implements AuthenticationSuccessHandler {
String[] tokens = extractAndDecodeHeader(header);
assert tokens.length == 2;
String clientId = tokens[0];
String clientSecret = tokens[1];
JSONObject params = new JSONObject();
params.put("clientId", clientId);
params.put("clientSecret", clientSecret);
params.put("authentication", authentication);
ClientDetails clientDetails = clientDetailsService.loadClientByClientId(clientId);
TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), clientId, clientDetails.getScope(), "mobile");

View File

@ -2,6 +2,7 @@ package com.github.pig.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.config.server.EnableConfigServer;

View File

@ -1,8 +1,7 @@
package com.github.pig.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.cloud.client.loadbalancer.LoadBalancerInterceptor;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
@ -15,10 +14,9 @@ import org.springframework.security.config.annotation.method.configuration.Enabl
* @author lengleng
*/
@EnableZuulProxy
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
@EnableGlobalMethodSecurity(prePostEnabled = true)
@SpringCloudApplication
@ComponentScan(basePackages = {"com.github.pig.gateway", "com.github.pig.common.bean"})
public class PigGatewayApplication {

View File

@ -6,7 +6,7 @@ import de.codecentric.boot.admin.notify.Notifier;
import de.codecentric.boot.admin.notify.RemindingNotifier;
import de.codecentric.boot.admin.notify.filter.FilteringNotifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.turbine.EnableTurbine;
import org.springframework.context.annotation.Bean;
@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit;
@EnableAdminServer
@EnableTurbine
@EnableDiscoveryClient
@SpringBootApplication
@SpringCloudApplication
public class PigMonitorApplication {
public static void main(String[] args) {