feat: 添加 获取国密加密方法
parent
6a3c0d80f3
commit
f13de520ef
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// MOP_smsign.h
|
||||
// mop
|
||||
//
|
||||
// Created by beetle_92 on 2021/4/21.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MOPBaseApi.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MOP_smsign : MOPBaseApi
|
||||
|
||||
@property (nonatomic, copy) NSString *plainText;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// MOP_smsign.m
|
||||
// mop
|
||||
//
|
||||
// Created by beetle_92 on 2021/4/21.
|
||||
//
|
||||
|
||||
#import "MOP_smsign.h"
|
||||
#import <FinApplet/FinApplet.h>
|
||||
|
||||
@implementation MOP_smsign
|
||||
|
||||
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
|
||||
{
|
||||
NSLog(@"smsign");
|
||||
NSString *signature = [[FATClient sharedClient] getSM3String:self.plainText];
|
||||
NSLog(@"signature = %@", signature);
|
||||
success(@{@"data": signature});
|
||||
}
|
||||
|
||||
@end
|
|
@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
|
|||
s.dependency 'Flutter'
|
||||
s.ios.deployment_target = '9.0'
|
||||
|
||||
s.dependency 'FinApplet' , '2.24.3'
|
||||
s.dependency 'FinAppletExt' , '2.24.3'
|
||||
s.dependency 'FinApplet' , '2.25.0-alpha20210421v01'
|
||||
s.dependency 'FinAppletExt' , '2.25.0-alpha20210421v01'
|
||||
end
|
||||
|
||||
|
|
|
@ -195,4 +195,13 @@ class Mop {
|
|||
_extensionApis[name] = handler;
|
||||
_channel.invokeMethod("registerExtensionApi", {"name": name});
|
||||
}
|
||||
|
||||
/// 获取国密加密
|
||||
Future<String> getSMSign(String plainText) async {
|
||||
var result =
|
||||
await _channel.invokeMapMethod("smsign", {'plainText': plainText});
|
||||
var data = result['data']['data'];
|
||||
print(data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue