[fix] 生成ID首位必须为字母

This commit is contained in:
PandaX-Go
2024-08-08 21:34:37 +08:00
parent 27b4768613
commit f8711c8e21
3 changed files with 34 additions and 2 deletions

View File

@@ -107,7 +107,7 @@ func (p *ProductApi) GetProduct(rc *restfulx.ReqCtx) {
func (p *ProductApi) InsertProduct(rc *restfulx.ReqCtx) {
var data entity.Product
restfulx.BindJsonAndValid(rc, &data)
data.Id = utils.GenerateID()
data.Id = utils.GenerateTdID("p")
data.Owner = rc.LoginAccount.UserName
data.OrgId = rc.LoginAccount.OrganizationId
// 如果未设置规则链,默认为主链