Spring Boot + Nuxt + Debian(三):Spring Boot框架集成shiro,token,启动项目注意事项

本文介绍了如何在Spring Boot应用中集成Shiro进行权限管理,并详细讲述了配置Shiro的相关步骤,包括引入依赖、配置文件、UserLoginRealm和CheckUserRealm的实现。此外,还讨论了Spring Boot项目的启动问题,如配置文件的选择、启动命令以及自定义启动logo的方法。
摘要由CSDN通过智能技术生成

一、Spring Boot框架集成shiro

1.引入依赖,依赖版本我在这里查找:Maven Repository

<dependency>
	<groupId>org.apache.shiro</groupId>
	<artifactId>shiro-spring</artifactId>
	<version>${shiro.spring.version}</version>
</dependency>

2.shiro目录

在这里插入图片描述

3.shiroConfig(shiro的主要配置文件)

/**
 * @author ***
 * @date Dec. 31, 2019
 * @description ShiroConfig
 */
@Configuration
public class ShiroConfig {
    /**
     * 开启aop注解支持
     *
     * @return AuthorizationAttributeSourceAdvisor
     */
    @Bean
    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
        AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
        authorizationAttributeSourceAdvisor.setSecurityManager(securityManager);
        return authorizationAttributeSourceAdvisor;
    }

    @Bean(name = "shiroFilter")
    public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
        shiroFilterFactoryBean.setSecurityManager(securityManager);
        Map<St
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
【资源说明】 1、基于SpringBoot+Nuxt的服务端渲染博客系统源码+数据库+项目说明.zip 2、该资源包括项目的全部源码,下载可以直接使用! 3、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 4、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 基于SpringBoot+Nuxt的服务端渲染博客系统源码+数据库+项目说明.zip ### 简介 基于 SpringBootNuxt 的前后端分离博客 ### SQL文件 blog.sql 初始账号密码:Linter ### Nginx配置 ``` location / { proxy_pass http://127.0.0.1:3000; } location ~ .*\.(gif|jpg|jpeg|png)$ { proxy_pass http://127.0.0.1:3000; } location ~ .*\.(js|css|woff|ttf|ico)?$ { proxy_pass http://127.0.0.1:3000; } ``` ### 截图 #### 首页 ![首页](screenshot/blog-index.png) #### 登录 ![登录](screenshot/blog-login.png) #### 分类 ![分类](screenshot/blog-catalog.png) #### 文章 ![文章](screenshot/blog-article.png) #### 评论 ![评论](screenshot/blog-comment-new.png) #### 搜索 ![搜索](screenshot/blog-search.png) #### 后台首页 ![后台首页](screenshot/blog-admin-index.png) #### 发布文章 ![发布文章](screenshot/blog-article-new.png) #### 文章管理 ![文章管理](screenshot/blog-article-list.png) #### 新增分类 ![新增分类](screenshot/blog-category-new.png) #### 编辑分类 ![编辑分类](screenshot/blog-category-edit.png) #### 分类管理 ![分类管理](screenshot/blog-category-list.png) #### 评论管理 ![评论管理](screenshot/blog-comment-list.png) #### 新增用户 ![新增用户](screenshot/blog-user-new.png) #### 用户管理 ![用户管理](screenshot/blog-user-list.png)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值