cross(); $this->registerHisService(); } /** * Bootstrap any application services. * * @param UrlGenerator $url * @return void */ public function boot(UrlGenerator $url): void { Schema::defaultStringLength(191); // Route参数表正则绑定 Route::pattern('patient_id', '[0-9]+'); Route::pattern('serial_no', '[0-9]+'); // 配置https if(env('REDIRECT_HTTPS')) { $url->forceScheme('https'); } } /** * 允许跨域 * @return void */ protected function cross(): void { header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: GET,PUT,POST,PATCH,DELETE"); header('Access-Control-Allow-Headers:x-requested-with,content-type,Authorization'); } protected function registerHisService(): void { // His平台服务 $this->app->singleton('HisSoapService', function () { return new Client(); }); } }