|
@@ -15,7 +15,7 @@ class homeMiddleware
|
|
|
{
|
|
|
|
|
|
//白名单
|
|
|
- private $white_list = ['login','getuserinfo'];
|
|
|
+ private $white_list = ['login', 'getuserinfo'];
|
|
|
|
|
|
//请求入口
|
|
|
public function handle($request, \Closure $next)
|
|
@@ -77,7 +77,6 @@ class homeMiddleware
|
|
|
* //获取供应商的信息
|
|
|
* private function getSupplierInfoByClientID(string $clientID = '')
|
|
|
* {
|
|
|
- * $key = Config::get('config.redis_key.supplier_info');
|
|
|
*
|
|
|
* $key .= $clientID;
|
|
|
*
|
|
@@ -129,10 +128,14 @@ class homeMiddleware
|
|
|
$val2 = Validate::rule(['supplierNo|供应商编码' => 'require|length:18|alphaNum']);
|
|
|
if (!$val2->check($param)) return json_show(105, '参数错误,' . $val2->getError());
|
|
|
|
|
|
- $data = Cache::get(Config::get('redis_key.user_info_token') . $param['token']);
|
|
|
- $data = json_decode($data, true);
|
|
|
+ $data = SupplierUser::field('uid,nickname,mobile,email')
|
|
|
+ ->alias('a')
|
|
|
+ ->where(['is_del' => SupplierUser::$is_del_normal, 'status' => SupplierUser::$status_normal, 'token' => $param['token']])
|
|
|
+ ->where('expire_time', '>=', date('Y-m-d H:i:s'))
|
|
|
+ ->findOrEmpty()
|
|
|
+ ->toArray();
|
|
|
|
|
|
- if (!$data) return json_show(102, 'token已过期');
|
|
|
+ if (empty($data)) return json_show(102, 'token不存在或已过期');
|
|
|
|
|
|
$res = SupplierRelationUser::field('id,supplierNo,supplierName')
|
|
|
->where(['is_del' => SupplierUser::$is_del_normal, 'supplierNo' => $param['supplierNo'], 'uid' => $data['uid']])
|