Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 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));
 }
Esempio n. 6
0
 public static VirtualFolderRequest VirtualFolder(this FileStationApi api)
 {
     return(RequestExtension <VirtualFolderRequest> .Request(api));
 }
Esempio n. 7
0
 public static RenameRequest Rename(this FileStationApi api)
 {
     return(RequestExtension <RenameRequest> .Request(api));
 }
 public static DirSizeRequest Thumb(this FileStationApi api)
 {
     return(RequestExtension <DirSizeRequest> .Request(api));
 }
Esempio n. 9
0
 public static CheckPermissionRequest CheckPermission(this FileStationApi api)
 {
     return(RequestExtension <CheckPermissionRequest> .Request(api));
 }
Esempio n. 10
0
 public static SurveillanceStationRequest Info(this SurveillanceStationApi api)
 {
     return(RequestExtension <InfoRequest> .Request(api));
 }
 public static MD5Request MD5(this FileStationApi api)
 {
     return(RequestExtension <MD5Request> .Request(api));
 }
Esempio n. 12
0
 public static FavoriteRequest Favorite(this FileStationApi api)
 {
     return(RequestExtension <FavoriteRequest> .Request(api));
 }
Esempio n. 13
0
 /// <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));
 }
Esempio n. 14
0
 public static AuthRequest Auth(this Api.Api api)
 {
     return(RequestExtension <AuthRequest> .Request(api));
 }
Esempio n. 15
0
 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));
 }