Commit 58df8fa2 authored by hujun's avatar hujun

后台登录

parent 72d342f3
...@@ -4,14 +4,12 @@ namespace app\index\controller; ...@@ -4,14 +4,12 @@ namespace app\index\controller;
use app\api\untils\JwtUntils; use app\api\untils\JwtUntils;
use app\api_broker\service\BrokerService; use app\api_broker\service\BrokerService;
use app\extra\RedisExt;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\AAgents; use app\model\AAgents;
use app\model\ASite; use app\model\ASite;
use app\model\AStore; use app\model\AStore;
use app\model\AuthGroup; use app\model\AuthGroup;
use app\model\AuthRule; use app\model\AuthRule;
use phpDocumentor\Reflection\DocBlock\Tags\See;
use think\Session; use think\Session;
/** /**
...@@ -129,16 +127,10 @@ class Login extends Basic ...@@ -129,16 +127,10 @@ class Login extends Basic
$update_data['last_login_ip'] = $last_login_ip; $update_data['last_login_ip'] = $last_login_ip;
$this->m_agent->updateData($user_data['id'], $update_data); $this->m_agent->updateData($user_data['id'], $update_data);
$redis_ = RedisExt::getRedis();
$site_city = []; $site_city = [];
if (!empty($user_data['site_id']) && $user_data['id'] != 1) { if (!empty($user_data['site_id'])) {
$m_site = new ASite(); $m_site = new ASite();
$site_city = $m_site->getSite('city', ['id'=>$user_data['site_id'], 'is_del'=>0]); $site_city = $m_site->getSite('city', ['id'=>$user_data['site_id'], 'is_del'=>0]);
$redis_->set("agent_city_" . $user_data['id'], $site_city[0]['city']);
$redis_->set("agent_site_id_" . $user_data['id'], $user_data['site_id']);
} else {
$redis_->set("agent_city_" . $user_data['id'], '上海市');
$redis_->set("agent_site_id_" . $user_data['id'], 10001);
} }
$user_data['city'] = $site_city[0]['city']; $user_data['city'] = $site_city[0]['city'];
......
...@@ -316,6 +316,8 @@ class Basic extends Controller ...@@ -316,6 +316,8 @@ class Basic extends Controller
} else { } else {
$this->city = $site_city['city']; $this->city = $site_city['city'];
$this->siteId = $site_city['site_id']; $this->siteId = $site_city['site_id'];
$redis_->set("agent_city_" . $agentId,$this->city);
$redis_->set("agent_site_id_" . $agentId,$this->siteId);
} }
} }
} catch (\Exception $exception) { } catch (\Exception $exception) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment