forked from 77media/video-flow
Merge branch 'zxx_dev' into dev
This commit is contained in:
commit
bb56a0bdaf
@ -10,7 +10,7 @@ import {
|
|||||||
ExternalLink,
|
ExternalLink,
|
||||||
Loader2
|
Loader2
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { shareApiUrl } from '@/lib/env';
|
import { baseUrl } from '@/lib/env';
|
||||||
import TwitterCallbackModal from './TwitterCallbackModal';
|
import TwitterCallbackModal from './TwitterCallbackModal';
|
||||||
|
|
||||||
interface ShareModalProps {
|
interface ShareModalProps {
|
||||||
@ -140,7 +140,7 @@ export default function ShareModal({ visible, onClose, project }: ShareModalProp
|
|||||||
localStorage.setItem('currentShareProject', JSON.stringify(project));
|
localStorage.setItem('currentShareProject', JSON.stringify(project));
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(`${shareApiUrl}${apiPath}?user_id=${userId}`, {
|
const response = await fetch(`${baseUrl}${apiPath}?user_id=${userId}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { Modal, Button, Spin, message } from 'antd';
|
import { Modal, Button, Spin, message } from 'antd';
|
||||||
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
|
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { shareApiUrl } from '@/lib/env';
|
import { baseUrl } from '@/lib/env';
|
||||||
|
|
||||||
interface TwitterCallbackModalProps {
|
interface TwitterCallbackModalProps {
|
||||||
/** 是否显示弹框 */
|
/** 是否显示弹框 */
|
||||||
@ -56,7 +56,7 @@ export default function TwitterCallbackModal({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 调用 Twitter 授权回调接口
|
// 调用 Twitter 授权回调接口
|
||||||
const response = await fetch(`${shareApiUrl}/api/video-share/x/auth/callback`, {
|
const response = await fetch(`${baseUrl}/api/video-share/x/auth/callback`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import { Tooltip, Button } from 'antd';
|
|||||||
import { downloadVideo, downloadAllVideos, getFirstFrame } from '@/utils/tools';
|
import { downloadVideo, downloadAllVideos, getFirstFrame } from '@/utils/tools';
|
||||||
import { showDownloadOptionsModal } from '@/components/pages/work-flow/download-options-modal';
|
import { showDownloadOptionsModal } from '@/components/pages/work-flow/download-options-modal';
|
||||||
import { post, get } from '@/api/request';
|
import { post, get } from '@/api/request';
|
||||||
import { shareApiUrl } from '@/lib/env';
|
import { baseUrl } from '@/lib/env';
|
||||||
import ShareModal from '@/components/common/ShareModal';
|
import ShareModal from '@/components/common/ShareModal';
|
||||||
import Masonry from 'react-masonry-css';
|
import Masonry from 'react-masonry-css';
|
||||||
import debounce from 'lodash/debounce';
|
import debounce from 'lodash/debounce';
|
||||||
|
|||||||
10
lib/env.ts
10
lib/env.ts
@ -17,8 +17,7 @@ export interface EnvConfig {
|
|||||||
javaUrl: string;
|
javaUrl: string;
|
||||||
cutUrl: string;
|
cutUrl: string;
|
||||||
cutUrlTo: string;
|
cutUrlTo: string;
|
||||||
shareApiUrl: string;
|
|
||||||
|
|
||||||
// Google OAuth 配置
|
// Google OAuth 配置
|
||||||
googleClientId: string;
|
googleClientId: string;
|
||||||
googleRedirectUri: string;
|
googleRedirectUri: string;
|
||||||
@ -53,7 +52,6 @@ export const getEnvConfig = (): EnvConfig => {
|
|||||||
javaUrl: process.env.NEXT_PUBLIC_JAVA_URL || 'https://77.app.java.auth.qikongjian.com',
|
javaUrl: process.env.NEXT_PUBLIC_JAVA_URL || 'https://77.app.java.auth.qikongjian.com',
|
||||||
cutUrl: process.env.NEXT_PUBLIC_CUT_URL || 'https://smartcut.api.movieflow.ai',
|
cutUrl: process.env.NEXT_PUBLIC_CUT_URL || 'https://smartcut.api.movieflow.ai',
|
||||||
cutUrlTo: process.env.NEXT_PUBLIC_CUT_URL_TO || 'https://smartcut.api.movieflow.ai',
|
cutUrlTo: process.env.NEXT_PUBLIC_CUT_URL_TO || 'https://smartcut.api.movieflow.ai',
|
||||||
shareApiUrl: process.env.NEXT_PUBLIC_SHARE_API_URL || 'http://39.97.48.225:8000',
|
|
||||||
|
|
||||||
// Google OAuth 配置
|
// Google OAuth 配置
|
||||||
googleClientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || '847079918888-o1nne8d3ij80dn20qurivo987pv07225.apps.googleusercontent.com',
|
googleClientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || '847079918888-o1nne8d3ij80dn20qurivo987pv07225.apps.googleusercontent.com',
|
||||||
@ -92,7 +90,6 @@ export const {
|
|||||||
javaUrl,
|
javaUrl,
|
||||||
cutUrl,
|
cutUrl,
|
||||||
cutUrlTo,
|
cutUrlTo,
|
||||||
shareApiUrl,
|
|
||||||
|
|
||||||
// Google OAuth 配置
|
// Google OAuth 配置
|
||||||
googleClientId,
|
googleClientId,
|
||||||
@ -158,7 +155,7 @@ export const validateEnvConfig = (): { isValid: boolean; errors: string[] } => {
|
|||||||
errors.push('NEXT_PUBLIC_JAVA_URL is required');
|
errors.push('NEXT_PUBLIC_JAVA_URL is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!shareApiUrl) {
|
if (!baseUrl) {
|
||||||
errors.push('NEXT_PUBLIC_SHARE_API_URL is required');
|
errors.push('NEXT_PUBLIC_SHARE_API_URL is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +177,7 @@ export const validateEnvConfig = (): { isValid: boolean; errors: string[] } => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new URL(shareApiUrl);
|
new URL(baseUrl);
|
||||||
} catch {
|
} catch {
|
||||||
errors.push('NEXT_PUBLIC_SHARE_API_URL must be a valid URL');
|
errors.push('NEXT_PUBLIC_SHARE_API_URL must be a valid URL');
|
||||||
}
|
}
|
||||||
@ -202,7 +199,6 @@ export const logEnvConfig = (): void => {
|
|||||||
javaUrl,
|
javaUrl,
|
||||||
cutUrl,
|
cutUrl,
|
||||||
cutUrlTo,
|
cutUrlTo,
|
||||||
shareApiUrl,
|
|
||||||
googleClientId,
|
googleClientId,
|
||||||
googleRedirectUri: getGoogleRedirectUri(),
|
googleRedirectUri: getGoogleRedirectUri(),
|
||||||
gaEnabled,
|
gaEnabled,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user