第 6篇 Scrum 冲刺博客

第 6篇 Scrum 冲刺博客

每天举行站立式会

  • 昨天已完成的工作

创建bean类

  • 今天计划完成的工作

完善博客功能

  • 工作中遇到的困难

发布项目燃尽图

每人的代码/文档签入记录

  • 代码签入
成员 commit记录 备注
邹尊业 dcda587 完善删除查询栏目与统计数据功能
张浩辉 448dc60 样式修改
张澍 15282545 加入SpringSecurity
  • 签入记录对应的Issue内容与链接,代码必须每天可执行

Securityhttps://github.com/GDUT-West3-740/server/commits/zzy-dev

  • code review编码规范文档如有变化要及时更新

适当的项目程序/模块的最新(运行)截图

  • 最新模块的代码
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    UserSeivice userSeivice;

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userSeivice);
    }


    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/admin/category/all").authenticated()
                .antMatchers("/admin/**","/reg").hasRole("超级管理员")
                .anyRequest().authenticated()
                .and().formLogin().loginPage("/login_page").successHandler(new AuthenticationSuccessHandler() {
            @Override
            public void onAuthenticationSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException {
                //
                httpServletResponse.setContentType("application/json;charset=utf-8");
                PrintWriter printWriter = httpServletResponse.getWriter();
                printWriter.write("{\"status\":\"success\",\"msg\":\"登录成功\"}");
                printWriter.flush();
                printWriter.close();
            }
        }).failureHandler(new AuthenticationFailureHandler() {
            @Override
            public void onAuthenticationFailure(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
                //
                httpServletResponse.setContentType("application/json;charset=utf-8");
                PrintWriter printWriter = httpServletResponse.getWriter();
                printWriter.write("{\"status\":\"error\",\"msg\":\"登录失败\"}");
                printWriter.flush();
                printWriter.close();
            }
        }).loginProcessingUrl("/login").usernameParameter("username").passwordParameter("password").permitAll()
        .and().logout().permitAll().and().csrf().disable().exceptionHandling().accessDeniedHandler(getAccessDeniedHandler());
    }

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/blogimg/**","/index.html","/static/**");
    }

    @Bean
    AccessDeniedHandler getAccessDeniedHandler(){
        return new AuthenticationAccessDeniedHandler();
    }
}

  • 代码上有注解,符合规范

  • 运行结果的截图

截屏2020-11-10 下午11.44.32.png

每日每人总结

张   澍: 加入SpringSecurity,实现登录注册部分的功能接口
邹尊业:完善了两个功能,现在开始考虑合并分支
张浩辉: 修改了样式接了部分接口
游宇权: 对设计稿进行审核

posted @ 2020-11-13 23:31  iamzhanghaohui  阅读(57)  评论(0编辑  收藏