Exemplo n.º 1
0
        private static UserTokenResp GenerateUserToken(UserInfoBigMo user, MemberAuthorizeType authType)
        {
            var tokenStr = string.Concat(user.id, "|", (int)authType, "|", DateTime.Now.ToUtcSeconds());
            var token    = MemberShiper.GetToken(tokenSecret, tokenStr);

            return(new UserTokenResp()
            {
                token = token, user = user.ConvertToMo()
            });
        }
Exemplo n.º 2
0
        public static ResultMo <string> AppendToken(string appSource, long id, MemberAuthorizeType authType)
        {
            var secreateKeyRes = ApiSourceKeyUtil.GetAppSecretKey(appSource);

            if (!secreateKeyRes.IsSuccess)
            {
                return(secreateKeyRes.ConvertToResultOnly <string>());
            }

            var tokenCon = string.Concat(id, "|", (int)authType, "|", DateTime.Now.ToUtcSeconds());

            return(new ResultMo <string>(MemberShiper.GetToken(secreateKeyRes.Data, tokenCon)));
        }