|
|
@@ -11,6 +11,7 @@ namespace addons\unishop\controller; |
|
|
|
|
|
|
|
use addons\unishop\extend\Redis; |
|
|
|
use addons\unishop\extend\Wechat; |
|
|
|
use addons\unishop\model\Config; |
|
|
|
use addons\unishop\model\UserExtend; |
|
|
|
use app\common\library\Sms; |
|
|
|
use think\Cache; |
|
|
@@ -37,6 +38,18 @@ class User extends Base |
|
|
|
$ret = $this->auth->login($mobile, $password); |
|
|
|
if ($ret) { |
|
|
|
$data = $this->auth->getUserinfo(); |
|
|
|
$ordinary_user_start=Config::getByName('ordinary_user_start')['value']; |
|
|
|
$ordinary_user_end=Config::getByName('ordinary_user_end')['value']; |
|
|
|
$ordinary_user_start=strtotime($ordinary_user_start); |
|
|
|
$ordinary_user_end=strtotime($ordinary_user_end); |
|
|
|
if (time()<$ordinary_user_end && time()>$ordinary_user_start){ |
|
|
|
//普通用户受限制时间 |
|
|
|
$privilege_user_list=Config::getByName('privilege_user_list')['value']; |
|
|
|
$privilege_user_list=explode(",",$privilege_user_list); |
|
|
|
if (!in_array($data['id'],$privilege_user_list)){ |
|
|
|
$this->success('It\'s not time to open', $data); |
|
|
|
} |
|
|
|
} |
|
|
|
$data['avatar'] = \addons\unishop\model\Config::getImagesFullUrl($data['avatar']); |
|
|
|
$this->success('Logged in successful', $data); |
|
|
|
} else { |
|
|
|