mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 18:45:58 +08:00
Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release
This commit is contained in:
@@ -464,9 +464,10 @@ type config struct {
|
||||
VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"`
|
||||
Enable bool `yaml:"enable"`
|
||||
}
|
||||
SuperCode string `yaml:"superCode"`
|
||||
CodeTTL int `yaml:"codeTTL"`
|
||||
Mail struct {
|
||||
SuperCode string `yaml:"superCode"`
|
||||
CodeTTL int `yaml:"codeTTL"`
|
||||
UseSuperCode bool `yaml:"useSuperCode"`
|
||||
Mail struct {
|
||||
Title string `yaml:"title"`
|
||||
SenderMail string `yaml:"senderMail"`
|
||||
SenderAuthorizationCode string `yaml:"senderAuthorizationCode"`
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
_ "github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetRegister(account, areaCode string) (*db.Register, error) {
|
||||
func GetRegister(account, areaCode, userID string) (*db.Register, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var r db.Register
|
||||
return &r, dbConn.Table("registers").Where("account = ? or account =? and area_code=?",
|
||||
account, account, areaCode).Take(&r).Error
|
||||
return &r, dbConn.Table("registers").Where("user_id = ? and user_id != ? or account = ? or account =? and area_code=?",
|
||||
userID, "", account, account, areaCode).Take(&r).Error
|
||||
}
|
||||
|
||||
func SetPassword(account, password, ex, userID, areaCode string) error {
|
||||
|
||||
@@ -302,6 +302,6 @@ func GetRandomDepartmentID() (string, error) {
|
||||
return "", err
|
||||
}
|
||||
department := &db.Department{}
|
||||
err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ?", "", "0").First(department).Error
|
||||
err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ? AND department_type = ?", "", "0", 1).First(department).Error
|
||||
return department.DepartmentID, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user