|
|
@@ -32,10 +32,10 @@ import com.alibaba.alibcprotocol.param.AlibcShowParams; |
|
|
|
import com.alibaba.alibcprotocol.param.AlibcTaokeParams; |
|
|
|
import com.alibaba.alibcprotocol.route.proxy.IAlibcLoginProxy; |
|
|
|
import com.baichuan.nb_trade.AlibcTrade; |
|
|
|
import com.baichuan.nb_trade.auth.TopAuth; |
|
|
|
import com.baichuan.nb_trade.callback.AlibcTradeInitCallback; |
|
|
|
import com.baichuan.nb_trade.callback.AuthCallback; |
|
|
|
import com.baichuan.nb_trade.core.AlibcTradeSDK; |
|
|
|
import com.randy.alibcextend.auth.AuthCallback; |
|
|
|
import com.randy.alibcextend.auth.TopAuth; |
|
|
|
import com.ut.device.UTDevice; |
|
|
|
import com.wxwx.flutter_alibc.web.WebViewActivity; |
|
|
|
|
|
|
@@ -119,16 +119,20 @@ public class FlutterAlibcHandle { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onSuccess(String s, String s1) { |
|
|
|
Map<String, Object> userInfo = new HashMap<>(); |
|
|
|
try { |
|
|
|
Map<String, Object> userInfo = new HashMap<>(); |
|
|
|
// Session session = AlibcLogin.getInstance().getSession(); |
|
|
|
Session session = new LoginServiceImpl().getSession(); |
|
|
|
userInfo.put("nick", session.nick); |
|
|
|
userInfo.put("avatarUrl", session.avatarUrl); |
|
|
|
userInfo.put("openId", session.openId); |
|
|
|
userInfo.put("openSid", session.openSid); |
|
|
|
userInfo.put("topAccessToken", session.topAccessToken); |
|
|
|
userInfo.put("topAuthCode", session.topAuthCode); |
|
|
|
result.success(PluginResponse.success(userInfo).toMap()); |
|
|
|
Session session = new LoginServiceImpl().getSession(); |
|
|
|
userInfo.put("nick", session.nick); |
|
|
|
userInfo.put("avatarUrl", session.avatarUrl); |
|
|
|
userInfo.put("openId", session.openId); |
|
|
|
userInfo.put("openSid", session.openSid); |
|
|
|
userInfo.put("topAccessToken", session.topAccessToken); |
|
|
|
userInfo.put("topAuthCode", session.topAuthCode); |
|
|
|
result.success(PluginResponse.success(userInfo).toMap()); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@@ -208,6 +212,7 @@ public class FlutterAlibcHandle { |
|
|
|
AlibcLogin.getInstance().showLogin(new AlibcLoginCallback() { |
|
|
|
@Override |
|
|
|
public void onSuccess(String s, String s1) { |
|
|
|
|
|
|
|
TopAuth.showAuthDialog(register.activity(), R.mipmap.ic_launcher, name, alibcAppKey, new AuthCallback() { |
|
|
|
@Override |
|
|
|
public void onSuccess(String accessToken, String expireTime) { |
|
|
@@ -313,7 +318,11 @@ public class FlutterAlibcHandle { |
|
|
|
// Intent intent = new Intent(register.context(), WebActivity.class); |
|
|
|
// intent.putExtra("url", (String) call.argument("url")); |
|
|
|
// register.activity().startActivityForResult(intent, 1111); |
|
|
|
taoKeLoginNew(call, result); |
|
|
|
try { |
|
|
|
taoKeLoginNew(call, result); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@@ -365,16 +374,24 @@ public class FlutterAlibcHandle { |
|
|
|
// results.put("paySuccessOrders", tradeResult.payResult.paySuccessOrders); |
|
|
|
// } |
|
|
|
// result.success(PluginResponse.success(results).toMap()); |
|
|
|
// } |
|
|
|
|
|
|
|
// @Override |
|
|
|
// public void onSuccess(int i) { |
|
|
|
// Map<String, Object> results = new HashMap<>(); |
|
|
|
// result.success(PluginResponse.success(results).toMap()); |
|
|
|
// } |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onSuccess(int i) { |
|
|
|
public void onSuccess(int i, Object o) { |
|
|
|
Log.d("错误", o.toString()); |
|
|
|
Map<String, Object> results = new HashMap<>(); |
|
|
|
result.success(PluginResponse.success(results).toMap()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailure(int code, String msg) { |
|
|
|
Log.d("错误", msg); |
|
|
|
result.success(new PluginResponse(Integer.toString(code), msg, null).toMap()); |
|
|
|
} |
|
|
|
}); |
|
|
@@ -450,10 +467,23 @@ public class FlutterAlibcHandle { |
|
|
|
// results.put("paySuccessOrders", tradeResult.payResult.paySuccessOrders); |
|
|
|
// } |
|
|
|
// result.success(PluginResponse.success(results).toMap()); |
|
|
|
// } |
|
|
|
|
|
|
|
// @Override |
|
|
|
// public void onSuccess(int i) { |
|
|
|
// Map<String, Object> results = new HashMap<>(); |
|
|
|
//// if (AlibcResultType.TYPECART == tradeResult.resultType) { |
|
|
|
//// results.put("type", 1); |
|
|
|
//// } else if (AlibcResultType.TYPEPAY == tradeResult.resultType) { |
|
|
|
//// results.put("type", 0); |
|
|
|
//// results.put("payFailedOrders", tradeResult.payResult.payFailedOrders); |
|
|
|
//// results.put("paySuccessOrders", tradeResult.payResult.paySuccessOrders); |
|
|
|
//// } |
|
|
|
// result.success(PluginResponse.success(results).toMap()); |
|
|
|
// } |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onSuccess(int i) { |
|
|
|
public void onSuccess(int i, Object o) { |
|
|
|
Map<String, Object> results = new HashMap<>(); |
|
|
|
// if (AlibcResultType.TYPECART == tradeResult.resultType) { |
|
|
|
// results.put("type", 1); |
|
|
@@ -492,7 +522,7 @@ public class FlutterAlibcHandle { |
|
|
|
} |
|
|
|
|
|
|
|
public void getUdid(MethodCall call, Result result1) { |
|
|
|
String udid = UTDevice.getUtdid(getApplicationContext()); |
|
|
|
String udid = UTDevice.getUtdid(getApplicationContext()); |
|
|
|
Map<String, String> resMap = new HashMap(); |
|
|
|
resMap.put("udid", udid); |
|
|
|
result1.success(resMap); |
|
|
|