|
|
@@ -703,6 +703,57 @@ func GetTaAccountsByLoginID(loginID, taAccountType int) ([]Taaccount, error) {
|
|
|
func InsertWSKHUserInfo(userinfo Wskhuserinfo) error {
|
|
|
engine := db.GetEngine()
|
|
|
|
|
|
+ // 加密数据
|
|
|
+ key, _ := hex.DecodeString(utils.AESSecretKey)
|
|
|
+ // 证件号码
|
|
|
+ if len(userinfo.Cardnum) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Cardnum), key); err == nil {
|
|
|
+ userinfo.Cardnum = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 证件地址
|
|
|
+ if len(userinfo.Cardaddress) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Cardaddress), key); err == nil {
|
|
|
+ userinfo.Cardaddress = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 手机
|
|
|
+ if len(userinfo.Mobilephone) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Mobilephone), key); err == nil {
|
|
|
+ userinfo.Mobilephone = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 微信
|
|
|
+ if len(userinfo.Wechat) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Wechat), key); err == nil {
|
|
|
+ userinfo.Wechat = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 邮件
|
|
|
+ if len(userinfo.Email) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Email), key); err == nil {
|
|
|
+ userinfo.Email = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 银行帐号
|
|
|
+ if len(userinfo.Bankaccount) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Bankaccount), key); err == nil {
|
|
|
+ userinfo.Bankaccount = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 经纪人ID
|
|
|
+ if len(userinfo.Brokerid) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Brokerid), key); err == nil {
|
|
|
+ userinfo.Brokerid = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 登录帐号
|
|
|
+ if len(userinfo.Logincode) > 0 {
|
|
|
+ if encrypted, err := utils.AESEncrypt([]byte(userinfo.Logincode), key); err == nil {
|
|
|
+ userinfo.Logincode = hex.EncodeToString(encrypted)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 自增ID
|
|
|
seqMap, err := engine.QueryString("SELECT SEQ_WSKH_USERINFO.nextval USERID FROM dual")
|
|
|
if err != nil {
|