Skip to content

Commit

Permalink
修改成功回调
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkkkkkkkkkkkkeee committed Jul 26, 2019
1 parent 1b2b549 commit c61614c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ios/Classes/TencentCosPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[data setValue:cosPath forKey:@"cosPath"];
if(error.code == 0){
[self.channel invokeMethod:@"onSuccess" arguments:data];
result(@"onSuccess");
}else{
[data setValue: error.domain forKey:@"message"];
result(FlutterMethodNotImplemented);
[self.channel invokeMethod:@"onFailed" arguments:data];
}

Expand Down
4 changes: 2 additions & 2 deletions lib/tencent_cos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flutter/services.dart';
class TencentCos {
static const MethodChannel _channel = const MethodChannel('tencent_cos');

static Future<Map<String, dynamic>> uploadByFile(
static Future<dynamic> uploadByFile(
String region,
String appid,
String bucket,
Expand All @@ -15,7 +15,7 @@ class TencentCos {
expiredTime,
String cosPath,
String localPath) {
return _channel.invokeMapMethod<String, dynamic>('TencentCos.uploadFile', {
return _channel.invokeMethod<dynamic>('TencentCos.uploadFile', {
'region': region,
'appid': appid,
'bucket': bucket,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tencent_cos
description: 腾讯云cos插件,用于上传图片
version: 0.1.3
version: 0.1.4
author: zhangruiyu <[email protected]>
homepage: https://github.com/zhangruiyu/tencent_cos

Expand Down

0 comments on commit c61614c

Please sign in to comment.