Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/src/components/layout/Person.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useUserStore } from '@/stores/user'
import { userApi } from '@/api/auth'
import { toLoginPage } from '@/utils/utils'
import { useCache } from '@/utils/useCache'
import { resolveHelpUrl } from '@/utils/helpUrl'

const { wsCache } = useCache()
const router = useRouter()
Expand Down Expand Up @@ -90,7 +91,7 @@ const changeLanguage = (lang: string) => {
}

const openHelp = () => {
window.open(appearanceStore.getHelp || 'https://dataease.cn/sqlbot/', '_blank')
window.open(resolveHelpUrl(appearanceStore.getHelp), '_blank')
}

const openPwd = () => {
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/utils/helpUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const DEFAULT_HELP_URL = 'https://docs.fit2cloud.com/sqlbot/'

const legacyDefaultHelpUrl = /^https:\/\/dataease\.cn\/sqlbot(?:\/v1)?\/?$/

export const resolveHelpUrl = (url?: string | null): string => {
return !url || legacyDefaultHelpUrl.test(url) ? DEFAULT_HELP_URL : url
}
6 changes: 4 additions & 2 deletions frontend/src/views/system/appearance/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ import { useAppearanceStoreWithOut } from '@/stores/appearance'
import LoginPreview from './LoginPreview.vue'
import Person from './Person.vue'
import { setCurrentColor } from '@/utils/utils'
import { DEFAULT_HELP_URL, resolveHelpUrl } from '@/utils/helpUrl'

// import TinymceEditor from '@/components/rich-text/TinymceEditor.vue'
import { cloneDeep } from 'lodash-es'
Expand Down Expand Up @@ -371,7 +372,7 @@ const rules = reactive<FormRules>({
})

const defaultTopForm = {
help: 'https://dataease.cn/sqlbot/v1/',
help: DEFAULT_HELP_URL,
showDoc: '0',
showAbout: '0',
pc_welcome: '',
Expand Down Expand Up @@ -506,7 +507,8 @@ const init = () => {
} else if (Object.prototype.hasOwnProperty.call(loginForm, pkey)) {
loginForm[pkey as keyof typeof loginForm] = pval
} else if (Object.prototype.hasOwnProperty.call(topForm, pkey)) {
topForm[pkey as keyof typeof topForm] = pval
topForm[pkey as keyof typeof topForm] =
pkey === 'help' && pval ? resolveHelpUrl(pval) : pval
} else if (pkey === 'mobileLogin') {
mobileLogin.value = pval
} else if (pkey === 'mobileLoginBg') {
Expand Down
Loading