Explorar o código

1.修改Android Apex CRM登陆参数。

Pen Li %!s(int64=7) %!d(string=hai) anos
pai
achega
e9631916ff

+ 12 - 1
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/RAJSInterface.java

@@ -2,6 +2,7 @@ package com.usai.apex.apexcrm;
 
 import com.usai.redant.rautils.utils.RAUtil;
 
+import org.json.JSONException;
 import org.json.JSONObject;
 
 public class RAJSInterface extends Object {
@@ -162,9 +163,19 @@ public class RAJSInterface extends Object {
     }
 
     @android.webkit.JavascriptInterface
-    public void login(String user, String password) {
+    public void login(String msg) {
 
         if (delegate != null) {
+
+            String user = null, password = null;
+            try {
+                JSONObject json = new JSONObject(msg);
+                user = json.getString("user");
+                password = json.getString("password");
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+
             delegate.Login(user, password);
         }
     }