fix a bug

This commit is contained in:
Wisp X 2022-04-27 16:54:45 +08:00
parent cff42566c8
commit b61db2b31a
8 changed files with 15 additions and 8 deletions

View File

@ -94,10 +94,6 @@ class User extends Authenticatable implements MustVerifyEmail
protected static function booted()
{
static::retrieved(function (self $user) {
$user->use_capacity = $user->images()->sum('size');
});
static::creating(function (self $user) {
// 默认组
$user->group_id = Group::query()->where('is_default', true)->value('id');
@ -112,6 +108,11 @@ class User extends Authenticatable implements MustVerifyEmail
return new Attribute(fn () => Utils::getAvatar($this->email));
}
public function useCapacity(): Attribute
{
return new Attribute(fn () => $this->images()->sum('size'));
}
public function group(): BelongsTo
{
return $this->belongsTo(Group::class, 'group_id', 'id');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,5 +20,6 @@
"/js/echarts/echarts.min.js": "/js/echarts/echarts.min.js",
"/js/masonry/masonry.pkgd.min.js": "/js/masonry/masonry.pkgd.min.js",
"/js/imagesloaded/imagesloaded.pkgd.min.js": "/js/imagesloaded/imagesloaded.pkgd.min.js",
"/css/markdown-css/github-markdown.css": "/css/markdown-css/github-markdown.css"
"/css/markdown-css/github-markdown.css": "/css/markdown-css/github-markdown.css",
"/css/markdown-css/github-markdown-light.css": "/css/markdown-css/github-markdown-light.css"
}

View File

@ -1,7 +1,7 @@
@section('title', '系统设置')
@push('styles')
<link rel="stylesheet" href="{{ asset('css/markdown-css/github-markdown.css') }}">
<link rel="stylesheet" href="{{ asset('css/markdown-css/github-markdown-light.css') }}">
@endpush
<x-app-layout>

View File

@ -1,5 +1,5 @@
@push('styles')
<link rel="stylesheet" href="{{ asset('css/markdown-css/github-markdown.css') }}">
<link rel="stylesheet" href="{{ asset('css/markdown-css/github-markdown-light.css') }}">
@endpush
<x-guest-layout>

View File

@ -13,6 +13,9 @@ module.exports = {
fontFamily: {
sans: ['Nunito', ...defaultTheme.fontFamily.sans],
},
boxShadow: {
custom: '6px 6px 30px 11px rgba(0, 0, 0, 0.03)',
},
},
},

View File

@ -54,3 +54,4 @@ mix.copy('node_modules/imagesloaded/imagesloaded.pkgd.min.js', 'public/js/images
// markdown css
mix.copy('node_modules/github-markdown-css/github-markdown.css', 'public/css/markdown-css')
mix.copy('node_modules/github-markdown-css/github-markdown-light.css', 'public/css/markdown-css')