## 安裝完php擴展:xlswriter,laravel5.5使用xlswriter導出表格
##### <blockquote class="danger">問題場景出現:后臺給接口返回訪問鏈接地址,前端vue界面拿到鏈接后,自動生成a標簽,再實現自動點擊發現鏈接導出存在問題,鏈接無法打開,報錯<p>
--------------------------------------------------------------------------------------------------------------------
1. 報錯頁面:[該文件的路徑為:```/public//storage/admin_export/order_info_1685687848.xlsx```]

2. nginx未改簽配置信息如下:

解決途徑,修改nginx配置,增加下載目錄訪問路徑指定,修改后文件為:
```
server {
listen 80; # 訪問端口
server_name www.cs7.com; # 配置的域名
root /wwwroot/cs7/bjl_admin/html/dist; # 前端路徑
access_log /var/log/nginx/www.cs7.com.log; # access_log日志文件
error_log /var/log/nginx/www.cs7.com.error.log; # error_log錯誤日志文件
client_max_body_size 2048m; # 請求體的大小,若超過所設定的大小,返回413錯誤
location /#/ { # 前端訪問
index index.html index.htm;
}
location / { # 偽靜態
index index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
autoindex off;
}
# 下載文件
location /storage/ {
root /wwwroot/cs7/bjl_admin/public;
try_files $uri /index.php?$query_string;
access_log off;
}
# PHP解析
location ~ \.php$ {
root /wwwroot/cs7/bjl_admin/public; # 后臺根目錄
fastcgi_pass lnmp_php:9000; # PHP解釋器:將請求轉發給本機9000端口
fastcgi_index index.php; # 默認的請求文件名:PHP的默認文件名稱[index.php]
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # 腳本文件請求的路徑
include fastcgi_params; # 加載其他配置文件
}
}
```
3:按照如圖所示即可解決
- Laravel5.5總結
- 項目管理
- Manager
- Vip專屬鏈接管理
- Api
- Vip專屬鏈接管理(Api)
- php artisan route:list 路由顯示不全
- 數據遷移和填充
- Laravel5.5事件監聽機制(注冊-監聽-任務調度)
- 章節1:未啟用任務調度
- 章節2:啟用任務調度
- 使用記錄
- 數據遷移使用記錄
- 安裝laravel5.5日志觀察器
- Laravel5.5消息隊列(rabbitmq)
- 1:laravel自帶消息隊列
- 2:RabbitMq隊列使用
- 第三方支付擴展:yansongda/laravel-pay
- 安裝指引
- 控制器內使用
- 分表查詢(mysql+mongo)
- 前端Vue按鈕導出問題
- 單元測試
- 模型使用
- laravel9數據填充
- laravel9子查詢