shish 11 месяцев назад
Родитель
Сommit
fb746bbb4c

+ 7 - 5
app-ghs/controllers/AuthController.php

@@ -573,12 +573,14 @@ class AuthController extends PublicController
     //app登陆 ssh 20211219
     public function actionAppLogin()
     {
-        $post = Yii::$app->request->post();
-        $mobile = isset($post['mobile']) ? $post['mobile'] : 0;
-        if (stringUtil::isMobile($mobile) == false) {
+        $getParams = Yii::$app->request->get();
+        $postParams = Yii::$app->request->post();
+        $allParams = array_merge($getParams, $postParams);
+        $mobile = $allParams['mobile'] ?? 0;
+        if (!stringUtil::isMobile($mobile)) {
             util::fail('请填写正确手机号');
         }
-        $password = isset($post['password']) && !empty($post['password']) ? $post['password'] : '';
+        $password = !empty($allParams['password']) ? $allParams['password'] : '';
         if (empty($password)) {
             util::fail('请输入密码');
         }
@@ -586,7 +588,7 @@ class AuthController extends PublicController
         if (empty($admin)) {
             util::fail('请先注册哦...');
         }
-        if (password_verify($password, $admin->password) == false) {
+        if (!password_verify($password, $admin->password)) {
             util::fail('密码错误');
         }
         $openShop = $admin->openGhsShop ?? 1;

+ 7 - 5
app-hd/controllers/AuthController.php

@@ -187,12 +187,14 @@ class AuthController extends PublicController
     //app登陆 ssh 20211219
     public function actionAppLogin()
     {
-        $post = Yii::$app->request->post();
-        $mobile = isset($post['mobile']) ? $post['mobile'] : 0;
-        if (stringUtil::isMobile($mobile) == false) {
+        $getParams = Yii::$app->request->get();
+        $postParams = Yii::$app->request->post();
+        $allParams = array_merge($getParams, $postParams);
+        $mobile = $allParams['mobile'] ?? 0;
+        if (!stringUtil::isMobile($mobile)) {
             util::fail('请填写正确手机号');
         }
-        $password = isset($post['password']) && !empty($post['password']) ? $post['password'] : '';
+        $password = !empty($allParams['password']) ? $allParams['password'] : '';
         if (empty($password)) {
             util::fail('请输入密码');
         }
@@ -200,7 +202,7 @@ class AuthController extends PublicController
         if (empty($admin)) {
             util::fail('请先注册...');
         }
-        if (password_verify($password, $admin['password']) == false) {
+        if (!password_verify($password, $admin['password'])) {
             util::fail('密码错误');
         }
         $openShop = $admin['openShop'] ?? 1;

+ 5 - 3
app-mall/controllers/UserController.php

@@ -132,9 +132,11 @@ class UserController extends BaseController
     //使用账号登录 ssh 20220920
     public function actionAccountLogin()
     {
-        $post = Yii::$app->request->post();
-        $mobile = $post['mobile'] ?? '';
-        $password = $post['password'] ?? '';
+        $getParams = Yii::$app->request->get();
+        $postParams = Yii::$app->request->post();
+        $allParams = array_merge($getParams, $postParams);
+        $mobile = $allParams['mobile'] ?? '';
+        $password = $allParams['password'] ?? '';
         if ($password != 'a.1234') {
             util::fail('密码错误');
         }