明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
letian_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
zengfanpei
letian_backend
Commits
a52fcf71
Commit
a52fcf71
authored
Oct 15, 2024
by
zengfanpei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload
parent
2d3cc0c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
fileController.js
controller/fileController.js
+4
-2
systemFile.js
db/models/systemFile.js
+3
-0
No files found.
controller/fileController.js
View file @
a52fcf71
const
ExcelJS
=
require
(
'exceljs'
);
const
path
=
require
(
'pat
h'
);
const
_
=
require
(
'lodas
h'
);
async
function
upload
(
req
,
res
,
next
)
{
try
{
// console.log(req.file, req.body);
let
path
=
_
.
last
(
String
(
req
.
file
.
path
).
split
(
'/mnt/vdb1'
));
let
ret
=
await
DB
.
File
.
create
({
originalname
:
req
.
file
.
originalname
,
mimetype
:
req
.
file
.
mimetype
,
filename
:
req
.
file
.
filename
,
path
:
req
.
file
.
path
,
path
,
originalpath
:
req
.
file
.
path
,
size
:
req
.
file
.
size
,
});
res
.
sendData
(
ret
);
...
...
db/models/systemFile.js
View file @
a52fcf71
...
...
@@ -26,6 +26,9 @@ const fileSchema = new Schema({
path
:
{
type
:
String
,
},
originalpath
:
{
type
:
String
,
},
...
...
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