国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|JavaScript|易語言|

服務器之家 - 編程語言 - Java教程 - 解析spring cloud ouath2中的Eureka

解析spring cloud ouath2中的Eureka

2021-08-08 11:44小黃雞1992 Java教程

這篇文章主要介紹了spring cloud ouath2中的Eureka,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

老生常談的配置 但是還是需要說明一下

EurekaApplication 

@EnableEurekaServer指定為server端

?
1
2
3
4
5
6
7
8
9
@EnableEurekaServer
@SpringBootApplication
public class EurekaApplication {
 
 public static void main(String[] args) {
  SpringApplication.run(EurekaApplication.class, args);
 }
 
}

WebSecurityConfig 

看到這眼熟不呢 沒錯 Eureka也開啟spring security 在訪問前臺頁面時也需要輸入賬號密碼

?
1
2
3
4
5
6
7
8
9
10
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 
 @Override
 protected void configure(HttpSecurity http) throws Exception {
  super.configure(http);
  http.csrf().disable().httpBasic();
 }
}

application.yml

security:user以下配置的賬號密碼 在訪問頁面需要輸入的

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
server:
 port: 7001
spring:
 application:
 name: eureka
 security:
 user:
  name: admin
  password: xxxxxxxxxx
eureka:
 client:
 fetch-registry: false
 register-with-eureka: false
 service-url:
  defaultZone: http://admin:Xk38CNHigBP5jK75@localhost:5001/eureka
 instance:
 hostname: localhost
 prefer-ip-address: true
logging:
 config: classpath:logback.xml
 level:
 root: info

pom.xml

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<dependencies>
 <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-security</artifactId>
 </dependency>
 <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
 </dependency>
 <dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
 </dependency>
 
 <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
  <exclusions>
   <exclusion>
    <groupId>org.junit.vintage</groupId>
    <artifactId>junit-vintage-engine</artifactId>
   </exclusion>
  </exclusions>
 </dependency>
 <dependency>
  <groupId>org.springframework.security</groupId>
  <artifactId>spring-security-test</artifactId>
  <scope>test</scope>
 </dependency>
</dependencies>

當訪問localhost:7001 出現下圖 需要填寫賬號密碼

解析spring cloud ouath2中的Eureka

在其他服務注冊時 也需要指定賬號密碼

?
1
2
3
4
5
6
7
8
9
10
11
12
13
eureka:
 instance:
 hostname: ${spring.cloud.client.ip-address}
 prefer-ip-address: true
 instance-id: ${eureka.instance.hostname}:${server.port}
 //與server一致
 client:
 security:
  basic:
  user: admin
  password: xxxxxxxxxxx
 service-url:
  defaultZone: http://${eureka.client.security.basic.user}:${eureka.client.security.basic.password}@localhost:7001/eureka

到此這篇關于spring cloud ouath2中的Eureka的文章就介紹到這了,更多相關spring cloud ouath2內容請搜索服務器之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持服務器之家!

原文鏈接:https://blog.csdn.net/qq_20143059/article/details/113759124

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 亚洲高清精品视频 | 亚洲高清第一页 | 久久久艹| 一区二区在线免费观看 | 国产精品亚洲视频 | 久久久人成影片免费观看 | 精品久久久久久久人人人人传媒 | www国产亚洲精品久久网站 | 黄色一级毛片在线观看 | 亚洲性生活免费视频 | 精品96久久久久久中文字幕无 | 中文字幕在线观看视频一区 | 黄色av日韩| 狠狠操狠狠干 | 日韩电影免费在线观看中文字幕 | 日韩一区二区不卡 | 欧美日韩午夜 | 欧美黄色片 | 成人免费一区二区三区视频网站 | 日本不卡高字幕在线2019 | 日韩精品专区在线影院重磅 | 亚洲第一av | av色综合| 亚洲一本 | 亚洲av毛片| 欧美成人免费在线视频 | 九九热在线免费视频 | 国产综合久久久 | 黄色影院| 久久久综合网 | 日本高清视频在线播放 | 欧美啪啪| www.国产 | 精品亚洲一区二区 | 国产综合精品一区二区三区 | 欧美人交a欧美精品 | 九色av | 精品少妇一区二区三区 | 亚洲一区二区三区四区的 | 亚洲一区二区三区视频 | 中文字幕在线免费视频 |