mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-05 17:07:04 +00:00
头像缓存机制
This commit is contained in:
parent
9ea250278d
commit
58e8b7b0a0
@ -127,7 +127,7 @@ class IndexController extends InvokeController
|
||||
|
||||
/**
|
||||
* 头像
|
||||
* @return \Psr\Http\Message\StreamInterface
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response
|
||||
*/
|
||||
public function avatar()
|
||||
{
|
||||
@ -148,7 +148,7 @@ class IndexController extends InvokeController
|
||||
}
|
||||
//
|
||||
$avatar = new InitialAvatar();
|
||||
return $avatar->name($name)
|
||||
$content = $avatar->name($name)
|
||||
->size($size)
|
||||
->color($color)
|
||||
->background($background)
|
||||
@ -156,6 +156,12 @@ class IndexController extends InvokeController
|
||||
->autoFont()
|
||||
->generate()
|
||||
->stream('png', 100);
|
||||
//
|
||||
return response($content)
|
||||
->header('Pragma', 'public')
|
||||
->header('Cache-Control', 'max-age=1814400')
|
||||
->header('Content-type', 'image/png')
|
||||
->header('Expires', gmdate('D, d M Y H:i:s \G\M\T', time() + 1814400));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -60,11 +60,6 @@ server {
|
||||
proxy_pass http://service;
|
||||
}
|
||||
|
||||
location =/avatar {
|
||||
expires 30d;
|
||||
proxy_pass http://service;
|
||||
}
|
||||
|
||||
location @laravels {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
1
resources/assets/js/store/actions.js
vendored
1
resources/assets/js/store/actions.js
vendored
@ -48,7 +48,6 @@ export default {
|
||||
const {ret, data, msg} = result;
|
||||
if (ret === -1 && params.checkRole !== false) {
|
||||
//身份丢失
|
||||
state.userId = 0;
|
||||
$A.modalError({
|
||||
content: msg,
|
||||
onOk: () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user