AnisHon / StudentSystem

Spring3与Vue3的简易学生管理系统
0 stars 0 forks source link

[Bug] There are serious problems #1

Open dyingChinese opened 1 month ago

dyingChinese commented 1 month ago

(你应该是个中国人,所以我选择直接用中文和你对话)

今天,我拉取了您的学生管理系统,我发现您的逻辑有严重的问题;

您在您的服务端代码使用了SpringSecurity相关组件,其中校验用户登录的Security处理器为处理器自带的表单式处理器,

是的,您按照约束实现了AccountService类,但是您对应的SQL语句有极其严重的错误

@Mapper
public interface AccountMapper extends BaseMapper<Account> {

    @Select("""
            select account.id as id,
                       account.user_id as userId,
                       case
                           when account.role = 'teacher' then t.name
                           when account.role = 'student' then s.name
                       end as name,
                       account.role as role
                from account
                    left join db02.student s on account.id = s.account_id
                    left join db02.teacher t on account.id = t.account_id
                where account.user_id = #{userId}
                """)
    UserInfo selectUserInfoByUserId(String userId);
}

在一般情况下,您的SQL语句会导致无限次的循环.这不符合SelectOne()方法的预期.

我查看了您的其他部分代码,我发现这个项目是您的未完成,判断您是刚开始接触类似领域。希望这些内容对您有足够的帮助。

当然我查看了,您的前端页面,那很酷炫,符合属于年轻人的设计风格。这很棒! 👍👍👍

image image image

AnisHon commented 1 month ago

Thank you so much for bringing this issue to my attention—I truly appreciate it! You’re absolutely right. This project originally started as a homework assignment, and it was my first experience using Vue. The database design, unfortunately, wasn’t great, as it was shared with my Qt project. That’s one of the key reasons why this project was abandoned. Since then, I’ve rewritten a more complete version, though the UI looks a bit flat and even ugly.

That said, I’m really grateful for your feedback! Could you please help me understand where the main problem lies? I’d love to fix it and check if similar issues existing in other projects.