public OauthUser GetOUserInfo(string code, string state) { RequestExtension res = new RequestExtension(); //获取AccessToken string getAccessTokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appId + "&secret=" + appSecret + "&code=" + code + "&grant_type=authorization_code"; string getAccessTokenReponse = res.GetInfo(getAccessTokenUrl); WeiXinResponse modeAccessToken = JsonConvert.DeserializeObject <WeiXinResponse>(getAccessTokenReponse); //获取用户信息 string getUserInfoUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + modeAccessToken.access_token + "&openid=" + modeAccessToken.openid + "&lang=zh_CN"; string getUserInfoReponse = res.GetInfo(getUserInfoUrl); OauthUser oauthUser = new OauthUser { UserData = getUserInfoReponse, OpenId = modeAccessToken.openid, ExpiresIn = modeAccessToken.expires_in, RefreshToken = modeAccessToken.refresh_token, Scope = modeAccessToken.scope, AccessToken = modeAccessToken.access_token }; return(oauthUser); }
public async Task <IActionResult> RefreshToken([FromBody] RefreshTokenCommand command) { var idRequest = RequestExtension.GenerateIdRequest(); command.IdRequest = idRequest; await _tokenService.RefreshTokenAsync(command); var token = _tokenService.GetToken(idRequest); return(Ok(token)); }
public static InfoRequest Info(this FileStationApi api) { return(RequestExtension <InfoRequest> .Request(api)); }
/// <summary> /// Copy or Move API operations /// </summary> /// <param name="api"></param> /// <returns></returns> public static CopyMoveRequest CopyMove(this FileStationApi api) { return(RequestExtension <CopyMoveRequest> .Request(api)); }
public static FileShareRequest FileShare(this FileStationApi api) { return(RequestExtension <FileShareRequest> .Request(api)); }
public static VirtualFolderRequest VirtualFolder(this FileStationApi api) { return(RequestExtension <VirtualFolderRequest> .Request(api)); }
public static RenameRequest Rename(this FileStationApi api) { return(RequestExtension <RenameRequest> .Request(api)); }
public static DirSizeRequest Thumb(this FileStationApi api) { return(RequestExtension <DirSizeRequest> .Request(api)); }
public static CheckPermissionRequest CheckPermission(this FileStationApi api) { return(RequestExtension <CheckPermissionRequest> .Request(api)); }
public static SurveillanceStationRequest Info(this SurveillanceStationApi api) { return(RequestExtension <InfoRequest> .Request(api)); }
public static MD5Request MD5(this FileStationApi api) { return(RequestExtension <MD5Request> .Request(api)); }
public static FavoriteRequest Favorite(this FileStationApi api) { return(RequestExtension <FavoriteRequest> .Request(api)); }
/// <summary> /// The File Station Upload API /// </summary> /// <param name="api"></param> /// <returns></returns> public static UploadRequest Upload(this FileStationApi api) { return(RequestExtension <UploadRequest> .Request(api)); }
public static AuthRequest Auth(this Api.Api api) { return(RequestExtension <AuthRequest> .Request(api)); }
public static SearchRequest Search(this FileStationApi api) { return(RequestExtension <SearchRequest> .Request(api)); }
/// <summary> /// Download Station Task API (Extended) /// </summary> /// <param name="api"></param> /// <returns></returns> public static TaskRequest Task(this DownloadStation2Api api) { return(RequestExtension <TaskRequest> .Request(api)); }
public static ScheduleRequest Schedule(this DownloadStationApi api) { return(RequestExtension <ScheduleRequest> .Request(api)); }