func (this *AdminModel) Login(v_name string, v_pwd string) (bool, error, uint) {
o := orm.NewOrm()
v_pwd_encrypt_byte := md5.Sum([]byte(v_pwd))
v_pwd_encrypt := string(v_pwd_encrypt_byte[:])
t_admin := Admin{Name: v_name, Pwd: v_pwd_encrypt}
fmt.Printf("username:%v password:%v\n", v_name, v_pwd_encrypt_byte)
fmt.Printf("username:%v password:%v\n", v_name, v_pwd_encrypt_byte[:])
fmt.Printf("username:%v password:%v\n", v_name, v_pwd_encrypt)
err := o.Read(&t_admin, "Name", "Pwd")
if err != nil {
return false, err, 0
} else {
return true, nil, t_admin.Id
}
}
打印结果:
username:yuhaya password:[97 22 175 237 203 11 195 16 131 147 92 28 38 47 244 201]
username:yuhaya password:[97 22 175 237 203 11 195 16 131 147 92 28 38 47 244 201]
username:yuhaya password:a???
???\&/??
为什么打印结果的最后一行是乱码?
v_pwd_encrypt := string(v_pwd_encrypt_byte[:])
这个职位转换是不可能的吗?
忽然笑
哈士奇WWW
相关分类