|
@@ -1,7 +1,6 @@
|
|
|
package util
|
|
|
|
|
|
import (
|
|
|
- "app.yhyue.com/moapp/jypkg/identity"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"io/ioutil"
|
|
@@ -10,6 +9,8 @@ import (
|
|
|
"net/url"
|
|
|
"time"
|
|
|
|
|
|
+ "app.yhyue.com/moapp/jypkg/identity"
|
|
|
+
|
|
|
qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
. "app.yhyue.com/moapp/jybase/date"
|
|
|
"app.yhyue.com/moapp/jybase/encrypt"
|
|
@@ -27,7 +28,7 @@ import (
|
|
|
// 超级订阅:tn:周期 1:天、2:月
|
|
|
// tt:数量
|
|
|
// err 异常
|
|
|
-func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[string]interface{}, err error) {
|
|
|
+func SellerTokenDecrypt(token string) (uId, sName string, sid string, desc map[string]interface{}, err error) {
|
|
|
if token == "" {
|
|
|
err = fmt.Errorf("缺少token")
|
|
|
return
|
|
@@ -50,9 +51,9 @@ func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[stri
|
|
|
|
|
|
uId = param.Get("uid")
|
|
|
sName = param.Get("sName")
|
|
|
- sid = qutil.IntAll(param.Get("sid"))
|
|
|
+ sid = qutil.ObjToString(param.Get("sid"))
|
|
|
|
|
|
- if uId == "" || sName == "" || sid == 0 || len(desc) == 0 {
|
|
|
+ if uId == "" || sName == "" || sid == "" || len(desc) == 0 {
|
|
|
err = fmt.Errorf("缺少参数")
|
|
|
return
|
|
|
}
|
|
@@ -70,9 +71,9 @@ func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[stri
|
|
|
// tt:数量
|
|
|
// return
|
|
|
// token 加密信息
|
|
|
-func GetSellerToken(uId, sName string, sid int, desc map[string]interface{}) (token string) {
|
|
|
+func GetSellerToken(uId, sName string, sid string, desc map[string]interface{}) (token string) {
|
|
|
bytes, _ := json.Marshal(desc)
|
|
|
- return encrypt.SE.Encode2Hex(fmt.Sprintf("uid=%s&sName=%s&sid=%d&desc=%s&t=%d", uId, sName, sid, string(bytes), time.Now().Unix()))
|
|
|
+ return encrypt.SE.Encode2Hex(fmt.Sprintf("uid=%s&sName=%s&sid=%s&desc=%s&t=%d", uId, sName, sid, string(bytes), time.Now().Unix()))
|
|
|
}
|
|
|
|
|
|
type MessageRet struct {
|