actiontech / dms

3 stars 2 forks source link

未添加到项目的用户,登陆SQLE报错 #318

Closed taolx0 closed 3 weeks ago

taolx0 commented 3 weeks ago

现象

新建一个新用户,不添加该用户到任何项目,该用户登陆到SQLE报错

复现

  1. 新建用户user1
  2. 用user1登陆到sqle
  3. 页面报错

报错截图

image

问题原因

当该用户不属于任何项目,所以in查询内部无参数,gorm生成如下的错误SQL

[0.072ms] [rows:1] SELECT * FROM `projects` WHERE uid in () LIMIT 9999
echo: http: panic serving 127.0.0.1:51521: Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 9999' at line 1

影响面

用户不能选择项目,无法正常使用sqle审核平台

littleniannian commented 2 weeks ago

验证:

  1. 创建用户 image
  2. 登陆用户,不会出现报错 image

image