diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index 87ca655..7434614 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -52,10 +52,19 @@ MobSDK {
bypassApproval false
enable true
}
+ Wechat {
+ appId "wx598aaef252cd78e4"
+ appSecret "d2fc2edf9ece746765b3bfc0bf1b230e"
+ withShareTicket true
+ bypassApproval false
+ enable true
+ }
WechatMoments {
+ bypassApproval false
enable true
}
WechatFavorite {
+ bypassApproval false
enable true
}
QZone {
@@ -78,6 +87,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "cn.zhios.zhiying"
+// applicationId "cn.sharesdk.demo"
minSdkVersion 19
targetSdkVersion 28
aaptOptions.cruncherEnabled = false
@@ -89,6 +99,12 @@ android {
}
signingConfigs{
+ config {
+ keyAlias 'demokey.keystore'
+ keyPassword '123456'
+ storeFile file('demokey.keystore')
+ storePassword '123456'
+ }
release {
storeFile file("zhiying.jks")
storePassword "zhioscom"
diff --git a/example/android/app/demokey.keystore b/example/android/app/demokey.keystore
new file mode 100755
index 0000000..e63ea63
Binary files /dev/null and b/example/android/app/demokey.keystore differ
diff --git a/example/ios/Runner/Runner.entitlements b/example/ios/Runner/Runner.entitlements
new file mode 100644
index 0000000..a812db5
--- /dev/null
+++ b/example/ios/Runner/Runner.entitlements
@@ -0,0 +1,10 @@
+
+
+
+
+ com.apple.developer.applesignin
+
+ Default
+
+
+
diff --git a/lib/models/base/base_tab_model.dart b/lib/models/base/base_tab_model.dart
index 3b98063..09136e7 100644
--- a/lib/models/base/base_tab_model.dart
+++ b/lib/models/base/base_tab_model.dart
@@ -29,7 +29,7 @@ class BaseTabModel extends SkipModel {
chooseIcon = json['choose_icon'];
cateTag = json['cate_tag'];
skipIdentifier = json['skip_identifier'];
- requiredLogin = json['required_login'];
+ requiredLogin = json['required_login']?.toString();
requiredTaobaoAuth = json['required_taobao_auth'];
bgColor = json['bg_color'];
fontColor = json['font_color'];
diff --git a/lib/models/base/skip_model.dart b/lib/models/base/skip_model.dart
index d00d068..e60e8d2 100644
--- a/lib/models/base/skip_model.dart
+++ b/lib/models/base/skip_model.dart
@@ -16,8 +16,8 @@ class SkipModel {
void fromJson(Map json) {
url = json['url'];
- requiredLogin = json['required_login'];
- requiredTaobaoAuth = json['required_taobao_auth'];
+ requiredLogin = json['required_login']?.toString();
+ requiredTaobaoAuth = json['required_taobao_auth']?.toString();
skipIdentifier = json['skip_identifier'];
}
diff --git a/lib/models/user/user_info_model_notifier.dart b/lib/models/user/user_info_model_notifier.dart
index 95cb760..e5313ab 100644
--- a/lib/models/user/user_info_model_notifier.dart
+++ b/lib/models/user/user_info_model_notifier.dart
@@ -77,6 +77,8 @@ class UserInfoNotifier with ChangeNotifier {
FlutterAlibc.loginOut();
// 退出QQ登录
MobUtil.cancelQQAuth();
+ // 退出微信登录
+ MobUtil.cancelWeChatAuth();
notifyListeners();
}
diff --git a/lib/pages/login_page/bind/bloc/login_bind_phone_repository.dart b/lib/pages/login_page/bind/bloc/login_bind_phone_repository.dart
index dcc092d..f33a8ab 100644
--- a/lib/pages/login_page/bind/bloc/login_bind_phone_repository.dart
+++ b/lib/pages/login_page/bind/bloc/login_bind_phone_repository.dart
@@ -58,7 +58,22 @@ class LoginBindPhoneRepository {
/// 苹果登录
if(GlobalConfig.LOGIN_THIRD_APPLE == third){
+ // identityTokenStr
+ Map appleParam = {};
+ appleParam['token'] = data['identityTokenStr'];
+ params['apple'] = appleParam;
+ }
+ /// 微信登录
+ if(GlobalConfig.LOGIN_THIRD_WECHAT == third){
+ Map qqParam = {};
+ qqParam['nickname'] = data['nickname']?.toString();
+ qqParam['gender'] = data['gender']?.toString();
+ qqParam['avatar_url'] = data['avatar_url']?.toString();
+ qqParam['open_id'] = data['open_id']?.toString();
+ qqParam['token'] = data['token']?.toString();
+ qqParam['unionid'] = data['unionid']?.toString();
+ params['wechat'] = qqParam;
}
/// QQ登录
diff --git a/lib/pages/login_page/bloc/login_bloc.dart b/lib/pages/login_page/bloc/login_bloc.dart
index b1ba58c..2d2b607 100644
--- a/lib/pages/login_page/bloc/login_bloc.dart
+++ b/lib/pages/login_page/bloc/login_bloc.dart
@@ -73,7 +73,14 @@ class LoginBloc extends Bloc {
}
/// 微信登录
- Stream _mapLoginWeChatEventToState(LoginThirdWeChatEvent event) async* {}
+ Stream _mapLoginWeChatEventToState(LoginThirdWeChatEvent event) async* {
+ var result = await repository.weChatLogin(event?.model);
+ if(!EmptyUtil.isEmpty(result)){
+ yield LoginThirdLoginSuccessState(model: result, thirdType: GlobalConfig.LOGIN_THIRD_WECHAT);
+ }else{
+ yield LoginThirdLoginErrorState();
+ }
+ }
/// QQ 登录
Stream _mapLoginQQEventToState(LoginThirdQQEvent event) async* {
@@ -86,5 +93,12 @@ class LoginBloc extends Bloc {
}
/// 苹果登录
- Stream _mapLoginAppleEventToState(LoginThirdAppleEvent event) async* {}
+ Stream _mapLoginAppleEventToState(LoginThirdAppleEvent event) async* {
+ var result = await repository.appleLogin(identityToken: event.identityToken);
+ if(!EmptyUtil.isEmpty(result)){
+ yield LoginThirdLoginSuccessState(model: result, thirdType: GlobalConfig.LOGIN_THIRD_APPLE);
+ }else{
+ yield LoginThirdLoginErrorState();
+ }
+ }
}
diff --git a/lib/pages/login_page/bloc/login_event.dart b/lib/pages/login_page/bloc/login_event.dart
index 0750294..ee32698 100644
--- a/lib/pages/login_page/bloc/login_event.dart
+++ b/lib/pages/login_page/bloc/login_event.dart
@@ -30,10 +30,20 @@ class LoginThirdAliEvent extends LoginEvent {
}
/// 第三方登录:苹果登录
-class LoginThirdAppleEvent extends LoginEvent {}
+class LoginThirdAppleEvent extends LoginEvent {
+ final String identityToken;
+ LoginThirdAppleEvent({@required this.identityToken});
+ @override
+ List