Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
付智勇
/
koa2_Sequelize_project
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
付智勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
042d6e11769d5e1456fd0591fda27b3165ec0f51
042d6e11
1 parent
b51c0d4d
no message
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
15 行增加
和
1 行删除
routes/upload.js
routes/upload.js
查看文件 @
042d6e1
...
...
@@ -48,7 +48,7 @@ router.post('/upLoadDoc',uploaddemo, async (ctx, next) => {
}
else
{
let
oldAttachment2one
=
await
attachmentModel
.
findOne
({
where
:{
businessId
:
businessId
,
category
:
2
,
siteId
:
siteId
}})
if
(
oldAttachment2one
){
let
oldAttachment
=
await
attachmentModel
.
update
({
path
:
path
},{
where
:{
businessId
:
businessId
,
category
:
2
,
siteId
:
siteI
d
}})
let
oldAttachment
=
await
attachmentModel
.
update
({
path
:
path
},{
where
:{
id
:
oldAttachment2one
.
i
d
}})
}
else
{
let
attachment
=
await
attachmentModel
.
create
(
attachmentData
)
}
...
...
@@ -85,6 +85,20 @@ router.post('/getImgBySiteId',async(ctx, next)=>{
status
.
catchError
(
ctx
,
400
,
e
.
message
);
}
})
router
.
post
(
'/getImgBySiteId'
,
async
(
ctx
,
next
)
=>
{
try
{
let
img
=
await
attachmentModel
.
findAll
({
where
:{
siteId
:
ctx
.
request
.
body
.
siteId
,
category
:
2
}
});
status
.
successTemp
(
ctx
,
200
,
img
);
}
catch
(
e
){
console
.
log
(
e
)
status
.
catchError
(
ctx
,
400
,
e
.
message
);
}
})
router
.
post
(
'/tgpCallback'
,
async
(
ctx
,
next
)
=>
{
...
...
请
注册
或
登录
后发表评论