diff --git a/packages/canyon-backend/src/sourcecode/sourcecode.service.ts b/packages/canyon-backend/src/sourcecode/sourcecode.service.ts index 6c6c48fb..9c329305 100644 --- a/packages/canyon-backend/src/sourcecode/sourcecode.service.ts +++ b/packages/canyon-backend/src/sourcecode/sourcecode.service.ts @@ -7,14 +7,27 @@ export class SourcecodeService { constructor(private readonly prisma: PrismaService) {} getsourcecode(projectID, sha, filepath): Promise { - // return this.prisma.'' - return getFileInfo( - { - projectID, - filepath: encodeURIComponent(filepath.replace('~/', '')), - commitSha: sha, - }, - 'accessToken', - ); + // 实在不想硬编码 + if (projectID === '100807') { + return getFileInfo( + { + projectID, + filepath: encodeURIComponent( + filepath.replace('~/src/taro/pages/tnt', 'src/pages/tnt'), + ), + commitSha: sha, + }, + 'accessToken', + ); + } else { + return getFileInfo( + { + projectID, + filepath: encodeURIComponent(filepath.replace('~/', '')), + commitSha: sha, + }, + 'accessToken', + ); + } } }