Java项目个人博客系统(前后端分离+java+vue+Springboot+ssm+mysql+maven+redis)

这是一个基于Java、Springboot、Vue、Mybatis和Redis的前后端分离个人博客系统,具备文章展示、热门文章、分类、标签云、评论、留言等功能。项目运行需JDK 1.8、Tomcat和Mysql环境,使用Maven管理依赖,并包含支付宝支付代码。
摘要由CSDN通过智能技术生成

源码获取:博客首页 “资源” 里下载!

一、项目简述

本系统功能包括:文章展示、热门文章、文章分类、标签云用户登录评论、匿名评论用户留言、匿名留言评论管理、文章发布、文章管理文章数据统计等等.

二、项目运行

环境配置: Jdkl . 8 + Tomcats . 5 + Mysql + HBuilderX ( Webstorm 也行) + Eclispe ( IntelliJ 10 以,三 clispe , MyEclispe , Sts 都支持)。

项目技术: Springboot + Maven + Mybatis + Vue + Redis 组成, BIS 模式+ M aven 等等,附带支付宝沙箱环境以及支付环节代码。

处理管理员界面请求:

/**
 * 处理管理员界面请求
 *
 */
@Controller
@RequestMapping("/admin")
public class AdminController {

    @Resource
    private AdminUserService adminUserService;
    @Resource
    private BlogService blogService;
    @Resource
    private CategoryService categoryService;
    @Resource
    private TagService tagService;
    @Resource
    private CommentService commentService;


    /**
     * 处理登录请求
     *
     * @return java.lang.String
     */
    @GetMapping({"/login"})
    public String login() {
        return "admin/login";
    }

    /**
     * 主页
     *
     * @param request http请求
     * @return java.lang.String
     */
    @GetMapping({"", "/", "/index", "/index.html"})
    public String index(HttpServletRequest request) {
        request.setAttribute("path", "index");
        request.setAttribute("categoryCount", categoryService.getTotalCategories());
        request.setAttribute("blogCount", blogService.getTotalBlogs());
        request.setAttribute("tagCount", tagService.getTotalTags());
        request.setAttribute("commentCount", commentService.getTotalComments());
        return "admin/index";
    }

    /**
     * 登录界面
     *
     * @param userName   用户名
     * @param password   密码
     * @param verifyCode 验证码
     * @param session    session
     * @return java.lang.String
     */
    @PostMapping(value = "/login")
    public String login(@RequestParam("userName") String userName,
                        @RequestParam("password") String password,
                        @RequestParam("verifyCode") String verifyCode,
                        HttpSession session) {
        if (StringUtils.isEmpty(verifyCode)) {
            session.setAttribute("errorMsg", "验证码不能为空");
            return "admin/login";
        }
        if (StringUtils.isEmpty(userName) || StringUtils.isEmpty(password)) {
            session.setAttribute("errorMsg", "用户名或密码不能为空");
            return "admin/login";
        }
        String kaptchaCode = session.getAttribute("verifyCode") + "";
        if (StringUtils.isEmpty(kaptchaCode) || !verifyCode.equals(kaptchaCode)) {
            session.setAttribute("errorMsg", "验证码错误");
            return "admin/login";
        }
        AdminUser adminUser = adminUserService.login(userName, password);
        if (adminUser !=
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值