Browse Source

登录优化

shish 3 năm trước cách đây
mục cha
commit
e5b1642547

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

@@ -68,6 +68,9 @@ class AuthController extends PublicController
         if (empty($admin)) {
         if (empty($admin)) {
             util::fail('请先注册');
             util::fail('请先注册');
         }
         }
+        $adminId = $admin['id'];
+        AdminClass::updateById($adminId, ['miniOpenId' => $miniOpenId]);
+        $admin['miniOpenId'] = $miniOpenId;
         $openShop = $admin['openShop'] ?? 1;
         $openShop = $admin['openShop'] ?? 1;
         $currentShopId = $admin['currentShopId'] ?? 0;
         $currentShopId = $admin['currentShopId'] ?? 0;
         if (empty($currentShopId)) {
         if (empty($currentShopId)) {
@@ -83,7 +86,6 @@ class AuthController extends PublicController
         $pfShopId = $currentShop->pfShopId ?? 0;
         $pfShopId = $currentShop->pfShopId ?? 0;
         $onlyCg = $currentShop->onlyCg ?? 1;
         $onlyCg = $currentShop->onlyCg ?? 1;
         $mainId = $currentShop->mainId ?? 0;
         $mainId = $currentShop->mainId ?? 0;
-        $adminId = $admin['id'];
         $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'mainId' => $mainId], true);
         $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'mainId' => $mainId], true);
         if (empty($shopAdmin)) {
         if (empty($shopAdmin)) {
             util::fail('没有权限操作');
             util::fail('没有权限操作');