forked from 77media/video-flow
Merge branch 'feat-serverlog-params' into dev
This commit is contained in:
commit
5dc96e76b0
@ -92,6 +92,11 @@ export interface CreateMovieProjectV2Request {
|
|||||||
script: string;
|
script: string;
|
||||||
/** 用户ID */
|
/** 用户ID */
|
||||||
user_id: string;
|
user_id: string;
|
||||||
|
/** 客户端用户数据 */
|
||||||
|
user_data?: {
|
||||||
|
is_mobile: 1 | 0;
|
||||||
|
user_agent: string;
|
||||||
|
};
|
||||||
/** 模式:auto | manual */
|
/** 模式:auto | manual */
|
||||||
mode: "auto" | "manual";
|
mode: "auto" | "manual";
|
||||||
/** 分辨率:720p | 1080p | 4k */
|
/** 分辨率:720p | 1080p | 4k */
|
||||||
@ -206,6 +211,11 @@ export interface CreateMovieProjectV3Request {
|
|||||||
category: string;
|
category: string;
|
||||||
/** 用户ID */
|
/** 用户ID */
|
||||||
user_id: string;
|
user_id: string;
|
||||||
|
/** 客户端用户数据 */
|
||||||
|
user_data?: {
|
||||||
|
is_mobile: 1 | 0;
|
||||||
|
user_agent: string;
|
||||||
|
};
|
||||||
/** 模式:auto | manual */
|
/** 模式:auto | manual */
|
||||||
mode: "auto" | "manual";
|
mode: "auto" | "manual";
|
||||||
/** 分辨率:720p | 1080p | "4k" */
|
/** 分辨率:720p | 1080p | "4k" */
|
||||||
|
|||||||
@ -34,6 +34,20 @@ export interface QiniuUploadResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前客户端的 UA 与设备信息
|
||||||
|
*/
|
||||||
|
export const getClientUserData = (): { user_agent: string; is_mobile: 1 | 0 } => {
|
||||||
|
try {
|
||||||
|
const ua = typeof navigator !== 'undefined' && navigator.userAgent ? navigator.userAgent : ''
|
||||||
|
const isMobile = /Mobile|Android|iPhone/i.test(ua)
|
||||||
|
return { user_agent: ua, is_mobile: isMobile ? 1 : 0 }
|
||||||
|
} catch {
|
||||||
|
return { user_agent: '', is_mobile: 0 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取七牛云上传token(包含domain)
|
// 获取七牛云上传token(包含domain)
|
||||||
export const getUploadToken = async (timeoutMs: number = 10000): Promise<{ token: string, domain: string }> => {
|
export const getUploadToken = async (timeoutMs: number = 10000): Promise<{ token: string, domain: string }> => {
|
||||||
// 添加超时控制
|
// 添加超时控制
|
||||||
|
|||||||
@ -3,13 +3,15 @@ import {
|
|||||||
CreateMovieProjectV3Request,
|
CreateMovieProjectV3Request,
|
||||||
} from "./DTO/movie_start_dto";
|
} from "./DTO/movie_start_dto";
|
||||||
import { post } from "./request";
|
import { post } from "./request";
|
||||||
|
import { getClientUserData } from './common';
|
||||||
|
|
||||||
import { withQueuePolling, QueueResponse } from './movie_queue';
|
import { withQueuePolling, QueueResponse } from './movie_queue';
|
||||||
|
|
||||||
// 新-创建接口
|
// 新-创建接口
|
||||||
export const createMovieProject = async (data: any): Promise<QueueResponse> => {
|
export const createMovieProject = async (data: any): Promise<QueueResponse> => {
|
||||||
const apiCall = (params: any) => post<QueueResponse>('/movie/create_movie_project', params);
|
const apiCall = (params: any) => post<QueueResponse>('/movie/create_movie_project', params);
|
||||||
return withQueuePolling(apiCall, data);
|
const user_data = getClientUserData();
|
||||||
|
return withQueuePolling(apiCall, { ...data, user_data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,7 +24,8 @@ export const createMovieProjectV2 = async (
|
|||||||
): Promise<QueueResponse> => {
|
): Promise<QueueResponse> => {
|
||||||
const apiCall = (params: CreateMovieProjectV2Request) =>
|
const apiCall = (params: CreateMovieProjectV2Request) =>
|
||||||
post<QueueResponse>("/movie/create_movie_project_v2", params);
|
post<QueueResponse>("/movie/create_movie_project_v2", params);
|
||||||
return withQueuePolling(apiCall, request);
|
const user_data = getClientUserData();
|
||||||
|
return withQueuePolling(apiCall, { ...(request as any), user_data } as any);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,5 +38,6 @@ export const createMovieProjectV3 = async (
|
|||||||
): Promise<QueueResponse> => {
|
): Promise<QueueResponse> => {
|
||||||
const apiCall = (params: CreateMovieProjectV3Request) =>
|
const apiCall = (params: CreateMovieProjectV3Request) =>
|
||||||
post<QueueResponse>("/movie/create_movie_project_v3", params);
|
post<QueueResponse>("/movie/create_movie_project_v3", params);
|
||||||
return withQueuePolling(apiCall, request);
|
const user_data = getClientUserData();
|
||||||
|
return withQueuePolling(apiCall, { ...(request as any), user_data } as any);
|
||||||
};
|
};
|
||||||
@ -15,6 +15,7 @@ import {
|
|||||||
} from "@/api/DTO/movie_start_dto";
|
} from "@/api/DTO/movie_start_dto";
|
||||||
import { MovieProjectService, MovieProjectMode } from "./MovieProjectService";
|
import { MovieProjectService, MovieProjectMode } from "./MovieProjectService";
|
||||||
import { AspectRatioValue } from '@/components/ChatInputBox/AspectRatioSelector'
|
import { AspectRatioValue } from '@/components/ChatInputBox/AspectRatioSelector'
|
||||||
|
import { getClientUserData } from "@/api/common";
|
||||||
|
|
||||||
interface UseImageStoryService {
|
interface UseImageStoryService {
|
||||||
/** 当前图片故事数据 */
|
/** 当前图片故事数据 */
|
||||||
@ -477,6 +478,7 @@ export const useImageStoryServiceHook = (): UseImageStoryService => {
|
|||||||
const params: CreateMovieProjectV2Request = {
|
const params: CreateMovieProjectV2Request = {
|
||||||
script: storyContent,
|
script: storyContent,
|
||||||
user_id,
|
user_id,
|
||||||
|
user_data: getClientUserData(),
|
||||||
mode,
|
mode,
|
||||||
resolution,
|
resolution,
|
||||||
genre: selectedCategory,
|
genre: selectedCategory,
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { generateTextToImage } from "@/api/movie_start";
|
|||||||
import { MovieProjectService, MovieProjectMode } from "./MovieProjectService";
|
import { MovieProjectService, MovieProjectMode } from "./MovieProjectService";
|
||||||
import { CreateMovieProjectV3Request } from "@/api/DTO/movie_start_dto";
|
import { CreateMovieProjectV3Request } from "@/api/DTO/movie_start_dto";
|
||||||
import { AspectRatioValue } from '@/components/ChatInputBox/AspectRatioSelector'
|
import { AspectRatioValue } from '@/components/ChatInputBox/AspectRatioSelector'
|
||||||
|
import { getClientUserData } from "@/api/common";
|
||||||
|
|
||||||
interface UseTemplateStoryService {
|
interface UseTemplateStoryService {
|
||||||
/** 模板列表 */
|
/** 模板列表 */
|
||||||
@ -267,6 +268,7 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
|
|||||||
script: script,
|
script: script,
|
||||||
category: selectedTemplate?.category || "",
|
category: selectedTemplate?.category || "",
|
||||||
user_id,
|
user_id,
|
||||||
|
user_data: getClientUserData(),
|
||||||
mode,
|
mode,
|
||||||
resolution,
|
resolution,
|
||||||
storyRole: selectedTemplate?.storyRole || [],
|
storyRole: selectedTemplate?.storyRole || [],
|
||||||
|
|||||||
@ -44,6 +44,7 @@ if [ "$current_branch" = "$BRANCH_NAME" ]; then
|
|||||||
|
|
||||||
# 准备dist目录
|
# 准备dist目录
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
rm -rf .next/cache
|
||||||
cp -r .next dist/
|
cp -r .next dist/
|
||||||
cp -r public dist/
|
cp -r public dist/
|
||||||
cp package.json dist/
|
cp package.json dist/
|
||||||
|
|||||||
@ -51,6 +51,7 @@ import { PcPhotoStoryModal } from "./PcPhotoStoryModal";
|
|||||||
import { H5PhotoStoryDrawer } from "./H5PhotoStoryDrawer";
|
import { H5PhotoStoryDrawer } from "./H5PhotoStoryDrawer";
|
||||||
import { AspectRatioSelector, AspectRatioValue } from "./AspectRatioSelector";
|
import { AspectRatioSelector, AspectRatioValue } from "./AspectRatioSelector";
|
||||||
import { useTemplateStoryServiceHook } from "@/app/service/Interaction/templateStoryService";
|
import { useTemplateStoryServiceHook } from "@/app/service/Interaction/templateStoryService";
|
||||||
|
import { getClientUserData } from "@/api/common";
|
||||||
|
|
||||||
const LauguageOptions = [
|
const LauguageOptions = [
|
||||||
{ value: "english", label: "English", isVip: false, code:'EN' },
|
{ value: "english", label: "English", isVip: false, code:'EN' },
|
||||||
@ -270,6 +271,7 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
|
|||||||
// 创建剧集数据
|
// 创建剧集数据
|
||||||
let episodeData: any = {
|
let episodeData: any = {
|
||||||
user_id: String(User.id),
|
user_id: String(User.id),
|
||||||
|
user_data: getClientUserData(),
|
||||||
script: script,
|
script: script,
|
||||||
mode: configOptions.mode,
|
mode: configOptions.mode,
|
||||||
resolution: configOptions.resolution,
|
resolution: configOptions.resolution,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user