Просмотр исходного кода

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

Pen Li 7 лет назад
Родитель
Сommit
e9631916ff
1 измененных файлов с 12 добавлено и 1 удалено
  1. 12 1
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/RAJSInterface.java

+ 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 com.usai.redant.rautils.utils.RAUtil;
 
 
+import org.json.JSONException;
 import org.json.JSONObject;
 import org.json.JSONObject;
 
 
 public class RAJSInterface extends Object {
 public class RAJSInterface extends Object {
@@ -162,9 +163,19 @@ public class RAJSInterface extends Object {
     }
     }
 
 
     @android.webkit.JavascriptInterface
     @android.webkit.JavascriptInterface
-    public void login(String user, String password) {
+    public void login(String msg) {
 
 
         if (delegate != null) {
         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);
             delegate.Login(user, password);
         }
         }
     }
     }