亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

圖像 url 在開發服務器上工作,但在生產服務器上失敗

圖像 url 在開發服務器上工作,但在生產服務器上失敗

PHP
慕無忌1623718 2021-10-22 13:40:12
我正在使用 Laravel 5.8 版本開發 API 應用程序。當向productsapi 端點發出 get 請求時,我返回一個如下所示的ProductResource集合public function toArray($request){    return [        'id'            => $this->id,        'name'          => $this->name,        'category'      => $this->category,        'description'   => $this->description,        'status'        => $this->status,        'price'         => $this->price,        'barrels'       => $this->barrels,        'interest'      => $this->interest,        'start'         => $this->start,        'end'           => $this->end,        'hidden'        => $this->hidden,        'imageUrl'      => asset('storage/images/products/' . $this->image->name)    ];}我面臨的挑戰是,在我的本地服務器上單擊返回imageUrl的圖像顯示正確的圖像,但在登臺環境中,我得到了默認的404未找到頁面。我在我正在開發的本地服務器上創建了一個符號鏈接,public/storage用于storage/app/public在將應用程序文件上傳到登臺環境之前存儲實際的圖像文件??焖贆z查storage/app/public/images/products臨時環境中的 會顯示圖像文件,但我仍然無法從瀏覽器中查看它。這種行為的可能原因是什么?這是我的本地和登臺環境中的資源示例本地/開發服務器{    "id": 17,    "name": "test",    "category": "test",    "description": "test",    "status": "test",    "price": 10990,    "barrels": 207736,    "interest": 0.2,    "start": "2019-07-25",    "end": "2019-08-25",    "hidden": 0,    "imageUrl": "http://localhost:8000/storage/images/products/pramopro_test_17.jpeg"  }登臺服務器{    "id": 13,    "name": "test prod",    "category": "test prod category",    "description": "test prod description",    "status": "loading",    "price": 10000,    "barrels": 300000,    "interest": 0.2,    "start": "2019-07-22",    "end": "2019-08-28",    "hidden": 0,    "imageUrl": "http://staging.pramopro.com/storage/images/products/pramopro_testprod_13.jpeg"  }
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 125 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號