You've already forked Nano-Banana-AI-Image-Editor
新增设置面板
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { GoogleGenAI } from '@google/genai'
|
||||
|
||||
// 注意:在生产环境中,这应该通过后端代理处理
|
||||
const API_KEY = import.meta.env.VITE_GEMINI_API_KEY || 'demo-key'
|
||||
// 优先使用localStorage中的API密钥,如果没有则使用环境变量中的,最后使用默认值
|
||||
const API_KEY = localStorage.getItem('VITE_GEMINI_API_KEY') || import.meta.env.VITE_GEMINI_API_KEY || 'demo-key'
|
||||
const genAI = new GoogleGenAI({ apiKey: API_KEY })
|
||||
|
||||
export interface GenerationRequest {
|
||||
|
||||
Reference in New Issue
Block a user