tencent_im_service.go 847B

1234567891011121314151617181920212223242526272829
  1. package tencentim_service
  2. import (
  3. "SCRM/utils/tencentsig"
  4. )
  5. //正式
  6. const (
  7. ThisAccType = 29296
  8. ThisSDKAppId = "1400103109"
  9. ThisIdentifier = "kuyiyun" // admin
  10. ThisPriKey = `-----BEGIN PRIVATE KEY-----
  11. MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgpM/saduI49IF+DeL
  12. jEjyU1ryKIEKTyRLekw4w4qeC7ShRANCAAQHinjtGLt6WF2wOfEKA1xomfcS19/i
  13. ZyymFHJlKR49WASx/9XEbm2/TNZUn/qbe5jc4HhujQR7IUVKVFtEU6Oa
  14. -----END PRIVATE KEY-----`
  15. ThisPubKey = `-----BEGIN PUBLIC KEY-----
  16. MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB4p47Ri7elhdsDnxCgNcaJn3Etff
  17. 4mcsphRyZSkePVgEsf/VxG5tv0zWVJ/6m3uY3OB4bo0EeyFFSlRbRFOjmg==
  18. -----END PUBLIC KEY-----`
  19. )
  20. func CreateUserSig(Identifier, AppId3rd string) (userSig string, err error) {
  21. conf := tencentsig.NewConf(ThisSDKAppId, Identifier, AppId3rd).WithExpire(86400)
  22. userSig, err = conf.GenUserSig(ThisPriKey)
  23. return
  24. }