blossom-editor / blossom

A markdown editor that you can deploy on your own servers to achieve cloud storage and device synchronization(支持私有部署的云端存储双链笔记软件)
https://www.wangyunf.com/blossom-doc/index
MIT License
3.12k stars 256 forks source link

修改密码,创建账户错误 #50

Closed pixb closed 10 months ago

pixb commented 11 months ago

nested exception is org.apache.ibatis.exceptions.PersistenceException:

Error updating database. Cause: java.lang.IndexOutOfBoundsException: No group 2

The error may exist in com/blossom/backend/base/user/UserMapper.java (best guess)

The error may involve com.blossom.backend.base.user.UserMapper.insert-Inline

The error occurred while setting parameters

SQL: INSERT INTO base_user ( id, type, username, password, salt, nick_name, real_name ) VALUES ( ?, ?, ?, ?, ?, ?, ? )

Cause: java.lang.IndexOutOfBoundsException: No group 2

xiaozzzi commented 11 months ago

是在添加使用账户时吗?看起来是添加了重复的用户名

pixb commented 11 months ago

不是,不是重复的,我看了数据库里也只有默认的用户

pixb commented 11 months ago

修改blos用户的密码也报这个错误

xiaozzzi commented 11 months ago

我在添加重复用户名时复现了该问题,但添加不存在的用户以及修改密码时无法复现,方便提供一下数据库版本和数据库文件吗

pixb commented 11 months ago

我先自己本地调试看看能不能fix bug

异常类型: org.mybatis.spring.MyBatisSystemException
异常内容: nested exception is org.apache.ibatis.exceptions.PersistenceException:  ### Error updating database.  Cause: java.lang.IndexOutOfBoundsException: No group 2 ### The error may exist in file [/home/pix/Downloads/blossom/blossom-backend/backend/target/classes/mapper/UserMapper.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: update base_user set password = ?,upd_time = now() where id = ? ### Cause: java.lang.IndexOutOfBoundsException: No group 2
堆栈信息: 
 > com.blossom.backend.base.user.UserService.updPassword(UserService.java:93)
 > com.blossom.backend.base.user.UserService$$FastClassBySpringCGLIB$$2993812.invoke(<generated>:-1)
 > com.blossom.backend.base.user.UserService$$EnhancerBySpringCGLIB$$4b141b5d.updPassword(<generated>:-1)
 > com.blossom.backend.base.user.UserController.updatePassword(UserController.java:85)
 > com.blossom.backend.base.auth.caffeine.CaffeineTokenAuthFilterProxy.doFilterInternal(CaffeineTokenAuthFilterProxy.java:104)
 > com.blossom.backend.base.auth.filters.AuthFilterProxy.doFilter(AuthFilterProxy.java:53)
 > com.blossom.backend.base.auth.filters.RequestWrapperFilter.doFilterInternal(RequestWrapperFilter.java:33)
 > com.blossom.expand.tracker.core.adapter.spring.TrackerFilter.doFilter(TrackerFilter.java:52)
pixb commented 11 months ago

现在我能确定是mybatis的问题,mybatis再处理含有$符号的字符串时会有问题,我调试一下看看怎么处理一下

xiaozzzi commented 10 months ago

已在 v1.12.0 版本中修复