feat: 注册短信验证码验证功能已经开启

This commit is contained in:
RockYang
2023-07-02 20:51:13 +08:00
parent a2b1924e00
commit 72cc6f3d75
21 changed files with 457 additions and 53 deletions

View File

@@ -30,13 +30,19 @@ func (db *LevelDB) Put(key string, value interface{}) error {
return db.driver.Put([]byte(key), bytes, nil)
}
func (db *LevelDB) Get(key string) ([]byte, error) {
func (db *LevelDB) Get(key string) (interface{}, error) {
bytes, err := db.driver.Get([]byte(key), nil)
if err != nil {
return nil, err
}
return bytes, nil
var value interface{}
err = json.Unmarshal(bytes, &value)
if err != nil {
return nil, err
}
return value, nil
}
func (db *LevelDB) Search(prefix string) []string {

View File

@@ -3,6 +3,7 @@ package model
type User struct {
BaseModel
Username string `gorm:"index:username,unique"`
Mobile string
Password string
Nickname string
Avatar string

View File

@@ -5,6 +5,7 @@ import "chatplus/core/types"
type User struct {
BaseVo
Username string `json:"username"`
Mobile string `json:"mobile"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Salt string `json:"salt"` // 密码盐