Example #1
0
 public platforminfo RegisterPlatformSession(OAuth2Base oa,string code,long UID)
 {
     if (oa != null && oa.Authorize(code))
     {
         switch (oa.Server)
         {
             case Mappings.PlatForm.SinaWeiBo:
                 return this.RegisterSinaWeiboPlatform(oa, UID);
             case Mappings.PlatForm.QQ:
                 return this.RegisterQQWeiboPlatform(oa, UID);
             default:
                 return null;
         }
     }
     if(oa==null)
         throw new NullReferenceException("oa 为null");
     throw new Exception("认证失败");
 }
Example #2
0
 public userinfo RegisterTaoBaoSession(OAuth2Base oa,string code)
 {
     if(!string.IsNullOrEmpty(code)&&oa!=null)
     {
         if(oa.Authorize(code))
         {
             string sessionKey;
             if (oa.Server==Mappings.PlatForm.TaoBao)
             {
                 var tbInfo = this.RegisterTaoBaoSession(oa);
                 if (tbInfo != null) return tbInfo;
             }
         }
     }
     return null;
 }