We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
刚开始学习go 使用这个项目的时候 发现修改密码功能一直操作不成功, 调试代码发现无法解决以下问题
2021-03-12 17:53:43.758 [ERRO] Password error sql: expected 27 arguments, got 28, UPDATE sys_userSETstatus=10,tel='123',back_site_id=5,real_name='系统管理员',depart_id=10001,address='',uuid='94091b1fa6ac4a27a06c0b92155aea6a',endtime='',user_type=1,remark='时间是最好的老师,但遗憾的是——最后他把所有的学生都弄死了',enable=1,update_time='2021-03-12 17:53:40',create_time='2017-03-19 20:41:25',create_id=1,id=1,password='ef694f728a44575bedc8ee7caa2d5c48',thirdid='',email='[email protected]',title_url='',theme='flat',create_site_id=1,project_id=1,username='admin',salt='1111',project_name='test',update_id=1 WHERE id` IN (1) Stack:
2021-03-12 17:53:43.758 [ERRO] Password error sql: expected 27 arguments, got 28, UPDATE
SET
=10,
='123',
=5,
='系统管理员',
=10001,
='',
='94091b1fa6ac4a27a06c0b92155aea6a',
=1,
='时间是最好的老师,但遗憾的是——最后他把所有的学生都弄死了',
='2021-03-12 17:53:40',
='2017-03-19 20:41:25',
='ef694f728a44575bedc8ee7caa2d5c48',
='[email protected]',
='flat',
='admin',
='1111',
='test',
=1 WHERE
The text was updated successfully, but these errors were encountered:
问题已经定位到 在user_entity.go文件中
func (r *Entity) Update() (result sql.Result, err error) { return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update() } 这段代码中 gdb.GetWhereConditionOfStruct(r) 返回三个参数: 字段 值 错误参数 而在Where函数接收参数时如下段代码 在user_model.go文件中 func (m *arModel) Where(where interface{}, args ...interface{}) *arModel { return &arModel{m.M.Where(where, args...)} } 误将error返回的nil添加到值中 导致参数多于需要的个数 望解决!
Sorry, something went wrong.
应该是版本问题~很久没维护了,后面抽时间测测
No branches or pull requests
刚开始学习go 使用这个项目的时候 发现修改密码功能一直操作不成功,
调试代码发现无法解决以下问题
2021-03-12 17:53:43.758 [ERRO] Password error sql: expected 27 arguments, got 28, UPDATE
sys_userSET
status=10,
tel='123',
back_site_id=5,
real_name='系统管理员',
depart_id=10001,
address='',
uuid='94091b1fa6ac4a27a06c0b92155aea6a',
endtime='',
user_type=1,
remark='时间是最好的老师,但遗憾的是——最后他把所有的学生都弄死了',
enable=1,
update_time='2021-03-12 17:53:40',
create_time='2017-03-19 20:41:25',
create_id=1,
id=1,
password='ef694f728a44575bedc8ee7caa2d5c48',
thirdid='',
email='[email protected]',
title_url='',
theme='flat',
create_site_id=1,
project_id=1,
username='admin',
salt='1111',
project_name='test',
update_id=1 WHERE
id` IN (1)Stack:
XXXXXXX/src/gmanager/app/api/user/userAction.go:210`
The text was updated successfully, but these errors were encountered: