fix: fix error

This commit is contained in:
2025-01-03 21:33:01 +08:00
parent edde6181f7
commit a97bb5f732
8 changed files with 468 additions and 104 deletions

View File

@@ -9,7 +9,7 @@ import { app, minioClient } from '@/app.ts';
import { bucketName } from '@/modules/minio.ts';
import { getContentType } from '@/utils/get-content-type.ts';
import { hash } from 'crypto';
import { MicroAppModel } from '@/routes/micro-app/models.ts';
import { MicroAppUploadModel } from '@/routes/micro-app/models.ts';
const cacheFilePath = useFileStore('cache-file', { needExists: true });
router.post('/api/micro-app/upload', async (req, res) => {
@@ -137,7 +137,7 @@ router.get('/api/micro-app/download/:id', async (req, res) => {
tokenUser = auth.tokenUser;
if (!tokenUser) return;
}
const file = await MicroAppModel.findByPk(id);
const file = await MicroAppUploadModel.findByPk(id);
if (!DEV_SERVER) {
file.uid !== tokenUser.id && res.end(error('No permission', 403));
return;