fix: update chat url to /c/*

closes #119, closes #123
This commit is contained in:
Pionxzh
2023-04-14 11:12:39 +08:00
parent 46036a6abf
commit 96ec23e7bd
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ function conversationToHtml(conversation: ConversationResult, avatar: string, me
const date = dateStr()
const time = new Date().toISOString()
const source = `${baseUrl}/chat/${id}`
const source = `${baseUrl}/c/${id}`
const lang = document.documentElement.lang ?? 'en'
const theme = getColorScheme()
+1 -1
View File
@@ -56,7 +56,7 @@ export async function exportAllToMarkdown(fileNameFormat: string, apiConversatio
function conversationToMarkdown(conversation: ConversationResult, metaList?: ExportMeta[]) {
const { id, title, model, modelSlug, conversationNodes } = conversation
const source = `${baseUrl}/chat/${id}`
const source = `${baseUrl}/c/${id}`
const _metaList = metaList
?.filter(x => !!x.name)
+1 -1
View File
@@ -42,7 +42,7 @@ function getUserProfile() {
}
export function getChatIdFromUrl() {
const match = location.pathname.match(/^\/chat\/([a-z0-9-]+)$/i)
const match = location.pathname.match(/^\/c\/([a-z0-9-]+)$/i)
if (match) return match[1]
return null
}
+5 -5
View File
@@ -31,11 +31,11 @@ export default defineConfig({
},
'license': packageJson.license,
'match': [
'https://chat.openai.com/chat',
// support https://chat.openai.com/chat?model=gpt-4
'https://chat.openai.com/chat?*',
// support https://chat.openai.com/chat/123456789
'https://chat.openai.com/chat/*',
'https://chat.openai.com',
// support https://chat.openai.com/c?model=gpt-4
'https://chat.openai.com/c?*',
// support https://chat.openai.com/c/123456789
'https://chat.openai.com/c/*',
],
'icon': 'https://chat.openai.com/favicon.ico',
'run-at': 'document-end',