Springboot Drill ----- Gateway

1. Create new gate module

Springboot Drill ----- Gateway_第1张图片

2. Configure pom.xml  and application.yml

Springboot Drill ----- Gateway_第2张图片

Springboot Drill ----- Gateway_第3张图片

3. Add start zuul annonation

Springboot Drill ----- Gateway_第4张图片

4. Code authFilter

Springboot Drill ----- Gateway_第5张图片

5. Refer

<1>

Cause: 访问任意接口提示Unauthorized,返回401,并跳转到登陆页面的错误

Cause By: pom sping-boot-started-security

Solve:remove pom this is dependency

<2>

Cause: org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry

Cause By:no mysql connection configuration 

Solve:configuration mysql properties

Springboot Drill ----- Gateway_第6张图片

你可能感兴趣的:(spring)