overtrue / laravel-ueditor

UEditor integration for Laravel.
390 stars 96 forks source link

使用 artisan route:cache 时,会出现404异常(在控制台中可以看到) #30

Closed jiker-burce closed 7 years ago

jiker-burce commented 7 years ago

ueditor.all.js:8228 XHR finished loading: GET "http://xxxx.app/ueditor/server?action=config&&noCache=1498757616410". doAjax @ ueditor.all.js:8228 request @ ueditor.all.js:8372 (anonymous) @ ueditor.all.js:8069 ueditor.all.js:8092 请求后台配置项http错误,上传功能将不能正常使用! showErrorMsg @ ueditor.all.js:8092 onerror @ ueditor.all.js:8083 xhr.onreadystatechange @ ueditor.all.js:8220 ueditor.all.js:8228 GET http://xxxx.app/ueditor/server?action=config&&noCache=1498757616408 404 (Not Found) doAjax @ ueditor.all.js:8228 request @ ueditor.all.js:8372 (anonymous) @ ueditor.all.js:8069 ueditor.all.js:8228 XHR finished loading: GET "http://xxx.app/ueditor/server?action=config&&noCache=1498757616408". doAjax @ ueditor.all.js:8228 request @ ueditor.all.js:8372 (anonymous) @ ueditor.all.js:8069 ueditor.all.js:8092 请求后台配置项http错误,上传功能将不能正常使用!

sakulaza commented 7 years ago

同样的问题

muzilong commented 7 years ago

解决方法: 1.建立 routes/extension/Ueditor/ueditor.php 路由文件 ,内容如下: Route::any('/ueditor/server', 'UEditorController@serve');

2.在app/Providers/RouteServiceProvider.php文件 protected $namespace下加上一行 protected $ueditspace = 'Overtrue\LaravelUEditor';

3 在 protected function mapWebRoutes 方法下面,添加 protected function mapExtensionRoutes()方法如下: Route::middleware('web') ->namespace($this->ueditspace) ->group(base_path('routes/extension/Ueditor/ueditor.php'));

4 在 map方法中引入 $this->mapExtensionRoutes();

重新 artisan route:cache 即可