aa
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package cms
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/qywxapi"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/alipay"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
"sort"
|
||||
@@ -397,6 +399,21 @@ func CreateUser(user *model.User, creatorName string) (err error) {
|
||||
if user.GetEmail() == "" {
|
||||
user.Email = nil
|
||||
}
|
||||
if user.GetMobile() != "" && user.GetName() != "" && user.GetID2() != "" {
|
||||
if user.LastLoginType != "" && user.LastLoginType == alipay.AuthType {
|
||||
mobile := ""
|
||||
data, _ := base64.StdEncoding.DecodeString(user.GetMobile())
|
||||
key, _ := base64.StdEncoding.DecodeString(alipay.AuthKey)
|
||||
iv := []byte{}
|
||||
iv = append(iv, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||
if result, err := utils.AESCBCDecpryt(data, key, iv); err == nil && result != nil {
|
||||
mobile = string(result)
|
||||
}
|
||||
user.Mobile = &mobile
|
||||
user.UserID2 = mobile
|
||||
user.Name = mobile
|
||||
}
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(user, creatorName)
|
||||
user.UserID = utils.GetUUID()
|
||||
user.Status = model.UserStatusNormal
|
||||
|
||||
Reference in New Issue
Block a user