Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
aic_duty_strategy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yinxiaoling
aic_duty_strategy
Commits
eefbd83d
Commit
eefbd83d
authored
May 15, 2020
by
yinxiaoling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载失败数据接口
parent
60b738df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
StrategySetController.php
app/Http/Controllers/strategy/StrategySetController.php
+3
-1
No files found.
app/Http/Controllers/strategy/StrategySetController.php
View file @
eefbd83d
...
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Validator;
...
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Validator;
use
App\Http\Controllers\Tool
;
use
App\Http\Controllers\Tool
;
use
App\Service\StrategyService
;
use
App\Service\StrategyService
;
use
App\Models\StrategySet
;
use
App\Models\StrategySet
;
use
Illuminate\Support\Facades\Log
;
//use App\Http\Requests\StrategySetCreateRequest;
//use App\Http\Requests\StrategySetCreateRequest;
class
StrategySetController
extends
Controller
class
StrategySetController
extends
Controller
...
@@ -99,7 +100,7 @@ class StrategySetController extends Controller
...
@@ -99,7 +100,7 @@ class StrategySetController extends Controller
}
}
$url
=
storage_path
()
.
"
\\
import
\\
"
.
$excelFile
.
'.xlsx'
;
$url
=
storage_path
()
.
"
\\
import
\\
"
.
$excelFile
.
'.xlsx'
;
try
{
try
{
if
(
!
file_exists
(
$url
)
){
if
(
file_exists
(
$url
)
==
false
){
return
$this
->
errorWithInfo
(
'文件不存在,下载失败'
,
401
);
return
$this
->
errorWithInfo
(
'文件不存在,下载失败'
,
401
);
}
}
$cont
=
fopen
(
$url
,
'r'
);
$cont
=
fopen
(
$url
,
'r'
);
...
@@ -113,6 +114,7 @@ class StrategySetController extends Controller
...
@@ -113,6 +114,7 @@ class StrategySetController extends Controller
header
(
'Content-transfer-encoding: binary'
);
header
(
'Content-transfer-encoding: binary'
);
return
$fcontent
;
return
$fcontent
;
}
catch
(
\Exception
$e
){
}
catch
(
\Exception
$e
){
Log
::
channel
(
'api'
)
->
error
(
$e
->
getFile
()
.
'-'
.
$e
->
getLine
()
.
'-'
.
$e
->
getMessage
());
return
$this
->
errorWithInfo
(
'下载异常'
,
401
);
return
$this
->
errorWithInfo
(
'下载异常'
,
401
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment