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

帐户名、密码登录接口统一替换为 Post 接收请求,杜绝 Get 明文在 URL 中显示帐户与密码

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

+ 3 - 3
app-ghs/controllers/AuthController.php

@@ -573,12 +573,12 @@ class AuthController extends PublicController
     //app登陆 ssh 20211219
     public function actionAppLogin()
     {
-        $get = Yii::$app->request->get();
-        $mobile = isset($get['mobile']) ? $get['mobile'] : 0;
+        $post = Yii::$app->request->post();
+        $mobile = isset($post['mobile']) ? $post['mobile'] : 0;
         if (stringUtil::isMobile($mobile) == false) {
             util::fail('请填写正确手机号');
         }
-        $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : '';
+        $password = isset($post['password']) && !empty($post['password']) ? $post['password'] : '';
         if (empty($password)) {
             util::fail('请输入密码');
         }

+ 3 - 3
app-hd/controllers/AuthController.php

@@ -187,12 +187,12 @@ class AuthController extends PublicController
     //app登陆 ssh 20211219
     public function actionAppLogin()
     {
-        $get = Yii::$app->request->get();
-        $mobile = isset($get['mobile']) ? $get['mobile'] : 0;
+        $post = Yii::$app->request->post();
+        $mobile = isset($post['mobile']) ? $post['mobile'] : 0;
         if (stringUtil::isMobile($mobile) == false) {
             util::fail('请填写正确手机号');
         }
-        $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : '';
+        $password = isset($post['password']) && !empty($post['password']) ? $post['password'] : '';
         if (empty($password)) {
             util::fail('请输入密码');
         }

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

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