Commit 91228c9a by 李洪

冲突

parent fb9b837d
......@@ -52,6 +52,7 @@ func (cs *ConfigureSevice) Select(ctx context.Context,
in *pb.GetAllRequest) (reply *pb.GetAllReply, err error) {
reply = &pb.GetAllReply{}
configs, err := GetConfigureAll()
if err != nil {
return
......@@ -60,7 +61,6 @@ func (cs *ConfigureSevice) Select(ctx context.Context,
return
}
for _, v := range configs {
reply.GetAll = append(reply.GetAll, &pb.GetAllOneReply{
Reply: &pb.Public{
CompanyUserId: v.CompanyUserId,
......
......@@ -34,6 +34,7 @@ func (u *ImUserServer) ImUserRegister(ctx context.Context, in *pb.ImUserRequest)
Name: in.GetName(),
Mobile: in.GetMobile(),
Code: in.GetCode(),
Platfrom: in.GetPlatfrom(),
}
// 参数验证是否合法
......
package im_user
import (
"bytes"
"crypto/md5"
"encoding/hex"
"errors"
......@@ -8,6 +9,8 @@ import (
"im-microservice/db"
"im-microservice/helper"
"im-microservice/pb"
"math/rand"
"time"
"github.com/astaxie/beego/orm"
"github.com/segmentio/ksuid"
......@@ -17,10 +20,17 @@ const (
u_table_name = "im_user"
)
func CreateCaptcha() string {
return fmt.Sprintf("%04v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000))
}
func createAccid() string {
id := ksuid.New()
var buffer bytes.Buffer
kid := ksuid.New()
buffer.WriteString(kid.String())
buffer.WriteString(CreateCaptcha())
h := md5.New()
h.Write([]byte(id.String()))
h.Write([]byte(buffer.String()))
return hex.EncodeToString(h.Sum(nil))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment