-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from diskcloud/feature/42
refactor: #42 Optimize project file structure
- Loading branch information
Showing
7 changed files
with
53 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const cors = require("@koa/cors"); | ||
|
||
module.exports = () => | ||
cors({ | ||
origin: "http://localhost:5173/", // 允许的来源 | ||
allowMethods: ["GET", "POST"], // 允许的方法 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { koaBody } = require("koa-body"); | ||
const path = require("path"); | ||
|
||
module.exports = () => | ||
koaBody({ | ||
multipart: true, | ||
// 解决 DELETE 没法获取ids的问题 | ||
parsedMethods: ["POST", "PUT", "PATCH", "DELETE"], | ||
formidable: { | ||
uploadDir: path.join(__dirname, "..", "provisional"), // 临时上传目录 | ||
keepExtensions: true, // 保留文件扩展名 | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.