46 lines
1.4 KiB
Objective-C
46 lines
1.4 KiB
Objective-C
//
|
|
// WeiIXinApiManager.m
|
|
// GIGA
|
|
//
|
|
// Created by lianxiang on 2018/8/27.
|
|
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
|
//
|
|
|
|
#import "WeiIXinApiManager.h"
|
|
|
|
@implementation WeiIXinApiManager
|
|
|
|
+(void)weixinAccessTokeRequstUrl:(NSString *)url parameters:(NSDictionary *)parameters success:(void (^)(id response))success
|
|
failure:(void (^)(NSError *err))failure
|
|
{
|
|
[self getrequstweiAPiUrl:url params:parameters success:success failure:failure];
|
|
}
|
|
|
|
+ (void)getWeiXinUserInfoUrl:(NSString *)url parameters:(NSDictionary *)parameters success:(void (^)(id))success failure:(void (^)(NSError *))failure
|
|
{
|
|
[self getrequstweiAPiUrl:url params:parameters success:success failure:failure];
|
|
|
|
}
|
|
|
|
+(void)getrequstweiAPiUrl:(NSString *)url params:(NSDictionary *)parameters success:(void (^)(id response))success
|
|
failure:(void (^)(NSError *err))failure
|
|
{
|
|
AFHTTPSessionManager*manager=[[AFHTTPSessionManager alloc] init];
|
|
manager.responseSerializer=[AFHTTPResponseSerializer serializer];
|
|
[manager GET:url parameters:parameters progress:^(NSProgress * _Nonnull downloadProgress) {
|
|
|
|
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
|
|
if (success) {
|
|
success(responseObject);
|
|
}
|
|
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
|
if (failure) {
|
|
failure(error);
|
|
}
|
|
|
|
}];
|
|
}
|
|
|
|
|
|
@end
|