fix: fix error
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user