예제 #1
0
파일: base.go 프로젝트: 75912001/GoServer
func (p *base_t) Insert(uid string, recNum string, pwd string) (err error) {
	fmt.Println(uid, recNum, pwd)
	{ //注册用户。。。
		//md5
		var pwd1 string = pwd + md5_pwd1_suffix
		var pwd2 string = pwd + md5_pwd2_suffix
		pwd1 = zzcommon.GenMd5(pwd1)
		pwd2 = zzcommon.GenMd5(pwd2)

		commandName := "hmset"
		key := p.genRedisKey(uid)

		_, err = ict_common.GRedisClient.Conn.Do(commandName, key, field_phone_id, recNum, field_pwd1, pwd1, field_pwd2, pwd2)
		if nil != err {
			fmt.Println("######gUserRegister hmset err:", err, uid, recNum, pwd1, pwd2)
			return err
		}
	}
	return err
}
예제 #2
0
//生成sign(MD5)
func (p *phoneSms_t) genSign(recNum string, smsParam string, timeStamp string, SmsFreeSignName string, SmsTemplateCode string) (value string) {
	var signSource = p.AppSecret +
		"app_key" + p.AppKey +
		"method" + p.Method +
		"rec_num" + recNum +
		"sign_method" + p.SignMethod +
		"sms_free_sign_name" + SmsFreeSignName +
		"sms_param" + smsParam +
		"sms_template_code" + SmsTemplateCode +
		"sms_type" + p.SmsType +
		"timestamp" + timeStamp +
		"v" + p.Versions +
		p.AppSecret
	strMd5 := zzcommon.GenMd5(signSource)
	strMd5 = strings.ToUpper(strMd5)
	fmt.Println(signSource)
	fmt.Println(strMd5)
	return strMd5
}