hanjing před 6 roky
rodič
revize
b649b4794b

+ 3 - 0
app/src/developSheeptest/java/com/sheep/jiuyan/samllsheep/wxapi/WXEntryActivity.java

@@ -4,6 +4,7 @@ import android.content.Intent;
 import android.os.Bundle;
 
 import com.sheep.gamegroup.event.WXLoginAuthEvent;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.jiuyan.samllsheep.wxutil.WXAPIUtil;
 import com.tencent.mm.opensdk.modelbase.BaseResp;
 import com.tencent.mm.opensdk.modelmsg.SendAuth;
@@ -30,9 +31,11 @@ public class WXEntryActivity extends WXCallbackActivity {
     public void onResp(BaseResp resp) {
         if (resp instanceof SendAuth.Resp) {
             if (resp.errCode == BaseResp.ErrCode.ERR_OK) {
+                LogUtil.logI("wx auth ok");
                 String code = ((SendAuth.Resp) resp).code;
                 EventBus.getDefault().post(new WXLoginAuthEvent(code));
             } else{
+                LogUtil.logI("wx auth error");
                 EventBus.getDefault().post(new WXLoginAuthEvent(null));
             }
         } else {

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

@@ -33,6 +33,7 @@ import com.sheep.gamegroup.util.ChannelContent;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.FastJsonUtils;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.LogUtil;
 import com.sheep.gamegroup.util.PreferenceUtils;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.UMConfigUtils;
@@ -305,6 +306,7 @@ public class LoginAct extends BaseUMActivity implements LoginController {
     public void whenWXUserAuth(WXLoginAuthEvent ev) {
         if (TextUtils.isEmpty(ev.code)) {
             G.showToast("微信授权失败");
+            LogUtil.logI("wx auth result failed");
         } else {
             WXAPIUtil.loadWXUserToken(ev.code, (ret, openId, token) -> {
                 if (ret) {

+ 2 - 0
app/src/main/java/com/sheep/jiuyan/samllsheep/wxutil/WXAPIUtil.java

@@ -60,6 +60,7 @@ public class WXAPIUtil {
 
                     @Override
                     public void onResponse(String response, int id) {
+                        LogUtil.logI("wx auth "+response);
                         JSONObject resp = JSONObject.parseObject(response);
                         callback.callback(true, resp.getString("openid"), resp.getString("access_token"));
                     }
@@ -75,6 +76,7 @@ public class WXAPIUtil {
                     @Override
                     public void onError(Call call, Exception e, int id) {
                         callback.callback(false, null);
+                        LogUtil.logI("wx auth userinfo error");
                     }
 
                     @Override