1
This commit is contained in:
parent
1d278d7c65
commit
02bf934556
@ -256,6 +256,7 @@ export async function uploadFile(
|
|||||||
*/
|
*/
|
||||||
export function checkResult(result: AxiosResponse) {
|
export function checkResult(result: AxiosResponse) {
|
||||||
const { ret, errmsg, data } = result.data;
|
const { ret, errmsg, data } = result.data;
|
||||||
|
console.log("检查请求结果", { ret, errmsg } );
|
||||||
if (!_.isFinite(Number(ret))) return result.data;
|
if (!_.isFinite(Number(ret))) return result.data;
|
||||||
if (ret === '0') return data;
|
if (ret === '0') return data;
|
||||||
if (ret === '5000')
|
if (ret === '5000')
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export default {
|
|||||||
response_format,
|
response_format,
|
||||||
} = request.body;
|
} = request.body;
|
||||||
const responseFormat = _.defaultTo(response_format, "url");
|
const responseFormat = _.defaultTo(response_format, "url");
|
||||||
// logger.info(`\n图片生成: model: ${model}, task_id: ${task_id}, width: ${width}, height: ${height}, responseFormat: ${responseFormat}, \n prompt: ${prompt}`);
|
logger.info(`\n发起图片生成: model: ${model}, task_id: ${task_id}, width: ${width}, height: ${height}, responseFormat: ${responseFormat}, sample_strength: ${sample_strength}, generate_count: ${generate_count}`);
|
||||||
|
|
||||||
if (USE_DATABASE_MODE) {
|
if (USE_DATABASE_MODE) {
|
||||||
// 使用新的数据库方法
|
// 使用新的数据库方法
|
||||||
|
|||||||
@ -327,7 +327,7 @@ export class TaskPollingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
taskLog(`Starting task: ${task.task_id} (${task.task_type})`);
|
taskLog(`Starting task: ${task.task_id} (${task.task_type})`);
|
||||||
taskLog(`original_params: ${JSON.stringify(task.original_params)}`);
|
// taskLog(`original_params: ${JSON.stringify(task.original_params)}`);
|
||||||
|
|
||||||
// 调用原有生成方法获取historyId
|
// 调用原有生成方法获取historyId
|
||||||
let historyId: string;
|
let historyId: string;
|
||||||
@ -815,7 +815,7 @@ export class TaskPollingService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
taskLog(`生成图片 发起请求 isModel4 ${isModel4}`);
|
taskLog(`生成图片 发起请求 isModel4 ${isModel4}`);
|
||||||
const { aigc_data } = await request(
|
const res = await request(
|
||||||
"post",
|
"post",
|
||||||
"/mweb/v1/aigc_draft/generate",
|
"/mweb/v1/aigc_draft/generate",
|
||||||
refreshToken,
|
refreshToken,
|
||||||
@ -897,7 +897,7 @@ export class TaskPollingService {
|
|||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
);
|
);
|
||||||
|
const { aigc_data } = res;
|
||||||
const historyId = aigc_data.history_record_id;
|
const historyId = aigc_data.history_record_id;
|
||||||
if (!historyId) {
|
if (!historyId) {
|
||||||
throw new Error('Failed to get history_record_id from image generation API');
|
throw new Error('Failed to get history_record_id from image generation API');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user