新增获取全局配置接口
This commit is contained in:
parent
752a79976a
commit
dd38944ae3
@ -1247,4 +1247,23 @@ class Auth extends BaseController
|
|||||||
}
|
}
|
||||||
return app('json')->success($this->request->param());
|
return app('json')->success($this->request->param());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取全局配置信息
|
||||||
|
public function globalConfig()
|
||||||
|
{
|
||||||
|
$getUrl = env('TASK_WORKER_HOST_URL') . '/api/index/config';
|
||||||
|
$header = array('User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1');
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $getUrl);
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
$data = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
if (!empty($data) && is_string($data)) {
|
||||||
|
$miniappInfo = json_decode($data, true);
|
||||||
|
return app('json')->success($miniappInfo['data'] ?? []);
|
||||||
|
}
|
||||||
|
return app('json')->success([]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ Route::group('api/', function () {
|
|||||||
Route::get('region/order', 'api.Auth/orderList');
|
Route::get('region/order', 'api.Auth/orderList');
|
||||||
Route::get('region/merchant', 'api.Auth/merStatistics');
|
Route::get('region/merchant', 'api.Auth/merStatistics');
|
||||||
Route::get('region/goods', 'api.Auth/goodsStatistics');
|
Route::get('region/goods', 'api.Auth/goodsStatistics');
|
||||||
|
Route::get('global/config', 'api.Auth/globalConfig');
|
||||||
Route::resource('upload', 'api.Upload');
|
Route::resource('upload', 'api.Upload');
|
||||||
Route::post('articleCatch', 'api.Upload/article');
|
Route::post('articleCatch', 'api.Upload/article');
|
||||||
//强制登录
|
//强制登录
|
||||||
|
Loading…
x
Reference in New Issue
Block a user