栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

01-spring boot 2.6.2 spring security 集成

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

01-spring boot 2.6.2 spring security 集成

01-spring boot 2.6.2 spring security 集成

更多关注:JeeGit 5.0 企业级快速开发平台

在spring boot 项目中引入 spring security 的模块
	
		org.springframework.boot
		spring-boot-starter-security
	

完整代码如下:



	4.0.0
	
		com.godzt
		jeegit-meta
		5.0.1-SNAPSHOT
		../meta/pom.xml
		
		
		
		
		
		


	


	jeegit-basic
	jar


	jeegit basic
	https://www.jeegit.com
	jeegit basic for web application 
	2022-Now


	


	


		
		
			com.godzt
			jeegit-common
			${project.parent.version}
		

		
		
			com.godzt
			jeegit-framework-basicinfo
			${project.parent.version}
		

		
			org.springframework.boot
			spring-boot-starter-security
		
	


	
		
			
				org.springframework.boot
				spring-boot-maven-plugin
			

			
			
				org.apache.maven.plugins
				maven-surefire-plugin
				
					true
				
			
			

		
	


	
		
			taoist-info
			hailu Yao
			admin at jeegit.com
			
				Project lead
			
			+8
		


	

	
		GodZT
		https://www.godzt.com
	



创建一个webcontroller 类,内置一个请求。
package com.godzt.jeegit.web;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value="")
public class HelloWorld {

	
	@RequestMapping(value="")
	public String demo()
	{
		return "hello world";
	}
}

启动spring boot

控制台会打印 默认分配的用户名密码

Using generated security password: 055f1b98-32e9-4f64-ac52-595baa5ada2d

则 默认的用户名是 user 密码见 控制台

http://localhost:8080/login 登录地址

http://localhost:8080/ogout 退出地址

更多关注:JeeGit 5.0 企业级快速开发平台

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/704888.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号