diff --git a/src/modules/config.ts b/src/modules/config.ts index a2b696d..85cc67c 100644 --- a/src/modules/config.ts +++ b/src/modules/config.ts @@ -12,5 +12,5 @@ export const config = dotenv.config({ }).parsed; // const config = useConfig(); // export const config = process.env; -console.log('config', config); +// console.log('config', config); export const port = config.PORT || 4005; diff --git a/src/modules/minio.ts b/src/modules/minio.ts index 10a1219..a4e4157 100644 --- a/src/modules/minio.ts +++ b/src/modules/minio.ts @@ -7,7 +7,7 @@ const minioConfig = { accessKey: config.MINIO_ACCESS_KEY, secretKey: config.MINIO_SECRET_KEY, }; -console.log('minioConfig', minioConfig); +// console.log('minioConfig', minioConfig); export const minioClient = new Client(minioConfig); export const bucketName = config.MINIO_BUCKET_NAME || 'resources'; diff --git a/src/routes-simple/resources/chunk.ts b/src/routes-simple/resources/chunk.ts index 9e919cc..6022655 100644 --- a/src/routes-simple/resources/chunk.ts +++ b/src/routes-simple/resources/chunk.ts @@ -134,6 +134,15 @@ router.post('/api/s1/resources/upload/chunk', async (req, res) => { // Clean up the final file fs.unlinkSync(finalFilePath); + const downloadBase = '/api/s1/share'; + + const uploadResult = { + name: relativePath, + path: `${downloadBase}/${minioPath}`, + appKey, + version, + username, + }; if (!noCheckAppFiles) { // Notify the app const r = await app.call({ @@ -148,17 +157,11 @@ router.post('/api/s1/resources/upload/chunk', async (req, res) => { }, }, }); - const downloadBase = '/api/s1/share'; const data: any = { code: r.code, data: { app: r.body, - upload: [ - { - name: relativePath, - path: `${downloadBase}/${minioPath}`, - }, - ], + upload: [uploadResult], }, }; if (r.message) { @@ -172,7 +175,7 @@ router.post('/api/s1/resources/upload/chunk', async (req, res) => { res.end( JSON.stringify({ message: 'Chunk uploaded successfully', - data: { chunkIndex, totalChunks }, + data: { chunkIndex, totalChunks, upload: [uploadResult] }, }), ); } @@ -180,6 +183,7 @@ router.post('/api/s1/resources/upload/chunk', async (req, res) => { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end( JSON.stringify({ + code: 200, message: 'Chunk uploaded successfully', data: { chunkIndex, diff --git a/submodules/code-center-module b/submodules/code-center-module index 60c5a98..162d4c7 160000 --- a/submodules/code-center-module +++ b/submodules/code-center-module @@ -1 +1 @@ -Subproject commit 60c5a986edd4add11b229b2d3c869dcdf32c0428 +Subproject commit 162d4c72b409530c6789ea8b3efcc7963715bed8