Compare commits

...

4 Commits

Author SHA1 Message Date
刘祥超
b512f3d680 删除用户的时候更改以往同名用户的用户名,防止冲突 2023-01-13 18:51:50 +08:00
刘祥超
d4e829e57c 版本号修改为0.6.3 2023-01-11 15:45:13 +08:00
刘祥超
78798060e7 版本号更改为0.6.2 2023-01-10 21:18:08 +08:00
刘祥超
b2569a8dac 版本修改为0.6.1 2023-01-09 16:06:34 +08:00
2 changed files with 24 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
package teaconst
const (
Version = "0.6.0"
Version = "0.6.3"
ProductName = "Edge API"
ProcessName = "edge-api"
@@ -18,7 +18,7 @@ const (
// 其他节点版本号,用来检测是否有需要升级的节点
NodeVersion = "0.6.0"
NodeVersion = "0.6.3"
// SQLVersion SQL版本号
SQLVersion = "9"

View File

@@ -12,6 +12,7 @@ import (
"github.com/iwind/TeaGo/Tea"
"github.com/iwind/TeaGo/dbs"
"github.com/iwind/TeaGo/lists"
"github.com/iwind/TeaGo/rands"
"github.com/iwind/TeaGo/types"
stringutil "github.com/iwind/TeaGo/utils/string"
timeutil "github.com/iwind/TeaGo/utils/time"
@@ -66,7 +67,27 @@ func (this *UserDAO) DisableUser(tx *dbs.Tx, userId int64) error {
return errors.New("invalid 'userId'")
}
_, err := this.Query(tx).
// 处理以往同用户名用户
username, err := this.Query(tx).
Pk(userId).
Result("username").
FindStringCol("")
if err != nil {
return err
}
if len(username) > 0 {
err = this.Query(tx).
Attr("username", username).
Attr("state", UserStateDisabled).
Set("username", username+"_"+rands.HexString(8)).
UpdateQuickly()
if err != nil {
return err
}
}
// 禁止当前
_, err = this.Query(tx).
Pk(userId).
Set("state", UserStateDisabled).
Update()