Skip to content

Commit c869a3a

Browse files
committed
前端样式调整
1 parent 66ec98d commit c869a3a

File tree

23 files changed

+865
-426
lines changed

23 files changed

+865
-426
lines changed

README.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

apiblog/README.md

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
2-
3-
<p align="center">
4-
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
5-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
7-
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
8-
</p>
9-
10-
## About Laravel
11-
12-
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13-
14-
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15-
- [Powerful dependency injection container](https://laravel.com/docs/container).
16-
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17-
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18-
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19-
- [Robust background job processing](https://laravel.com/docs/queues).
20-
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21-
22-
Laravel is accessible, powerful, and provides tools required for large, robust applications.
23-
24-
## Learning Laravel
25-
26-
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27-
28-
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
29-
30-
## Laravel Sponsors
31-
32-
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
33-
34-
### Premium Partners
35-
36-
- **[Vehikl](https://vehikl.com/)**
37-
- **[Tighten Co.](https://tighten.co)**
38-
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
39-
- **[64 Robots](https://64robots.com)**
40-
- **[Cubet Techno Labs](https://cubettech.com)**
41-
- **[Cyber-Duck](https://cyber-duck.co.uk)**
42-
- **[Many](https://www.many.co.uk)**
43-
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
44-
- **[DevSquad](https://devsquad.com)**
45-
- **[Curotec](https://www.curotec.com/)**
46-
- **[OP.GG](https://op.gg)**
47-
48-
## Contributing
49-
50-
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
51-
52-
## Code of Conduct
53-
54-
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
55-
56-
## Security Vulnerabilities
57-
58-
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
59-
60-
## License
61-
62-
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
1+
## 基于vue3+element-plus+laravel8构建的前后端分离的博客应用
2+
3+
* [前端源码](/app/)
4+
* [后端源码](/apiblog/)
5+
6+
#### 工具🔧
7+
* [vue3](https://www.vue3js.cn/docs/zh)
8+
* [element-plus](https://github.com/element-plus/element-plus)
9+
* [laravel8.x](https://learnku.com/docs/laravel/8.x/upgrade/9352)
10+
11+
#### 模块
12+
* 登录第三方授权+jwt token 授权 使用了自己开发的[第三方登录包](https://github.com/pl1998/thirdparty_oauth) `thirdparty_oauth`
13+
* 评论模块
14+
* element组件:时间轴、组件分离、分页 导航栏等组件
15+
* job队列异步记录访客ip以及地址(守护进程消费)
16+
* 利用redis有序集合缓存热门排行榜
17+
* 后台使用了[dcat-admin](https://learnku.com/docs/dcat-admin/2.x)
18+
* 等待完善...
19+
20+
#### 前端安装集成
21+
22+
* 前端
23+
```shell script
24+
//全局配置文件 存放第三方登录一些key 以及后台接口
25+
.env
26+
.env.development
27+
.env.production
28+
```
29+
* 前端安装
30+
```shell script
31+
npm install
32+
npm run serve //热开发 加载.env.development配置文件
33+
npm run build:prod //打包发布 加载 .env.production配置文件
34+
```
35+
36+
#### 后端安装集成(记得将sql文件导入并配置好数据库和redis)
37+
* .env 配置(已经配置好了)
38+
39+
```shell script
40+
BROADCAST_DRIVER=log
41+
CACHE_DRIVER=array
42+
QUEUE_CONNECTION=sync //异步
43+
SESSION_DRIVER=redis //redis驱动
44+
SESSION_LIFETIME=120
45+
46+
```
47+
* 启动
48+
```shell script
49+
cp .env.example .env
50+
composer install
51+
php artisan key:gen
52+
php artisan serve --port 9091
53+
```
54+
#### 后台消费队列(正式环境用守护进程维护就行)
55+
```shell script
56+
php artisan queue:work redis --sleep=3
57+
```
58+
59+
#### 更新日志
60+
* 2021-04-17 新增用户评论所属区域显示 新增归档a链接 新增评论删除模型监听
61+
* 2021-04-20 新增文章图片跳转 新增二级评论
62+

apiblog/app/Admin/Controllers/ArticleController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Dcat\Admin\Grid;
88
use Dcat\Admin\Show;
99
use Dcat\Admin\Http\Controllers\AdminController;
10-
10+
use Illuminate\Support\Facades\Auth;
1111

1212

1313
class ArticleController extends AdminController
@@ -107,8 +107,10 @@ protected function form()
107107

108108
$form->display('created_at');
109109
$form->display('updated_at');
110-
$form->saving(function (){
111-
110+
$form->saving(function (Form $form){
111+
if($form->isCreating()){
112+
$form->user_id= \auth('admin')->id();
113+
}
112114
});
113115
});
114116
}

apiblog/app/Http/Controllers/TopicsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function store(Request $request)
5050
'article_id'=> $request->article_id,
5151
'user_id'=>Auth::id(),
5252
'ip'=>$request->getClientIp(),
53-
'address'=>$ipInfo->country.' '.$ipInfo->city,
53+
'address'=>$ipInfo->state_name.' '.$ipInfo->city,
5454
'created_at'=>now()->toDate(),
5555
'updated_at'=>now()->toDate()
5656
];
@@ -63,7 +63,7 @@ public function store(Request $request)
6363
'article_id'=> $request->article_id,
6464
'user_id'=>Auth::id(),
6565
'ip'=>$request->getClientIp(),
66-
'address'=>$ipInfo->country.' '.$ipInfo->city,
66+
'address'=>$ipInfo->state_name.' '.$ipInfo->city,
6767
'created_at'=>now()->toDate(),
6868
'updated_at'=>now()->toDate()
6969
];

apiblog/app/Jobs/VisitorsToRecordJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function handle()
4545
VisitorRegistry::query()->create([
4646
'art_id'=>$this->article_id,
4747
'ip' =>$this->ip,
48-
'address' => $ipInfo->country.'-'.$ipInfo->city,
48+
'address' => $ipInfo->state_name.'-'.$ipInfo->city,
4949
]);
5050
}
5151
}

apiblog/app/Mail/TopicsSend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public function build()
3333
return $this->from(env('MAIL_SEND_ADDRESS'))
3434
->view('email.topics_notification',[
3535
'topic'=>$this->topics
36-
]);
36+
]);
3737
}
3838
}
File renamed without changes.

apiblog/config/auth.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
'driver' => 'session',
4141
'provider' => 'users',
4242
],
43+
'admin' => [
44+
'driver' => 'session',
45+
'provider' => 'admin',
46+
],
4347

4448
'api' => [
4549
'driver' => 'jwt',
@@ -71,10 +75,10 @@
7175
'model' => App\Models\User::class,
7276
],
7377

74-
// 'users' => [
75-
// 'driver' => 'database',
76-
// 'table' => 'users',
77-
// ],
78+
'admin' => [
79+
'driver' => 'eloquent',
80+
'model' => \Dcat\Admin\Models\Administrator::class,
81+
],
7882
],
7983

8084
/*

app/.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NODE_ENV = 'development'
22

3-
VUE_APP_BASE_API = 'http://127.0.0.1:9091/api'
3+
VUE_APP_BASE_API = 'https://api.pltrue.top/api'
44
VUE_APP_URL = 'http://localhost:8081'
55

66
VUE_APP_GITHUB_CLIENT_ID = '684a49aa60ce60372463'

app/package-lock.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)