|
@@ -14,6 +14,7 @@ import com.alibaba.ailabs.genie.authservice.api.IRequestPermissionListener;
|
|
|
import com.alibaba.ailabs.genie.authservice.api.IRequestPermissions;
|
|
|
import com.alibaba.genie.waft.gcs.rpc.GenieServiceLoader;
|
|
|
import com.edufound.reader.activity.LoginAlertActivity;
|
|
|
+import com.edufound.reader.apiserver.OrderApiServerImpl;
|
|
|
import com.edufound.reader.apiserver.UserApiServerImpl;
|
|
|
import com.edufound.reader.bean.HttpResultBean;
|
|
|
import com.edufound.reader.bean.UserBean;
|
|
@@ -43,6 +44,7 @@ import java.util.Map;
|
|
|
public class TMailSDKUtil {
|
|
|
|
|
|
public static void TMailLogin(Context context) {
|
|
|
+ Logger.e("调用天猫登录放大----TMailLogin");
|
|
|
UserApiServerImpl mUserApi = new UserApiServerImpl();
|
|
|
String genieAppType = "NATIVE";
|
|
|
String genieAppIdentifier = TMailConstants.appSecret;
|
|
@@ -50,8 +52,7 @@ public class TMailSDKUtil {
|
|
|
permissions.add("profile:phone_number:read");
|
|
|
// //Step1 获取授权服务的RPC引用 -- 注意如果此时方法返回null,说明系统中没有授权服务模块,请升级系统版本
|
|
|
IRequestPermissions requestPermissions = GenieServiceLoader.load(IRequestPermissions.class);
|
|
|
-//
|
|
|
-//
|
|
|
+ Logger.e("requestPermissions==null???---" + (requestPermissions == null));
|
|
|
if (requestPermissions == null) {
|
|
|
Logger.e("没有授权服务模块,请升级系统版本");
|
|
|
return;
|
|
@@ -59,9 +60,9 @@ public class TMailSDKUtil {
|
|
|
//Step2 调用查询授权接口
|
|
|
AuthProtocolParameters authProtocolParameters = new AuthProtocolParameters(genieAppType, genieAppIdentifier, permissions);
|
|
|
if (requestPermissions != null) {
|
|
|
+ Logger.e("不是空的,调用了");
|
|
|
try {
|
|
|
requestPermissions.requestPermissions(authProtocolParameters, new IRequestPermissionListener() {
|
|
|
-
|
|
|
@Override
|
|
|
public void authServiceResponse(AuthResponse authResponse) {
|
|
|
Logger.e(" authResponse = " + authResponse);
|
|
@@ -92,6 +93,22 @@ public class TMailSDKUtil {
|
|
|
Consts.setmConstsUserBean(bean.getData());
|
|
|
Consts.setUID(bean.getData().getUid());
|
|
|
Toast.makeText(context, "登录成功", Toast.LENGTH_SHORT).show();
|
|
|
+ OrderApiServerImpl orderApiServer = new OrderApiServerImpl();
|
|
|
+ orderApiServer.getAuth(new Callback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(HttpInfo info) throws IOException {
|
|
|
+ HttpResultBean<String> bean = info.getRetDetail(new TypeToken<HttpResultBean<String>>() {
|
|
|
+ }.getType());
|
|
|
+ Logger.e(" info.getRetDetail():" + info.getRetDetail());
|
|
|
+ Logger.e("bean.getData():" + bean.getData());
|
|
|
+ Consts.setIsYFVip(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFailure(HttpInfo info) throws IOException {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -106,11 +123,16 @@ public class TMailSDKUtil {
|
|
|
context.startActivity(tologin);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ Logger.e("不是空的,但是异常了=" + e.getMessage());
|
|
|
}
|
|
|
+ } else {
|
|
|
+ Logger.e("空的,别调用了");
|
|
|
}
|
|
|
|
|
|
Intent intent = new Intent();
|