mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +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()
|
public function avatar()
|
||||||
{
|
{
|
||||||
@ -148,7 +148,7 @@ class IndexController extends InvokeController
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
$avatar = new InitialAvatar();
|
$avatar = new InitialAvatar();
|
||||||
return $avatar->name($name)
|
$content = $avatar->name($name)
|
||||||
->size($size)
|
->size($size)
|
||||||
->color($color)
|
->color($color)
|
||||||
->background($background)
|
->background($background)
|
||||||
@ -156,6 +156,12 @@ class IndexController extends InvokeController
|
|||||||
->autoFont()
|
->autoFont()
|
||||||
->generate()
|
->generate()
|
||||||
->stream('png', 100);
|
->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;
|
proxy_pass http://service;
|
||||||
}
|
}
|
||||||
|
|
||||||
location =/avatar {
|
|
||||||
expires 30d;
|
|
||||||
proxy_pass http://service;
|
|
||||||
}
|
|
||||||
|
|
||||||
location @laravels {
|
location @laravels {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Connection "";
|
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;
|
const {ret, data, msg} = result;
|
||||||
if (ret === -1 && params.checkRole !== false) {
|
if (ret === -1 && params.checkRole !== false) {
|
||||||
//身份丢失
|
//身份丢失
|
||||||
state.userId = 0;
|
|
||||||
$A.modalError({
|
$A.modalError({
|
||||||
content: msg,
|
content: msg,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user