Merge pull request #4 from jingjingxinshang/fix

Fix 基于前端模版开发时可配置调用api地址
This commit is contained in:
Joel
2023-05-18 10:27:08 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import { type NextRequest } from 'next/server'
import { APP_ID, API_KEY } from '@/config'
import { APP_ID, API_KEY, API_URL } from '@/config'
import { ChatClient } from 'dify-client'
import { v4 } from 'uuid'
@ -18,4 +18,4 @@ export const setSession = (sessionId: string) => {
return { 'Set-Cookie': `session_id=${sessionId}` }
}
export const client = new ChatClient(API_KEY)
export const client = new ChatClient(API_KEY, API_URL ? API_URL : undefined)

View File

@ -1,7 +1,7 @@
import { AppInfo } from "@/types/app"
export const APP_ID = ''
export const API_KEY = ''
export const API_URL = ''
export const APP_INFO: AppInfo = {
"title": 'Chat APP',
"description": '',