瀏覽代碼

聚财登录补充

sugangqiang 2 年之前
父節點
當前提交
1c5e2945fa
共有 1 個文件被更改,包括 19 次插入14 次删除
  1. 19 14
      app/common/api/UserApi.php

+ 19 - 14
app/common/api/UserApi.php

@@ -65,23 +65,28 @@ class UserApi {
     }
 
     public function checkPwd() {
-        if (!$this->_checkPwd() && $this->usertype == 2 && in_array($this->info["source"], [1, 2])) {
-            //source3是新系统注册,企业号登录密码不正确时,验证一下是不是聚财账号
-            if ($this->info["source"] == 1) {
-                if (!$this->info["jUsername"]) {
-                    return false;
+        if ($this->_checkPwd()) {
+            return true;
+        } else {
+            if ($this->usertype == 2 && in_array($this->info["source"], [1, 2])) {
+                //source3是新系统注册,企业号登录密码不正确时,验证一下是不是聚财账号
+                if ($this->info["source"] == 1) {
+                    if (!$this->info["jUsername"]) {
+                        return false;
+                    }
                 }
-            }
-            try {
-                $res = JucaiApi::login($this->username, $this->password, 1);
-                $resObj = json_decode($res);
-                if ($resObj->state == 1) {
-                    return true;
+                try {
+                    $res = JucaiApi::login($this->username, $this->password, 1);
+                    $resObj = json_decode($res);
+                    if ($resObj->state == 1) {
+                        return true;
+                    }
+                    return false;
+                } catch (think\exception $e) {
+                    return false;
                 }
-                return false;
-            } catch (think\exception $e) {
-                return false;
             }
+            return false;
         }
     }