diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b311b780..da7758a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile - name: Lint run: pnpm run lint @@ -131,7 +131,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install + run: pnpm install --frozen-lockfile - name: Typecheck run: pnpm check:type diff --git a/packages/@core/forward/preferences/src/config.ts b/packages/@core/forward/preferences/src/config.ts index cbf37964..388c1cce 100644 --- a/packages/@core/forward/preferences/src/config.ts +++ b/packages/@core/forward/preferences/src/config.ts @@ -2,6 +2,7 @@ import type { Preferences } from './types'; const defaultPreferences: Preferences = { app: { + aiAssistant: true, authPageLayout: 'panel-right', colorGrayMode: false, colorWeakMode: false, diff --git a/packages/@core/forward/preferences/src/types.ts b/packages/@core/forward/preferences/src/types.ts index 192da9d2..eb139805 100644 --- a/packages/@core/forward/preferences/src/types.ts +++ b/packages/@core/forward/preferences/src/types.ts @@ -15,6 +15,8 @@ type PageTransitionType = 'fade' | 'fade-down' | 'fade-slide' | 'fade-up'; type AuthPageLayoutType = 'panel-center' | 'panel-left' | 'panel-right'; interface AppPreferences { + /** 是否开启vben助手 */ + aiAssistant: boolean; /** 登录注册页面布局 */ authPageLayout: AuthPageLayoutType; /** 是否开启灰色模式 */ diff --git a/packages/business/common-ui/src/coze-assistant/assistant.vue b/packages/business/common-ui/src/coze-assistant/assistant.vue new file mode 100644 index 00000000..21d83e51 --- /dev/null +++ b/packages/business/common-ui/src/coze-assistant/assistant.vue @@ -0,0 +1,70 @@ + + + + diff --git a/packages/business/common-ui/src/coze-assistant/index.ts b/packages/business/common-ui/src/coze-assistant/index.ts new file mode 100644 index 00000000..8e7b2ef7 --- /dev/null +++ b/packages/business/common-ui/src/coze-assistant/index.ts @@ -0,0 +1 @@ +export { default as CozeAssistant } from './assistant.vue'; diff --git a/packages/business/common-ui/src/global-provider/global-provider.vue b/packages/business/common-ui/src/global-provider/global-provider.vue index b9eb1fc2..e8055bb2 100644 --- a/packages/business/common-ui/src/global-provider/global-provider.vue +++ b/packages/business/common-ui/src/global-provider/global-provider.vue @@ -1,9 +1,16 @@ diff --git a/packages/business/common-ui/src/index.ts b/packages/business/common-ui/src/index.ts index 3f2f8b6c..6bcbc03b 100644 --- a/packages/business/common-ui/src/index.ts +++ b/packages/business/common-ui/src/index.ts @@ -1,4 +1,5 @@ export * from './authentication'; +export * from './coze-assistant'; export * from './fallback'; export * from './global-provider'; export * from './global-search'; diff --git a/packages/business/common-ui/src/preferences/blocks/general/general.vue b/packages/business/common-ui/src/preferences/blocks/general/general.vue index 4d5c6ae6..399b2cbe 100644 --- a/packages/business/common-ui/src/preferences/blocks/general/general.vue +++ b/packages/business/common-ui/src/preferences/blocks/general/general.vue @@ -13,6 +13,7 @@ defineOptions({ const appLocale = defineModel('appLocale'); const appDynamicTitle = defineModel('appDynamicTitle'); +const appAiAssistant = defineModel('appAiAssistant'); const localeItems: SelectListItem[] = SUPPORT_LANGUAGES.map((item) => ({ label: item.text, @@ -27,4 +28,7 @@ const localeItems: SelectListItem[] = SUPPORT_LANGUAGES.map((item) => ({ {{ $t('preferences.dynamic-title') }} + + {{ $t('preferences.ai-assistant') }} + diff --git a/packages/business/common-ui/src/preferences/preferences-widget.vue b/packages/business/common-ui/src/preferences/preferences-widget.vue index 7cdf330a..e5ea25b8 100644 --- a/packages/business/common-ui/src/preferences/preferences-widget.vue +++ b/packages/business/common-ui/src/preferences/preferences-widget.vue @@ -10,6 +10,7 @@ import Preferences from './preferences.vue';