|
|
@@ -5,6 +5,7 @@ import (
|
|
|
"encoding/json"
|
|
|
)
|
|
|
|
|
|
+//GetUserID 临时的,account 新版本为accountid
|
|
|
func GetUserID(c context.Context) int64 {
|
|
|
userID := c.Value("user_id")
|
|
|
if _, ok := userID.(int64); ok {
|
|
|
@@ -13,6 +14,23 @@ func GetUserID(c context.Context) int64 {
|
|
|
return 0
|
|
|
}
|
|
|
|
|
|
+func GetAccountID(c context.Context) int64 {
|
|
|
+ accountID := c.Value("account_id")
|
|
|
+ if _, ok := accountID.(int64); ok {
|
|
|
+ return accountID.(int64)
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+//GetMemberID 临时的,account 新版本为userid
|
|
|
+func GetMemberID(c context.Context) int64 {
|
|
|
+ userID := c.Value("mem_id")
|
|
|
+ if _, ok := userID.(int64); ok {
|
|
|
+ return userID.(int64)
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
func GetAuthToken(c context.Context) string {
|
|
|
token := c.Value("token")
|
|
|
if _, ok := token.(string); ok {
|