shish vor 4 Jahren
Ursprung
Commit
b3b4002c12
2 geänderte Dateien mit 9 neuen und 35 gelöschten Zeilen
  1. 0 33
      app-mall/controllers/AuthController.php
  2. 9 2
      app-mall/controllers/UserController.php

+ 0 - 33
app-mall/controllers/AuthController.php

@@ -20,39 +20,6 @@ use yii\helpers\Json;
 class AuthController extends PublicController
 {
 
-    //微信手机号一键登录 ssh 20220607
-    public function actionWxMobileLogin()
-    {
-        $post = Yii::$app->request->post();
-        $iv = $post['iv'];
-        $encryptedData = $post['encryptedData'];
-        $merchant = WxOpenClass::getMallWxMiniBase();
-        $appId = $merchant['miniAppId'];
-        $miniOpenId = $post['miniOpenId'] ?? '';
-        if (empty($miniOpenId)) {
-            util::success(['hasNoOpenId' => 1], '登录失败');
-        }
-        $cacheKey = 'MALL_MINI_SESSION_KEY_' . $miniOpenId;
-        $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-        if (empty($sessionKey)) {
-            util::fail('登录失败了哦');
-        }
-        $wxMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret");
-        require_once($wxMiniSecret . '/wxBizDataCrypt.php');
-        $pc = new \WXBizDataCrypt($appId, $sessionKey);
-        $errCode = $pc->decryptData($encryptedData, $iv, $result);
-        if ($errCode != 0) {
-            util::fail('登录失败...');
-        }
-        $arr = Json::decode($result);
-        $phoneNumber = isset($arr['purePhoneNumber']) ? $arr['purePhoneNumber'] : '';
-        if (empty($phoneNumber)) {
-            util::fail('登录失败了');
-        }
-        $params = ['mobile' => $phoneNumber];
-        util::success($params);
-    }
-
     //准备授权 ssh 2019.11.19
     public function actionPrepare()
     {

+ 9 - 2
app-mall/controllers/UserController.php

@@ -20,6 +20,13 @@ use yii\helpers\Json;
 class UserController extends BaseController
 {
 
+    //创建客户 ssh 20220607
+    public function actionCreate()
+    {
+        $post = Yii::$app->request->post();
+        util::success(['info' => $post]);
+    }
+
     //最近店铺 ssh 2021.2.27
     public function actionRecentShop()
     {
@@ -54,7 +61,7 @@ class UserController extends BaseController
         $appId = $merchant['miniAppId'];
         $miniOpenId = $post['miniOpenId'];
         if (empty($miniOpenId)) {
-            util::fail('没有miniOpenId');
+            util::success(['hasNoOpenId' => 1], '登录失败');
         }
         $cacheKey = 'MALL_MINI_SESSION_KEY_' . $miniOpenId;
         $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
@@ -81,7 +88,7 @@ class UserController extends BaseController
         $appId = $merchant['miniAppId'];
         $miniOpenId = $post['miniOpenId'];
         if (empty($miniOpenId)) {
-            util::fail('没有miniOpenId');
+            util::success(['hasNoOpenId' => 1], '登录失败');
         }
         $cacheKey = 'MALL_MINI_SESSION_KEY_' . $miniOpenId;
         $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);