Skip to content

Commit fbff495

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents cf638f4 + 47666f9 commit fbff495

39 files changed

+848
-23
lines changed

admin/src/views/api_excel/add.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default {
125125
this.$emit('getItem', this.form.apiParam)
126126
},
127127
init() {
128-
getListParam({ perPage: 20 }).then(response => {
128+
getListParam({ perPage: 100 }).then(response => {
129129
this.apiParam = response.data.data
130130
})
131131
},

admin/src/views/api_excel/edit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default {
112112
this.$emit('getItem', this.form.apiParam)
113113
},
114114
init() {
115-
getListParam({ perPage: 20 }).then(response => {
115+
getListParam({ perPage: 100 }).then(response => {
116116
this.apiParam = response.data.data
117117
})
118118
},

admin/src/views/api_excel/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export default {
492492
this.$emit('getItem', this.form.apiParam)
493493
},
494494
init() {
495-
getListParam({ perPage: 20 }).then(response => {
495+
getListParam({ perPage: 100 }).then(response => {
496496
this.apiParam = response.data.data
497497
})
498498
},

admin/src/views/home/out.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
<el-col :span="0">&nbsp;</el-col>
3535
</el-form-item>
3636
</el-form>
37+
<el-row>
38+
<el-col :span="4">&nbsp;&nbsp;</el-col>
39+
<el-col :span="4">
40+
<el-button @click="copyInput">一键复制输入内容</el-button>
41+
</el-col>
42+
<el-col :span="7">&nbsp;&nbsp;</el-col>
43+
<el-col :span="1"><el-button @click="copyOutput">一键复制输出内容</el-button></el-col>
44+
</el-row>
3745
</div>
3846
</template>
3947

@@ -60,6 +68,37 @@ export default {
6068
},
6169
created() {},
6270
methods: {
71+
copyInput() {
72+
const that = this
73+
that.$copyText(this.form.input).then(function(e) {
74+
that.$message({
75+
message: '输入内容复制成功',
76+
type: 'success'
77+
})
78+
}, function(e) {
79+
this.$message({
80+
message: '复制失败',
81+
type: 'error'
82+
})
83+
console.log(e)
84+
})
85+
},
86+
copyOutput() {
87+
const that = this
88+
this.$copyText(this.output).then(function(e) {
89+
that.$message({
90+
message: '输出内容复制成功',
91+
type: 'success'
92+
})
93+
// console.log(e)
94+
}, function(e) {
95+
this.$message({
96+
message: '复制失败',
97+
type: 'error'
98+
})
99+
console.log(e)
100+
})
101+
},
63102
onSubmit(form) {
64103
this.$refs[form].validate((valid) => {
65104
if (valid) {

laravel/app/Http/Controllers/Bus/AutoController.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers\Bus;
44

55
use App\Http\Repository\AccessToken;
6+
use AuroraLZDF\Bigfile\Traits\TraitBigfileChunk;
67
use Curl\Http;
78
use Illuminate\Http\Request;
89
use App\Http\Controllers\Controller;
@@ -11,6 +12,8 @@
1112

1213
class AutoController extends Controller
1314
{
15+
use TraitBigfileChunk;
16+
1417
/**
1518
* @var Http 请求类
1619
*/
@@ -20,6 +23,45 @@ public function __construct()
2023
{
2124
$this->http || $this->http = Http::getInstent();
2225
}
26+
27+
/**
28+
* 展示视图
29+
*
30+
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\think\response\View
31+
*/
32+
public function loadView()
33+
{
34+
$data = [
35+
'chunk_size' => config('bigfile.chunk_size'),
36+
'max_size' => config('bigfile.max_size'),
37+
'user_id' => Auth()->id(),
38+
];
39+
return view('bigfile.bigfile', compact('data'));
40+
}
41+
42+
/**
43+
* 上传操作
44+
*
45+
* @param Request $request
46+
* @return \Illuminate\Http\JsonResponse
47+
*
48+
* @throws \Exception
49+
*/
50+
public function upload(Request $request)
51+
{
52+
$data = $request->all();
53+
$action = $request->input('act');
54+
55+
if (isset($action) && $action == 'upload') {
56+
57+
$result = $this->uploadToServer($data);
58+
return response()->json($result);
59+
}
60+
61+
$result = $this->uploadChunk($request);
62+
return response()->json($result);
63+
}
64+
2365
/**
2466
* 获取七牛 Token 的方法
2567
*

laravel/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "project",
77
"require": {
88
"php": "^7.0",
9+
"auroralzdf/big-file-upload": "^2.0",
910
"baijunyao/laravel-scout-elasticsearch": "^2.1",
1011
"barryvdh/laravel-cors": "^0.11.2",
1112
"fideloper/proxy": "^3.0",

laravel/composer.lock

Lines changed: 40 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

laravel/config/bigfile.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
return [
4+
/*
5+
|------------------------
6+
| 文件每次切片尺寸
7+
|------------------------
8+
*/
9+
'chunk_size' => 1024 * 1024 * 2,
10+
11+
12+
/*
13+
|------------------------
14+
| 允许上传文件最大尺寸
15+
|------------------------
16+
*/
17+
'max_size' => 1024 * 1024 * 1024,
18+
19+
20+
/*
21+
|------------------------
22+
| 文件保存路径
23+
|------------------------
24+
*/
25+
'save_path' => 'upload/'.date('Y').'/'.date('m').'/',
26+
27+
28+
/*
29+
|------------------------
30+
| 文件切片缓存路径
31+
|------------------------
32+
*/
33+
'tmp_path' => storage_path('app/public/tmp'),
34+
35+
36+
/*
37+
|------------------------
38+
| 允许上传文件类型
39+
|------------------------
40+
*/
41+
'allow_type' => ['jpg', 'jpeg', 'gif', 'png', 'mp4', 'mp3', 'zip', 'apk', 'pdf', 'rar'],
42+
43+
44+
/*
45+
|------------------------
46+
| 切片文件是否随机命名
47+
|------------------------
48+
*/
49+
'rand_name' => true,
50+
51+
52+
/*
53+
|------------------------
54+
| 是否删除临时文件
55+
|------------------------
56+
*/
57+
'remove_tmp_file' => true,
58+
];
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.webuploader-container {
2+
position: relative;
3+
}
4+
.webuploader-element-invisible {
5+
position: absolute !important;
6+
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
7+
clip: rect(1px,1px,1px,1px);
8+
}
9+
.webuploader-pick {
10+
position: relative;
11+
display: inline-block;
12+
cursor: pointer;
13+
background: #00b7ee;
14+
padding: 10px 15px;
15+
color: #fff;
16+
text-align: center;
17+
border-radius: 3px;
18+
overflow: hidden;
19+
}
20+
.webuploader-pick-hover {
21+
background: #00a2d4;
22+
}
23+
24+
.webuploader-pick-disable {
25+
opacity: 0.6;
26+
pointer-events:none;
27+
}
28+
140 KB
Binary file not shown.

0 commit comments

Comments
 (0)