/// <summary> /// 获取处理Adapter /// </summary> /// <param name="plat">平台类型</param> /// <returns></returns> public static IOauthAdapter GetAdapter(OauthPlatform plat) { // todo 处理配置 switch (plat) { case OauthPlatform.WeChat: return(GetWeChatAdapter()); } throw new ArgumentException("未实现的Oauth授权平台"); }
public static SocialPlatform ToSocialPlat(this OauthPlatform oauthPlat) { switch (oauthPlat) { case OauthPlatform.WeChat: return(SocialPlatform.WeChat); case OauthPlatform.AliPay: return(SocialPlatform.AliPay); case OauthPlatform.Sina: return(SocialPlatform.Sina); case OauthPlatform.WeChatApp: return(SocialPlatform.WeChatApp); default: return(SocialPlatform.None); } }