Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
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
1
Merge Requests
1
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
without authentication
meibuyu-micro
Commits
0a5c03a5
Commit
0a5c03a5
authored
Jun 11, 2020
by
王源
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改上传文件临时目录判断逻辑
parent
92b4c105
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
UploadManager.php
src/Manager/UploadManager.php
+2
-2
ExcelImporter.php
src/Tools/ExcelImporter.php
+1
-1
No files found.
src/Manager/UploadManager.php
View file @
0a5c03a5
...
@@ -172,8 +172,8 @@ class UploadManager
...
@@ -172,8 +172,8 @@ class UploadManager
*/
*/
public
static
function
parsePath
(
$options
,
$documentRoot
)
public
static
function
parsePath
(
$options
,
$documentRoot
)
{
{
if
(
isset
(
$options
[
'temp'
])
&&
$options
[
'temp'
]
&&
!
isset
(
$options
[
'path'
])
)
{
if
(
isset
(
$options
[
'temp'
])
&&
$options
[
'temp'
])
{
// 如果是临时文件,
且没有指定保存路径,
修改保存路径为临时路径
// 如果是临时文件,修改保存路径为临时路径
$options
[
'path'
]
=
'temp'
;
$options
[
'path'
]
=
'temp'
;
}
}
$path
=
$documentRoot
.
self
::
$pathPrefix
.
$options
[
'path'
]
.
'/'
.
date
(
'Y-m-d'
);
$path
=
$documentRoot
.
self
::
$pathPrefix
.
$options
[
'path'
]
.
'/'
.
date
(
'Y-m-d'
);
...
...
src/Tools/ExcelImporter.php
View file @
0a5c03a5
...
@@ -55,7 +55,7 @@ class ExcelImporter
...
@@ -55,7 +55,7 @@ class ExcelImporter
$this
->
config
=
container
(
ConfigInterface
::
class
);
$this
->
config
=
container
(
ConfigInterface
::
class
);
$this
->
fileType
=
ucfirst
(
$file
->
getExtension
());
$this
->
fileType
=
ucfirst
(
$file
->
getExtension
());
$this
->
rootPath
=
$this
->
config
->
get
(
'server.settings.document_root'
,
BASE_PATH
.
'/public'
);
$this
->
rootPath
=
$this
->
config
->
get
(
'server.settings.document_root'
,
BASE_PATH
.
'/public'
);
$path
=
UploadManager
::
uploadExcelGetRealPath
(
$file
);
$path
=
UploadManager
::
uploadExcelGetRealPath
(
$file
,
[
'temp'
=>
true
]
);
$this
->
reader
=
IOFactory
::
createReaderForFile
(
$path
)
->
load
(
$path
);
$this
->
reader
=
IOFactory
::
createReaderForFile
(
$path
)
->
load
(
$path
);
$this
->
filePath
=
$path
;
$this
->
filePath
=
$path
;
$this
->
sheet
=
$this
->
reader
->
getSheet
(
$sheetIndex
);
$this
->
sheet
=
$this
->
reader
->
getSheet
(
$sheetIndex
);
...
...
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