更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -13,7 +13,6 @@ import (
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
)
|
||||
|
||||
// PlatformUserController 平台端用户相关(简化:当前用户信息落在 yz_system_tenant_user)
|
||||
type PlatformUserController struct {
|
||||
beego.Controller
|
||||
}
|
||||
@@ -29,12 +28,9 @@ type addUserPayload struct {
|
||||
Remark *string `json:"remark"`
|
||||
}
|
||||
|
||||
// AddUser 添加用户(绑定到租户)
|
||||
// POST /platform/addUser
|
||||
func (c *PlatformUserController) AddUser() {
|
||||
var p addUserPayload
|
||||
|
||||
// 兼容 JSON body
|
||||
raw, _ := io.ReadAll(c.Ctx.Request.Body)
|
||||
if err := json.Unmarshal(raw, &p); err != nil {
|
||||
c.Data["json"] = map[string]interface{}{"code": 400, "msg": "参数错误"}
|
||||
@@ -75,12 +71,10 @@ func (c *PlatformUserController) AddUser() {
|
||||
status = *p.Status
|
||||
}
|
||||
|
||||
// 生成 uid:8位数字即可(10000000~99999999)
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
var uid uint64
|
||||
for i := 0; i < 5; i++ {
|
||||
uid = uint64(10000000 + rand.Intn(90000000))
|
||||
// 尝试写入(若冲突由唯一索引兜底,外层再重试)
|
||||
account := &p.Account
|
||||
name := &p.Name
|
||||
phone := &p.Phone
|
||||
@@ -98,7 +92,6 @@ func (c *PlatformUserController) AddUser() {
|
||||
_ = c.ServeJSON()
|
||||
return
|
||||
}
|
||||
// 轻量重试
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user