第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

圖片加載不出來

圖片加載不出來

PHP
白板的微信 2021-12-03 19:26:27
我有一些代碼來更改用戶圖像。但是更改后我必須按control+shift+R才能看到更改。我換File::delete()到unlink()。但它沒有用??刂破鞔a:public function index(){    $id = Auth::id();    $info = Admin::select('name', 'login', 'image')-     >where('id', $id)->first();    return view('admin.index')->with('info', $info);}public function changes(Request $request){    $this->validate($request,[        'name'         => 'required',        'login'        => 'required',    ]);    $login = Auth::user()->login;    $admin =  Admin::where('login', $login)->first();    if($admin){        $admin->name = $request['name'];        $admin->login = $request['login'];        if(!is_null($request['old_password']) and !is_null($request['new_password'])){            $this->validate($request,[                'new_password'         => 'required',                'old_password'        => 'required',            ]);            if(Hash::check($request['old_password'], Auth::user()->password)){                $new_password = Hash::make($request['new_password']);                $admin->password = $new_password;            }        }        if(!is_null($request['profile_image'])){            $this->validate($request,[                'profile_image'         => 'image|mimes:jpeg,png,jpg',            ]);            if (!is_null(Auth::user()->image)) {                $admin_image = public_path() .'/'. Auth::user()->image;                if((File::exists($admin_image))){                    File::delete($admin_image);                }            }            $image = $request->file('profile_image');            $image_extension = $image->getClientOriginalExtension();            $image_name= Auth::id() .'.'. $image_extension;            $image->move(public_path('admin_assets/assets/images/users'), $image_name);            $admin->image = $image_name;        }        $admin->save();    }    return redirect()->route('admin.index');}我想我應該在索引操作中刷新公共文件夾,但是如何?
查看完整描述

1 回答

?
慕絲7291255

TA貢獻1859條經(jīng)驗 獲得超6個贊

如果新的圖像具有相同的URL(在你的情況相同的名稱和路徑)中的舊圖像瀏覽器使用的是在他自己的高速緩存中的舊形象。

除了要求用戶按Ctrl+F5(或Ctrl+Shift+R)清除頁面緩存外,此問題的最佳解決方案是:

  1. 更改名稱每個用戶改變圖像本身的時間到圖像。

  2. 版本化的查詢字符串(類似于?v=2)附加到圖像URL以強制瀏覽器請求新圖像:URL它與緩存中的所有內(nèi)容不同,因此它被迫獲取新資源。


查看完整回答
反對 回復 2021-12-03
  • 1 回答
  • 0 關(guān)注
  • 211 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號