|
|
@@ -285,7 +285,7 @@ class AuthController extends PublicController
|
|
|
$appSecret = $wxMiniBase['miniAppSecret'];
|
|
|
if (empty($appSecret)) {
|
|
|
//没有管理店铺不允许登录
|
|
|
- util::success(['token' => '']);
|
|
|
+ util::success(['token' => '','number'=>1]);
|
|
|
}
|
|
|
$url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code";
|
|
|
$curl = new curl\Curl();
|
|
|
@@ -296,27 +296,26 @@ class AuthController extends PublicController
|
|
|
$openid = $arr['openid'] ?? '';
|
|
|
if (empty($openid)) {
|
|
|
//没有管理店铺不允许登录
|
|
|
- util::success(['token' => '', 'currentMiniOpenId' => $openid]);
|
|
|
+ util::success(['token' => '', 'currentMiniOpenId' => $openid,'number'=>2]);
|
|
|
}
|
|
|
$cacheKey = 'GHS_SHOP_MINI_SESSION_KEY_' . $openid;
|
|
|
Yii::$app->redis->executeCommand('SET', [$cacheKey, $sessionKey]);
|
|
|
$admin = AdminService::getByMiniOpenId($openid);
|
|
|
if (empty($admin)) {
|
|
|
//没有管理店铺不允许登录
|
|
|
- util::success(['token' => '', 'currentMiniOpenId' => $openid]);
|
|
|
+ util::success(['token' => '', 'currentMiniOpenId' => $openid,'number'=>3]);
|
|
|
}
|
|
|
$adminId = $admin['id'];
|
|
|
- //1没有开店 2已申请待审核 3已开店
|
|
|
$openShop = $admin['openShop'] ?? 1;
|
|
|
$currentShopId = $admin['currentShopId'] ?? 0;
|
|
|
if (empty($currentShopId)) {
|
|
|
//没有管理店铺不允许登录
|
|
|
- util::success(['token' => '', 'currentMiniOpenId' => $openid]);
|
|
|
+ util::success(['token' => '', 'currentMiniOpenId' => $openid,'number'=>4]);
|
|
|
}
|
|
|
$shopAdmin = ShopAdminClass::getByCondition(['shopId' => $currentShopId, 'adminId' => $adminId], true);
|
|
|
if (empty($shopAdmin)) {
|
|
|
//没有管理店铺不允许登录
|
|
|
- util::success(['token' => '', 'currentMiniOpenId' => $openid]);
|
|
|
+ util::success(['token' => '', 'currentMiniOpenId' => $openid,'number'=>5]);
|
|
|
}
|
|
|
$shopAdmin->lastLogin = date("Y-m-d H:i:s");
|
|
|
$shopAdmin->save();
|