├── .browserslistrc ├── public └── favicon.ico ├── src ├── assets │ ├── logo.png │ ├── img │ │ ├── bgHero.jpg │ │ ├── icon1.png │ │ ├── icon2.png │ │ ├── icon3.png │ │ ├── speed.png │ │ ├── security.png │ │ ├── integration.png │ │ ├── wave2.svg │ │ ├── borderWaves.svg │ │ └── hero-background.svg │ ├── placeholder.png │ ├── fonts │ │ ├── alihei.ttf │ │ └── HomoLight.ttf │ └── logo.svg ├── styles │ ├── README.md │ └── settings.scss ├── stores │ ├── index.js │ ├── app.js │ ├── README.md │ └── userStore.js ├── plugins │ ├── README.md │ ├── index.js │ └── vuetify.js ├── pages │ ├── Login.vue │ ├── Register.vue │ ├── RTFaceRecognition.vue │ ├── xunfei │ │ ├── FaceCompare.vue │ │ └── FaceFeatures.vue │ ├── README.md │ ├── index.vue │ └── chat.vue ├── components │ ├── app │ │ ├── VerticalDivider.vue │ │ ├── Btn.vue │ │ ├── Menu.vue │ │ ├── LinkListItem.vue │ │ └── Bar.vue │ ├── home │ │ ├── Footer.vue │ │ ├── HowToUse.vue │ │ ├── About.vue │ │ └── Welcome.vue │ ├── chat │ │ ├── WelcomeCard.vue │ │ ├── Conversation.vue │ │ ├── Welcome.vue │ │ └── Message.vue │ ├── README.md │ ├── ImageUpload.vue │ ├── xunfei │ │ ├── FaceCompare.vue │ │ └── FaceFeatures.vue │ ├── FaceRecognition.vue │ ├── FaceLogin.vue │ └── FaceRegister.vue ├── App.vue ├── layouts │ ├── default.vue │ ├── home.vue │ └── README.md ├── main.js ├── router │ └── index.js └── models │ └── conversation.js ├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── index.html ├── jsconfig.json ├── package.json ├── vite.config.mjs ├── .eslintrc-auto-import.json └── README.md /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | not ie 11 5 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/img/bgHero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/bgHero.jpg -------------------------------------------------------------------------------- /src/assets/img/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/icon1.png -------------------------------------------------------------------------------- /src/assets/img/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/icon2.png -------------------------------------------------------------------------------- /src/assets/img/icon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/icon3.png -------------------------------------------------------------------------------- /src/assets/img/speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/speed.png -------------------------------------------------------------------------------- /src/assets/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/placeholder.png -------------------------------------------------------------------------------- /src/styles/README.md: -------------------------------------------------------------------------------- 1 | # Styles 2 | 3 | This directory is for configuring the styles of the application. 4 | -------------------------------------------------------------------------------- /src/assets/fonts/alihei.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/fonts/alihei.ttf -------------------------------------------------------------------------------- /src/assets/img/security.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/security.png -------------------------------------------------------------------------------- /src/assets/fonts/HomoLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/fonts/HomoLight.ttf -------------------------------------------------------------------------------- /src/assets/img/integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/p0ise/swuai-frontend/main/src/assets/img/integration.png -------------------------------------------------------------------------------- /src/stores/index.js: -------------------------------------------------------------------------------- 1 | // Utilities 2 | import { createPinia } from 'pinia' 3 | 4 | export default createPinia() 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /src/stores/app.js: -------------------------------------------------------------------------------- 1 | // Utilities 2 | import { defineStore } from 'pinia' 3 | 4 | export const useAppStore = defineStore('app', { 5 | state: () => ({ 6 | // 7 | }), 8 | }) 9 | -------------------------------------------------------------------------------- /src/plugins/README.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | Plugins are a way to extend the functionality of your Vue application. Use this folder for registering plugins that you want to use globally. 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | extends: [ 7 | 'plugin:vue/vue3-essential', 8 | 'eslint:recommended', 9 | ], 10 | } 11 | -------------------------------------------------------------------------------- /src/pages/Login.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /src/stores/README.md: -------------------------------------------------------------------------------- 1 | # Store 2 | 3 | Pinia stores are used to store reactive state and expose actions to mutate it. 4 | 5 | Full documentation for this feature can be found in the Official [Pinia](https://pinia.esm.dev/) repository. 6 | -------------------------------------------------------------------------------- /src/components/app/VerticalDivider.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /src/pages/Register.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /src/pages/RTFaceRecognition.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/pages/xunfei/FaceCompare.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/pages/xunfei/FaceFeatures.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /src/styles/settings.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * src/styles/settings.scss 3 | * 4 | * Configures SASS variables and Vuetify overwrites 5 | */ 6 | 7 | // https://vuetifyjs.com/features/sass-variables/` 8 | // @use 'vuetify/settings' with ( 9 | // $color-pack: false 10 | // ); 11 | -------------------------------------------------------------------------------- /src/pages/README.md: -------------------------------------------------------------------------------- 1 | # Pages 2 | 3 | Vue components created in this folder will automatically be converted to navigatable routes. 4 | 5 | Full documentation for this feature can be found in the Official [unplugin-vue-router](https://github.com/posva/unplugin-vue-router) repository. 6 | -------------------------------------------------------------------------------- /src/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 16 | -------------------------------------------------------------------------------- /src/layouts/home.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /src/layouts/README.md: -------------------------------------------------------------------------------- 1 | # Layouts 2 | 3 | Layouts are reusable components that wrap around pages. They are used to provide a consistent look and feel across multiple pages. 4 | 5 | Full documentation for this feature can be found in the Official [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts) repository. 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /src/components/home/Footer.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | -------------------------------------------------------------------------------- /src/plugins/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugins/index.js 3 | * 4 | * Automatically included in `./src/main.js` 5 | */ 6 | 7 | // Plugins 8 | import vuetify from './vuetify' 9 | import pinia from '@/stores' 10 | import router from '@/router' 11 | 12 | export function registerPlugins (app) { 13 | app 14 | .use(vuetify) 15 | .use(router) 16 | .use(pinia) 17 | } 18 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "target": "es5", 5 | "module": "esnext", 6 | "baseUrl": "./", 7 | "moduleResolution": "node", 8 | "paths": { 9 | "@/*": [ 10 | "src/*" 11 | ] 12 | }, 13 | "lib": [ 14 | "esnext", 15 | "dom", 16 | "dom.iterable", 17 | "scripthost" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/pages/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 20 | 21 | 22 | { 23 | meta: { 24 | layout: 'home' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/plugins/vuetify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugins/vuetify.js 3 | * 4 | * Framework documentation: https://vuetifyjs.com` 5 | */ 6 | 7 | // Styles 8 | import '@mdi/font/css/materialdesignicons.css' 9 | import 'vuetify/styles' 10 | 11 | // Composables 12 | import { createVuetify } from 'vuetify' 13 | 14 | // https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides 15 | export default createVuetify({ 16 | theme: { 17 | defaultTheme: 'light', 18 | }, 19 | }) 20 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * main.js 3 | * 4 | * Bootstraps Vuetify and other plugins then mounts the App` 5 | */ 6 | 7 | // Plugins 8 | import { registerPlugins } from '@/plugins' 9 | 10 | // Components 11 | import App from './App.vue' 12 | 13 | // Composables 14 | import { createApp } from 'vue' 15 | import { createHead } from '@unhead/vue' 16 | 17 | const app = createApp(App) 18 | 19 | const head = createHead() 20 | app.use(head) 21 | 22 | registerPlugins(app) 23 | 24 | app.mount('#app') 25 | -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/chat/WelcomeCard.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /src/stores/userStore.js: -------------------------------------------------------------------------------- 1 | // stores/userStore.js 2 | import { defineStore } from 'pinia'; 3 | 4 | export const useUserStore = defineStore('userStore', { 5 | state: () => ({ 6 | user: JSON.parse(localStorage.getItem('user')) || null 7 | }), 8 | getters: { 9 | isLoggedIn: (state) => !!state.user, 10 | currentUser: (state) => state.user 11 | }, 12 | actions: { 13 | login(user) { 14 | this.user = user; 15 | localStorage.setItem('user', JSON.stringify(user)); 16 | }, 17 | logout() { 18 | this.user = null; 19 | localStorage.removeItem('user'); 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /src/assets/img/wave2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/components/app/Btn.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * router/index.ts 3 | * 4 | * Automatic routes for `./src/pages/*.vue` 5 | */ 6 | 7 | // Composables 8 | import { createRouter, createWebHistory } from 'vue-router/auto' 9 | import { setupLayouts } from 'virtual:generated-layouts' 10 | import { useUserStore } from '@/stores/userStore' 11 | 12 | const router = createRouter({ 13 | history: createWebHistory(import.meta.env.BASE_URL), 14 | extendRoutes: setupLayouts, 15 | }) 16 | 17 | router.beforeEach((to, from, next) => { 18 | const userStore = useUserStore(); 19 | const requiresAuth = to.matched.some(record => record.meta.requiresAuth); 20 | 21 | if (requiresAuth && !userStore.isLoggedIn) { 22 | next({ name: '/login' }); 23 | } else { 24 | next(); 25 | } 26 | }); 27 | 28 | export default router 29 | -------------------------------------------------------------------------------- /src/components/app/Menu.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /src/components/README.md: -------------------------------------------------------------------------------- 1 | # Components 2 | 3 | Vue template files in this folder are automatically imported. 4 | 5 | ## 🚀 Usage 6 | 7 | Importing is handled by [unplugin-vue-components](https://github.com/unplugin/unplugin-vue-components). This plugin automatically imports `.vue` files created in the `src/components` directory, and registers them as global components. This means that you can use any component in your application without having to manually import it. 8 | 9 | The following example assumes a component located at `src/components/MyComponent.vue`: 10 | 11 | ```vue 12 | 17 | 18 | 21 | ``` 22 | 23 | When your template is rendered, the component's import will automatically be inlined, which renders to this: 24 | 25 | ```vue 26 | 31 | 32 | 35 | ``` 36 | -------------------------------------------------------------------------------- /src/components/app/LinkListItem.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 39 | 40 | -------------------------------------------------------------------------------- /src/assets/img/borderWaves.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | wave 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/components/home/HowToUse.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 34 | -------------------------------------------------------------------------------- /src/components/chat/Conversation.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 46 | 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iflyface-frontend", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build", 7 | "preview": "vite preview", 8 | "lint": "eslint . --fix --ignore-path .gitignore" 9 | }, 10 | "dependencies": { 11 | "@mdi/font": "7.0.96", 12 | "@unhead/vue": "^1.9.4", 13 | "axios": "^1.6.8", 14 | "copy-to-clipboard": "^3.3.3", 15 | "core-js": "^3.34.0", 16 | "highlight.js": "^11.9.0", 17 | "markdown-it": "^14.1.0", 18 | "markdown-it-mathjax3": "^4.3.2", 19 | "roboto-fontface": "*", 20 | "socket.io-client": "^4.7.5", 21 | "vue": "^3.4.0", 22 | "vuetify": "^3.5.0" 23 | }, 24 | "devDependencies": { 25 | "@vitejs/plugin-vue": "^5.0.4", 26 | "eslint": "^8.57.0", 27 | "eslint-config-standard": "^17.1.0", 28 | "eslint-plugin-import": "^2.29.1", 29 | "eslint-plugin-n": "^16.6.2", 30 | "eslint-plugin-node": "^11.1.0", 31 | "eslint-plugin-promise": "^6.1.1", 32 | "eslint-plugin-vue": "^9.22.0", 33 | "pinia": "^2.1.7", 34 | "sass": "^1.71.1", 35 | "unplugin-auto-import": "^0.17.5", 36 | "unplugin-fonts": "^1.1.1", 37 | "unplugin-vue-components": "^0.26.0", 38 | "unplugin-vue-router": "^0.8.4", 39 | "vite": "^5.1.5", 40 | "vite-plugin-vue-layouts": "^0.11.0", 41 | "vite-plugin-vuetify": "^2.0.3", 42 | "vue-router": "^4.3.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/components/home/About.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 41 | 42 | 48 | -------------------------------------------------------------------------------- /src/components/app/Bar.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/components/ImageUpload.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 48 | 49 | -------------------------------------------------------------------------------- /vite.config.mjs: -------------------------------------------------------------------------------- 1 | // Plugins 2 | import AutoImport from 'unplugin-auto-import/vite' 3 | import Components from 'unplugin-vue-components/vite' 4 | import Fonts from 'unplugin-fonts/vite' 5 | import Layouts from 'vite-plugin-vue-layouts' 6 | import Vue from '@vitejs/plugin-vue' 7 | import VueRouter from 'unplugin-vue-router/vite' 8 | import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' 9 | 10 | // Utilities 11 | import { defineConfig } from 'vite' 12 | import { fileURLToPath, URL } from 'node:url' 13 | 14 | // https://vitejs.dev/config/ 15 | export default defineConfig({ 16 | plugins: [ 17 | VueRouter(), 18 | Layouts(), 19 | Vue({ 20 | template: { transformAssetUrls } 21 | }), 22 | // https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme 23 | Vuetify({ 24 | autoImport: true, 25 | styles: { 26 | configFile: 'src/styles/settings.scss', 27 | }, 28 | }), 29 | Components({ 30 | directoryAsNamespace: true, 31 | }), 32 | Fonts({ 33 | google: { 34 | families: [{ 35 | name: 'Roboto', 36 | styles: 'wght@100;300;400;500;700;900', 37 | }], 38 | }, 39 | }), 40 | AutoImport({ 41 | imports: [ 42 | 'vue', 43 | 'vue-router', 44 | ], 45 | eslintrc: { 46 | enabled: true, 47 | }, 48 | vueTemplate: true, 49 | }), 50 | ], 51 | define: { 'process.env': {} }, 52 | resolve: { 53 | alias: { 54 | '@': fileURLToPath(new URL('./src', import.meta.url)) 55 | }, 56 | extensions: [ 57 | '.js', 58 | '.json', 59 | '.jsx', 60 | '.mjs', 61 | '.ts', 62 | '.tsx', 63 | '.vue', 64 | ], 65 | }, 66 | server: { 67 | port: 5001, 68 | }, 69 | }) 70 | -------------------------------------------------------------------------------- /.eslintrc-auto-import.json: -------------------------------------------------------------------------------- 1 | { 2 | "globals": { 3 | "Component": true, 4 | "ComponentPublicInstance": true, 5 | "ComputedRef": true, 6 | "EffectScope": true, 7 | "ExtractDefaultPropTypes": true, 8 | "ExtractPropTypes": true, 9 | "ExtractPublicPropTypes": true, 10 | "InjectionKey": true, 11 | "PropType": true, 12 | "Ref": true, 13 | "VNode": true, 14 | "WritableComputedRef": true, 15 | "computed": true, 16 | "createApp": true, 17 | "customRef": true, 18 | "defineAsyncComponent": true, 19 | "defineComponent": true, 20 | "effectScope": true, 21 | "getCurrentInstance": true, 22 | "getCurrentScope": true, 23 | "h": true, 24 | "inject": true, 25 | "isProxy": true, 26 | "isReactive": true, 27 | "isReadonly": true, 28 | "isRef": true, 29 | "markRaw": true, 30 | "nextTick": true, 31 | "onActivated": true, 32 | "onBeforeMount": true, 33 | "onBeforeRouteLeave": true, 34 | "onBeforeRouteUpdate": true, 35 | "onBeforeUnmount": true, 36 | "onBeforeUpdate": true, 37 | "onDeactivated": true, 38 | "onErrorCaptured": true, 39 | "onMounted": true, 40 | "onRenderTracked": true, 41 | "onRenderTriggered": true, 42 | "onScopeDispose": true, 43 | "onServerPrefetch": true, 44 | "onUnmounted": true, 45 | "onUpdated": true, 46 | "provide": true, 47 | "reactive": true, 48 | "readonly": true, 49 | "ref": true, 50 | "resolveComponent": true, 51 | "shallowReactive": true, 52 | "shallowReadonly": true, 53 | "shallowRef": true, 54 | "toRaw": true, 55 | "toRef": true, 56 | "toRefs": true, 57 | "toValue": true, 58 | "triggerRef": true, 59 | "unref": true, 60 | "useAttrs": true, 61 | "useCssModule": true, 62 | "useCssVars": true, 63 | "useLink": true, 64 | "useRoute": true, 65 | "useRouter": true, 66 | "useSlots": true, 67 | "watch": true, 68 | "watchEffect": true, 69 | "watchPostEffect": true, 70 | "watchSyncEffect": true, 71 | "getActiveHead": true, 72 | "injectHead": true, 73 | "useHead": true, 74 | "useHeadSafe": true, 75 | "useSeoMeta": true, 76 | "useServerHead": true, 77 | "useServerHeadSafe": true, 78 | "useServerSeoMeta": true 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/components/chat/Welcome.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | -------------------------------------------------------------------------------- /src/components/home/Welcome.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 67 | 68 | -------------------------------------------------------------------------------- /src/models/conversation.js: -------------------------------------------------------------------------------- 1 | class Node { 2 | constructor(role, content, parent = null) { 3 | this.role = role; // 角色(例如:用户、系统) 4 | this.content = content; // 内容 5 | this.children = []; // 子节点数组 6 | this.parent = parent; // 父节点引用 7 | } 8 | 9 | getFirstLeaf() { 10 | let node = this; 11 | while (node.children.length > 0) { 12 | node = node.children[0]; 13 | } 14 | return node; 15 | } 16 | 17 | addChild(node) { 18 | node.parent = this; 19 | this.children.push(node); 20 | } 21 | 22 | removeChild(node) { 23 | const index = this.children.indexOf(node); 24 | if (index !== -1) { 25 | this.children.splice(index, 1); 26 | node.parent = null; 27 | } else { 28 | console.error('指定的节点不存在'); 29 | } 30 | } 31 | 32 | addSibling(node) { 33 | if (this.parent) { 34 | this.parent.addChild(node); 35 | } else { 36 | console.error('根节点不能添加兄弟节点'); 37 | } 38 | } 39 | 40 | getSiblings() { 41 | if (this.parent) { 42 | return this.parent.children; 43 | } 44 | return []; 45 | } 46 | 47 | indexOfSiblings() { 48 | if (this.parent) { 49 | return this.parent.children.indexOf(this); 50 | } else { 51 | return -1; 52 | } 53 | } 54 | 55 | prevSibling() { 56 | if (this.parent) { 57 | const index = this.indexOfSiblings(); 58 | if (index > 0) { 59 | return this.parent.children[index - 1]; 60 | } 61 | } 62 | return null; 63 | } 64 | 65 | nextSibling() { 66 | if (this.parent) { 67 | const index = this.indexOfSiblings(); 68 | if (index < this.parent.children.length - 1) { 69 | return this.parent.children[index + 1]; 70 | } 71 | } 72 | return null; 73 | } 74 | } 75 | 76 | class Conversation { 77 | constructor(title) { 78 | this.title = title; 79 | this.root = new Node('Virtual Root', ''); // 存储所有根节点的数组 80 | this.currentLeaf = this.root; // 当前节点,根据对话流程更新 81 | } 82 | 83 | // 设置当前对话节点 84 | setCurrentLeaf(node) { 85 | this.currentLeaf = node.getFirstLeaf(); 86 | } 87 | 88 | // 获取当前节点的路径 89 | getPath(node = this.currentLeaf) { 90 | let path = []; 91 | while (node && node.parent) { 92 | path.unshift(node); 93 | node = node.parent; 94 | } 95 | return path; 96 | } 97 | 98 | getMessages(node = this.currentLeaf) { 99 | let messages = []; 100 | while (node && node.parent) { 101 | messages.unshift({ role: node.role, content: node.content }); 102 | node = node.parent; 103 | } 104 | return messages; 105 | } 106 | 107 | removeNode(node) { 108 | if (!node) { 109 | console.error('指定的节点不存在'); 110 | return; 111 | } 112 | if (!node.parent) { 113 | console.error('根节点不能删除'); 114 | return; 115 | } 116 | 117 | const parent = node.parent; 118 | parent.removeChild(node); 119 | this.setCurrentLeaf(parent); 120 | } 121 | 122 | addChild(node, parent = this.currentLeaf) { 123 | parent.addChild(node); 124 | this.setCurrentLeaf(node); 125 | } 126 | 127 | addSibling(node, sibling = this.currentLeaf) { 128 | sibling.addSibling(node); 129 | this.setCurrentLeaf(node); 130 | } 131 | 132 | navigateTo(node) { 133 | console.log("navigateTo", node) 134 | if (!node) { 135 | console.error('指定的节点不存在'); 136 | return; 137 | } 138 | if (!node.parent) { 139 | console.error('根节点不能导航'); 140 | return; 141 | } 142 | 143 | this.setCurrentLeaf(node); 144 | } 145 | } 146 | 147 | 148 | export { Conversation, Node }; 149 | -------------------------------------------------------------------------------- /src/assets/img/hero-background.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/components/xunfei/FaceCompare.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 99 | 100 | 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vuetify (Default) 2 | 3 | This is the official scaffolding tool for Vuetify, designed to give you a head start in building your new Vuetify application. It sets up a base template with all the necessary configurations and standard directory structure, enabling you to begin development without the hassle of setting up the project from scratch. 4 | 5 | ## ❗️ Important Links 6 | 7 | - 📄 [Docs](https://vuetifyjs.com/) 8 | - 🚨 [Issues](https://issues.vuetifyjs.com/) 9 | - 🏬 [Store](https://store.vuetifyjs.com/) 10 | - 🎮 [Playground](https://play.vuetifyjs.com/) 11 | - 💬 [Discord](https://community.vuetifyjs.com) 12 | 13 | ## 💿 Install 14 | 15 | Set up your project using your preferred package manager. Use the corresponding command to install the dependencies: 16 | 17 | | Package Manager | Command | 18 | |---------------------------------------------------------------|----------------| 19 | | [yarn](https://yarnpkg.com/getting-started) | `yarn install` | 20 | | [npm](https://docs.npmjs.com/cli/v7/commands/npm-install) | `npm install` | 21 | | [pnpm](https://pnpm.io/installation) | `pnpm install` | 22 | | [bun](https://bun.sh/#getting-started) | `bun install` | 23 | 24 | After completing the installation, your environment is ready for Vuetify development. 25 | 26 | ## ✨ Features 27 | 28 | - 🖼️ **Optimized Front-End Stack**: Leverage the latest Vue 3 and Vuetify 3 for a modern, reactive UI development experience. [Vue 3](https://v3.vuejs.org/) | [Vuetify 3](https://vuetifyjs.com/en/) 29 | - 🗃️ **State Management**: Integrated with [Pinia](https://pinia.vuejs.org/), the intuitive, modular state management solution for Vue. 30 | - 🚦 **Routing and Layouts**: Utilizes Vue Router for SPA navigation and vite-plugin-vue-layouts for organizing Vue file layouts. [Vue Router](https://router.vuejs.org/) | [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts) 31 | - ⚡ **Next-Gen Tooling**: Powered by Vite, experience fast cold starts and instant HMR (Hot Module Replacement). [Vite](https://vitejs.dev/) 32 | - 🧩 **Automated Component Importing**: Streamline your workflow with unplugin-vue-components, automatically importing components as you use them. [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components) 33 | 34 | These features are curated to provide a seamless development experience from setup to deployment, ensuring that your Vuetify application is both powerful and maintainable. 35 | 36 | ## 💡 Usage 37 | 38 | This section covers how to start the development server and build your project for production. 39 | 40 | ### Starting the Development Server 41 | 42 | To start the development server with hot-reload, run the following command. The server will be accessible at [http://localhost:3000](http://localhost:3000): 43 | 44 | ```bash 45 | yarn dev 46 | ``` 47 | 48 | (Repeat for npm, pnpm, and bun with respective commands.) 49 | 50 | > Add NODE_OPTIONS='--no-warnings' to suppress the JSON import warnings that happen as part of the Vuetify import mapping. If you are on Node [v21.3.0](https://nodejs.org/en/blog/release/v21.3.0) or higher, you can change this to NODE_OPTIONS='--disable-warning=5401'. If you don't mind the warning, you can remove this from your package.json dev script. 51 | 52 | ### Building for Production 53 | 54 | To build your project for production, use: 55 | 56 | ```bash 57 | yarn build 58 | ``` 59 | 60 | (Repeat for npm, pnpm, and bun with respective commands.) 61 | 62 | Once the build process is completed, your application will be ready for deployment in a production environment. 63 | 64 | ## 💪 Support Vuetify Development 65 | 66 | This project is built with [Vuetify](https://vuetifyjs.com/en/), a UI Library with a comprehensive collection of Vue components. Vuetify is an MIT licensed Open Source project that has been made possible due to the generous contributions by our [sponsors and backers](https://vuetifyjs.com/introduction/sponsors-and-backers/). If you are interested in supporting this project, please consider: 67 | 68 | - [Requesting Enterprise Support](https://support.vuetifyjs.com/) 69 | - [Sponsoring John on Github](https://github.com/users/johnleider/sponsorship) 70 | - [Sponsoring Kael on Github](https://github.com/users/kaelwd/sponsorship) 71 | - [Supporting the team on Open Collective](https://opencollective.com/vuetify) 72 | - [Becoming a sponsor on Patreon](https://www.patreon.com/vuetify) 73 | - [Becoming a subscriber on Tidelift](https://tidelift.com/subscription/npm/vuetify) 74 | - [Making a one-time donation with Paypal](https://paypal.me/vuetify) 75 | 76 | ## 📑 License 77 | [MIT](http://opensource.org/licenses/MIT) 78 | 79 | Copyright (c) 2016-present Vuetify, LLC 80 | -------------------------------------------------------------------------------- /src/components/xunfei/FaceFeatures.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 128 | 129 | 141 | -------------------------------------------------------------------------------- /src/components/FaceRecognition.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 204 | 205 | 229 | -------------------------------------------------------------------------------- /src/components/chat/Message.vue: -------------------------------------------------------------------------------- 1 | 76 | 77 | 205 | 206 | 207 | -------------------------------------------------------------------------------- /src/components/FaceLogin.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 259 | 260 | 315 | -------------------------------------------------------------------------------- /src/pages/chat.vue: -------------------------------------------------------------------------------- 1 | 116 | 117 | 240 | 241 | 250 | 251 | 252 | { 253 | meta: { 254 | layout: false, 255 | requiresAuth: true 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /src/components/FaceRegister.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 276 | 277 | 332 | --------------------------------------------------------------------------------