chore: upgrade dependencies and secure passwords
This commit is contained in:
@@ -2,6 +2,8 @@ package models
|
||||
|
||||
import (
|
||||
"bsm/full/module/ec/mall/internal/impl"
|
||||
"bsm/full/module/ec/mall/internal/password"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
"git.apinb.com/bsm-sdk/core/utils"
|
||||
"gorm.io/gorm"
|
||||
@@ -53,12 +55,14 @@ func CreateStore(title, domain string) {
|
||||
// 创建默认目录
|
||||
err = impl.DBService.Model(&MallStaff{}).Where("store_identity=? and account=?", store.Identity, "root").Count(&cnt).Error
|
||||
if cnt == 0 || err != nil {
|
||||
salt := utils.RandomString(8)
|
||||
passwordHash, hashErr := password.Hash("123456")
|
||||
if hashErr != nil {
|
||||
return
|
||||
}
|
||||
root := &MallStaff{
|
||||
Std_Store: Std_Store{Store_ID: store.ID, Store_Identity: store.Identity},
|
||||
Account: "root",
|
||||
Password: utils.Md5("123456" + salt),
|
||||
Salt: salt,
|
||||
Password: passwordHash,
|
||||
Role: "Mall_Admin",
|
||||
Std_IICUDS: types.Std_IICUDS{Identity: utils.UUID(), Status: 1},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user