got 替换为 uudici

This commit is contained in:
whyour
2025-05-15 01:01:39 +08:00
parent 3fafe4d24d
commit c3072e7712
8 changed files with 425 additions and 385 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ import path, { join } from 'path';
import config from '../config';
import { getFileContentByName } from '../config/util';
import { Response } from 'express';
import got from 'got';
import { request } from 'Undici';
@Service()
export default class ConfigService {
@@ -27,10 +27,10 @@ export default class ConfigService {
}
if (filePath.startsWith('sample/')) {
const res = await got.get(
const res = await request(
`https://gitlab.com/whyour/qinglong/-/raw/master/${filePath}`,
);
content = res.body;
content = await res.body.text();
} else if (filePath.startsWith('data/scripts/')) {
content = await getFileContentByName(join(config.rootPath, filePath));
} else {