fixes #34 「动态指令」多行指令会被当作一行执行
fixes #32 会话无法维持,1分钟左右自动断开 fixes #31 更新"资产"会清空"标签" fixes #13 建议添加用户权限功能、隐藏授权账户信息
This commit is contained in:
@ -27,7 +27,6 @@ func UserCreateEndpoint(c echo.Context) error {
|
||||
if err := model.CreateNewUser(&item); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return Success(c, item)
|
||||
}
|
||||
|
||||
@ -89,3 +88,27 @@ func UserGetEndpoint(c echo.Context) error {
|
||||
|
||||
return Success(c, item)
|
||||
}
|
||||
|
||||
func UserChangePasswordEndpoint(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
password := c.QueryParam("password")
|
||||
|
||||
passwd, err := utils.Encoder.Encode([]byte(password))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
u := &model.User{
|
||||
Password: string(passwd),
|
||||
}
|
||||
model.UpdateUserById(u, id)
|
||||
return Success(c, "")
|
||||
}
|
||||
|
||||
func UserResetTotpEndpoint(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
u := &model.User{
|
||||
TOTPSecret: "-",
|
||||
}
|
||||
model.UpdateUserById(u, id)
|
||||
return Success(c, "")
|
||||
}
|
||||
|
Reference in New Issue
Block a user