hanjing 6 rokov pred
rodič
commit
0485673e4c

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

@@ -20,4 +20,18 @@ public class WXEntryActivity extends WXCallbackActivity {
         finish();
     }
 
+    @Override
+    public void onResp(BaseResp resp) {
+        if (resp instanceof SendAuth.Resp) {
+            if (resp.errCode == BaseResp.ErrCode.ERR_OK) {
+                String code = ((SendAuth.Resp) resp).code;
+                EventBus.getDefault().post(new WXLoginAuthEvent(code));
+            } else{
+                EventBus.getDefault().post(new WXLoginAuthEvent(null));
+            }
+        } else {
+            super.onResp(resp);
+        }
+    }
+
 }

+ 13 - 0
app/src/sheeptestjiguang/java/com/sheep/jiuyan/samllsheep/test/wxapi/WXEntryActivity.java

@@ -20,5 +20,18 @@ public class WXEntryActivity extends WXCallbackActivity {
         finish();
     }
 
+    @Override
+    public void onResp(BaseResp resp) {
+        if (resp instanceof SendAuth.Resp) {
+            if (resp.errCode == BaseResp.ErrCode.ERR_OK) {
+                String code = ((SendAuth.Resp) resp).code;
+                EventBus.getDefault().post(new WXLoginAuthEvent(code));
+            } else{
+                EventBus.getDefault().post(new WXLoginAuthEvent(null));
+            }
+        } else {
+            super.onResp(resp);
+        }
+    }
 
 }