├── README.md └── funai-front ├── .browserslistrc ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── index.html ├── jsconfig.json ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── favicon.png └── index.html ├── src ├── App.vue ├── api │ ├── getData.js │ ├── index.js │ └── prompt.js ├── assets │ ├── font │ │ ├── demo.css │ │ ├── demo_index.html │ │ ├── iconfont.css │ │ ├── iconfont.js │ │ ├── iconfont.json │ │ ├── iconfont.ttf │ │ ├── iconfont.woff │ │ └── iconfont.woff2 │ ├── img │ │ ├── emoji │ │ │ ├── clown-face.png │ │ │ ├── face-screaming-in-fear.png │ │ │ ├── face-vomiting.png │ │ │ ├── face-with-tongue.png │ │ │ ├── face-without-mouth.png │ │ │ ├── ghost.png │ │ │ ├── hibiscus.png │ │ │ ├── jack-o-lantern.png │ │ │ ├── lips.png │ │ │ ├── loudly-crying-face.png │ │ │ ├── money-bag.png │ │ │ ├── money-mouth-face.png │ │ │ ├── new-moon-face.png │ │ │ ├── ok-hand-yellow.png │ │ │ ├── pile-of-poo.png │ │ │ ├── pouting-face.png │ │ │ ├── rainbow.png │ │ │ ├── rocket.png │ │ │ ├── shamrock.png │ │ │ ├── slightly-smiling-face.png │ │ │ ├── smiling-face-with-heart-eyes.png │ │ │ ├── smiling-face-with-horns.png │ │ │ ├── smiling-face-with-sunglasses.png │ │ │ ├── smiling-face.png │ │ │ ├── sparkles.png │ │ │ ├── star.png │ │ │ ├── thinking-face.png │ │ │ ├── thought-balloon.png │ │ │ ├── thumbs-up-yellow.png │ │ │ ├── tired-face.png │ │ │ ├── two-hearts.png │ │ │ └── victory-hand-yellow.png │ │ ├── fileImg │ │ │ ├── excel.png │ │ │ ├── pdf.png │ │ │ ├── ppt.png │ │ │ ├── txt.png │ │ │ ├── unknowfile.png │ │ │ ├── word.png │ │ │ └── zpi.png │ │ ├── head_portrait.jpg │ │ ├── head_robot.jpg │ │ ├── loginImg │ │ │ ├── weibo.png │ │ │ └── weixin.png │ │ └── xuehua.png │ └── logo.png ├── components │ ├── Emoji.vue │ ├── FileCard.vue │ ├── HeadPortrait.vue │ ├── Header.vue │ ├── Nav.vue │ └── PersonCard.vue ├── main.js ├── mock │ └── index.js ├── router │ └── index.js ├── util │ ├── auth.js │ ├── request.js │ └── util.js └── view │ ├── home.vue │ └── pages │ ├── chatHome │ ├── chatwindow.vue │ └── index.vue │ ├── chatwithfile │ ├── fileChatIndex.vue │ ├── fileChatWindow.vue │ ├── index.vue │ └── pdfWindow.vue │ ├── expertChat │ └── index.vue │ ├── gameChat │ └── index.vue │ ├── homePage │ └── index.vue │ ├── imgGenerate │ └── index.vue │ ├── linguist │ └── index.vue │ ├── prompt │ ├── index.vue │ └── info.vue │ ├── userInfo │ └── userList.vue │ └── userLogin │ ├── Reset.vue │ ├── index.vue │ └── register.vue └── vue.config.js /README.md: -------------------------------------------------------------------------------- 1 | # ChatGPT-Vue-FunAi 2 | > v1.0.0 3 | -------------------------------------------------------------------------------- /funai-front/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /funai-front/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /funai-front/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 chaining 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /funai-front/README.md: -------------------------------------------------------------------------------- 1 | ChatGPT模型是由OpenAI训练的大型语言模型,能够生成类人文本。通过向它提供提示,它可以生成继续对话或扩展给定提示的响应。由于目前ChatGPT并未向我们开放注册,所以想要体验要大费周折。 2 | 3 | 4 | ## 项目启动 5 | `npm install` 6 | 7 | `npm run serve` 8 | 9 | -------------------------------------------------------------------------------- /funai-front/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /funai-front/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 666 6 | 22 | 23 | 24 | 25 |
26 | 666 27 |
28 | 29 | 30 | 31 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /funai-front/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "esnext", 5 | "baseUrl": "./", 6 | "moduleResolution": "node", 7 | "paths": { 8 | "@/*": [ 9 | "src/*" 10 | ] 11 | }, 12 | "lib": [ 13 | "esnext", 14 | "dom", 15 | "dom.iterable", 16 | "scripthost" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /funai-front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chathome", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "@traptitech/markdown-it-katex": "^3.6.0", 11 | "audio-recorder-polyfill": "^0.4.1", 12 | "axios": "^1.3.1", 13 | "blueimp-md5": "^2.19.0", 14 | "clipboard": "^2.0.11", 15 | "core-js": "^3.8.3", 16 | "element-ui": "^2.15.12", 17 | "floating-vue": "^2.0.0-beta.20", 18 | "highlight.js": "^11.7.0", 19 | "jquery": "^3.6.4", 20 | "js-audio-recorder": "^1.0.7", 21 | "js-cookie": "^3.0.1", 22 | "js-file-download": "^0.4.12", 23 | "markdown-it": "^13.0.1", 24 | "mockjs": "^1.1.0", 25 | "sass": "^1.56.2", 26 | "sass-loader": "^13.2.0", 27 | "v-tooltip": "^2.1.3", 28 | "vue": "^2.6.14", 29 | "vue-clipboard2": "^0.3.3", 30 | "vue-markdown": "^2.2.4", 31 | "vue-pdf-embed": "^1.1.6", 32 | "vue-router": "^3.6.5", 33 | "vue-sse": "^2.5.2", 34 | "vue-textarea-autosize": "^1.1.1" 35 | }, 36 | "devDependencies": { 37 | "@vue/cli-plugin-babel": "~5.0.0", 38 | "@vue/cli-service": "~5.0.0", 39 | "babel-plugin-component": "^1.1.1", 40 | "compression-webpack-plugin": "^5.0.1", 41 | "vue-template-compiler": "^2.6.14" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /funai-front/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/public/favicon.ico -------------------------------------------------------------------------------- /funai-front/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/public/favicon.png -------------------------------------------------------------------------------- /funai-front/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <%= htmlWebpackPlugin.options.title %> 11 | 12 | 17 | 18 | 19 | 20 | 24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /funai-front/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | 19 | -------------------------------------------------------------------------------- /funai-front/src/api/getData.js: -------------------------------------------------------------------------------- 1 | import base from './index' 2 | let axios = base.axios 3 | let baseUrl = base.baseUrl 4 | 5 | // 获取聊天列表 6 | export const getSessionList = (user_id, type) => { 7 | return axios({ 8 | method: 'get', 9 | url: `${baseUrl}/chat/getSessionList/${user_id}/${type}`, 10 | }).then(res => res.data) 11 | } 12 | 13 | // 获取聊天信息 14 | export const getChatMsg = params => { 15 | return axios({ 16 | method: 'get', 17 | url: `${baseUrl}/chat/getSessionChatRecord/${params.sessionId}`, 18 | data: params 19 | }).then(res => res.data) 20 | } 21 | 22 | // 单轮聊天 23 | export const oneShotChat = params => { 24 | return axios({ 25 | method: 'post', 26 | url: `${baseUrl}/chat/oneShot`, 27 | data: params, 28 | headers: { 29 | 'Content-Type': 'application/json', 30 | } 31 | }).then(res => res.data) 32 | } 33 | 34 | // 单轮聊天(流式) 35 | export const streamOneShotChat = params => { 36 | return axios({ 37 | method: 'post', 38 | url: `${baseUrl}/chat/streamOneShotChat`, 39 | data: params, 40 | headers: { 41 | 'Content-Type': 'application/json', 42 | } 43 | }).then(res => res.data) 44 | } 45 | 46 | // 多轮聊天 47 | export const sessionChat = params => { 48 | return axios({ 49 | method: 'post', 50 | url: `${baseUrl}/chat/session`, 51 | data: params, 52 | headers: { 53 | 'Content-Type': 'application/json', 54 | } 55 | }).then(res => res.data) 56 | } 57 | 58 | // 多轮聊天(流式) 59 | export const streamSessionChat = params => { 60 | return axios({ 61 | method: 'post', 62 | url: `${baseUrl}/chat/streamSessionChat`, 63 | data: params, 64 | headers: { 65 | 'Content-Type': 'application/json', 66 | } 67 | }).then(res => res.data) 68 | } 69 | 70 | // 发送验证码 71 | export const sendCode = phone => { 72 | return axios({ 73 | method: 'post', 74 | url: `${baseUrl}/user/sendCode`, 75 | data: phone, 76 | headers: { 77 | 'Content-Type': 'application/json', 78 | } 79 | }).then(res => res.data) 80 | } 81 | 82 | // 用户注册 83 | export const register = params => { 84 | return axios({ 85 | method: 'post', 86 | url: `${baseUrl}/user/register`, 87 | data: params, 88 | headers: { 89 | 'Content-Type': 'application/json', 90 | } 91 | }).then(res => res.data) 92 | } 93 | 94 | // 用户登录 95 | export const login = params => { 96 | return axios({ 97 | method: 'post', 98 | url: `${baseUrl}/user/login`, 99 | data: params, 100 | headers: { 101 | 'Content-Type': 'application/json', 102 | } 103 | }).then(res => res.data) 104 | } 105 | 106 | // 重置用户密码 107 | export const reset = params => { 108 | return axios({ 109 | method: 'post', 110 | url: `${baseUrl}/user/resetPwd`, 111 | data: params, 112 | headers: { 113 | 'Content-Type': 'application/json', 114 | } 115 | }).then(res => res.data) 116 | } 117 | 118 | // 新增会话 119 | export const addSession = params => { 120 | return axios({ 121 | method: 'post', 122 | url: `${baseUrl}/chat/addSession`, 123 | data: params, 124 | headers: { 125 | 'Content-Type': 'application/json', 126 | } 127 | }).then(res => res.data) 128 | } 129 | 130 | // 翻译 131 | export const linguistOperate = params => { 132 | return axios({ 133 | method: 'post', 134 | url: `${baseUrl}/linguist/linguistOperate`, 135 | data: params, 136 | headers: { 137 | 'Content-Type': 'application/json', 138 | } 139 | }).then(res => res.data) 140 | } 141 | 142 | // 文件下载 143 | export const downloadSession = params => { 144 | return axios({ 145 | method: 'get', 146 | url: `${baseUrl}/chat/getSessionChatRecordByCsv/${params.sessionId}`, 147 | data: params, 148 | responseType: 'blob' 149 | }).then(res => res.data) 150 | } 151 | 152 | // 清空聊天记录 153 | export const clearSessionRecord = sessionId => { 154 | return axios({ 155 | method: 'put', 156 | url: `${baseUrl}/chat/truncateSessionChatRecord/${sessionId}`, 157 | }).then(res => res.data) 158 | } 159 | 160 | // 删除会话 161 | export const deleteSession = sessionId => { 162 | return axios({ 163 | method: 'delete', 164 | url: `${baseUrl}/chat/deleteSession/${sessionId}`, 165 | }).then(res => res.data) 166 | } 167 | 168 | // 用户退出 169 | export const logout = user_id => { 170 | return axios({ 171 | method: 'get', 172 | url: `${baseUrl}/user/logout/${user_id}`, 173 | }).then(res => res.data) 174 | } 175 | 176 | // 发送语音 177 | export const sendAudio = (cuid,token,params) => { 178 | return axios({ 179 | method: 'post', 180 | url: `${baseUrl}/chat/getTextByAudio?cuid=${cuid}&token=${token}`, 181 | data: params, 182 | headers: { 183 | 'Content-Type': 'audio/wav;rate=16000', 184 | } 185 | }).then(res => res.data) 186 | } 187 | 188 | export const getAudioToken = () => { 189 | return axios({ 190 | method: 'post', 191 | url: `${baseUrl}/chat/getAudioToken` 192 | }).then(res => res.data) 193 | } 194 | 195 | // 开始游戏 196 | export const startGameSession = params => { 197 | return axios({ 198 | method: 'post', 199 | url: `${baseUrl}/chat/game/startGameSession`, 200 | data: params, 201 | headers: { 202 | 'Content-Type': 'application/json', 203 | } 204 | }).then(res => res.data) 205 | } 206 | 207 | 208 | // 上传PDF 209 | export const chatPdfUpload = params => { 210 | return axios({ 211 | method: 'post', 212 | url: `${baseUrl}/file/chatPdfUpload`, 213 | data: params, 214 | }).then(res => res.data) 215 | } 216 | 217 | // 多文件上传 218 | export const muliChatPdfUpload = params => { 219 | return axios({ 220 | method: 'post', 221 | url: `${baseUrl}/file/muliChatPdfUpload`, 222 | data: params, 223 | }).then(res => res.data) 224 | } 225 | 226 | // 与PDF聊天 227 | export const chatWithFile = params => { 228 | return axios({ 229 | method: 'post', 230 | url: `${baseUrl}/file/chatWithFile`, 231 | data: params, 232 | headers: { 233 | 'Content-Type': 'application/json', 234 | } 235 | }).then(res => res.data) 236 | } 237 | 238 | // 删除索引库连接 239 | export const dropCollection = params => { 240 | return axios({ 241 | method: 'delete', 242 | url: `${baseUrl}/file/dropCollection`, 243 | params: params 244 | }).then(res => res.data) 245 | } 246 | 247 | // 文件对话,流式 248 | export const streamChatWithFile = params => { 249 | return axios({ 250 | method: 'post', 251 | url: `${baseUrl}/file/streamChatWithFile`, 252 | data: params, 253 | headers: { 254 | 'Content-Type': 'application/json', 255 | } 256 | }).then(res => res.data) 257 | } 258 | 259 | // 获得专家领域的提示 260 | export const listAllUserPrompt = () => { 261 | return axios({ 262 | method: 'get', 263 | url: `${baseUrl}/prompt/listAllUserPrompt`, 264 | }).then(res => res.data) 265 | } 266 | 267 | // 获取用户的apikey 268 | export const getUserApiKey = params => { 269 | return axios({ 270 | method: 'post', 271 | url: `${baseUrl}/user/apiKey/get`, 272 | data: params, 273 | }).then(res => res.data) 274 | } 275 | 276 | 277 | // 获取用户的apikey 278 | export const insertOrUpdateApiKey = params => { 279 | return axios({ 280 | method: 'post', 281 | url: `${baseUrl}/user/apiKey/insertOrUpdate`, 282 | data: params, 283 | }).then(res => res.data) 284 | } 285 | 286 | // 获取用户列表 287 | export const getUserList = (limit,page,params) => { 288 | return axios({ 289 | method: 'post', 290 | url: `${baseUrl}/user/admin/getUserListByCondition/${limit}/${page}`, 291 | data: params, 292 | }).then(res => res.data) 293 | } 294 | 295 | // 获取用户列表 296 | export const lockUser = params => { 297 | return axios({ 298 | method: 'post', 299 | url: `${baseUrl}/user/admin/lockUser`, 300 | data: params, 301 | }).then(res => res.data) 302 | } 303 | 304 | // 更改用户等级 305 | export const changeLevel = params=> { 306 | return axios({ 307 | method: 'post', 308 | url: `${baseUrl}/user/admin/changeLevel`, 309 | data: params, 310 | }).then(res => res.data) 311 | } 312 | 313 | // 添加意见 314 | export const addAdvice = params=> { 315 | return axios({ 316 | method: 'post', 317 | url: `${baseUrl}/user/advice/addAdvice`, 318 | data: params, 319 | }).then(res => res.data) 320 | } 321 | 322 | export const getWxCode = () => { 323 | return axios({ 324 | method: 'get', 325 | url: `${baseUrl}/user/getWxCode` 326 | }).then(res => res.data) 327 | } 328 | 329 | export const getWbCode = () => { 330 | return axios({ 331 | method: 'get', 332 | url: `${baseUrl}/user/getWbCode` 333 | }).then(res => res.data) 334 | } 335 | 336 | export const getUserLevel = () => { 337 | return axios({ 338 | method: 'get', 339 | url: `${baseUrl}/user/getUserLevel` 340 | }).then(res => res.data) 341 | } 342 | 343 | // 文生图 344 | export const text2Img = params=> { 345 | return axios({ 346 | method: 'post', 347 | url: `${baseUrl}/img/text2Img`, 348 | data: params, 349 | }).then(res => res.data) 350 | } 351 | 352 | // 获取聊天的文件 353 | export const getFileChatBySessionId = sessionId => { 354 | return axios({ 355 | method: 'get', 356 | url: `${baseUrl}/file/getFileChatBySessionId/${sessionId}`, 357 | }).then(res => res.data) 358 | } 359 | -------------------------------------------------------------------------------- /funai-front/src/api/index.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import cookie from 'js-cookie' 3 | import router from '@/router'; // 引入Vue Router 4 | import Vue from 'vue' 5 | //全局参数,自定义参数可在发送请求时设置 6 | axios.defaults.timeout = 300000000 //超时时间ms 7 | axios.defaults.withCredentials = true 8 | // 请求时的拦截 9 | //回调里面不能获取错误信息 10 | axios.interceptors.request.use( 11 | function (config) { 12 | // cookie有token的话就放到header中。 13 | if(cookie.get('token')) { 14 | config.headers['token'] = cookie.get('token') 15 | } 16 | return config; 17 | }, 18 | function (error) { 19 | // 当请求异常时做一些处理 20 | console.log('请求异常:' + JSON.stringify(error)); 21 | return Promise.reject(error); 22 | } 23 | ); 24 | 25 | axios.interceptors.response.use(function (response) { 26 | // Do something with response data 27 | if(response.data.code === 10002) { 28 | //弹出登录输入框 29 | Vue.prototype.$message.error("请登录后使用!") 30 | cookie.remove('token'); 31 | cookie.remove('userId'); 32 | cookie.remove('username'); 33 | router.push({ path: '/UserLogin'}).catch((err) => {}); 34 | return 35 | } else if(response.data.code === 10004) { 36 | Vue.prototype.$message.error(response.data.message) 37 | cookie.remove('token'); 38 | cookie.remove('userId'); 39 | cookie.remove('username'); 40 | router.push({ path: '/UserLogin'}).catch((err) => {}); 41 | return 42 | }else { 43 | return response 44 | } 45 | }, function (error) { 46 | // Do something with response error 47 | console.log('响应出错:' + error+'响应码'+response.data.code) 48 | return Promise.reject(error) 49 | }); 50 | 51 | 52 | const base = { 53 | axios: axios, 54 | baseUrl: 'https://funai.space:8080' 55 | // baseUrl: 'http://localhost:8080' 56 | // baseUrl: 'http://127.0.0.1:8080' 57 | } 58 | 59 | export default base 60 | -------------------------------------------------------------------------------- /funai-front/src/api/prompt.js: -------------------------------------------------------------------------------- 1 | import base from './index' 2 | let axios = base.axios 3 | let baseUrl = base.baseUrl 4 | 5 | 6 | // 查询prompt库 7 | export const getPromptList = (page, limit, searchObj) => { 8 | return axios({ 9 | method: 'get', 10 | url: `${baseUrl}/prompt/admin/list/${page}/${limit}`, 11 | params: searchObj 12 | }).then(res => res.data) 13 | } 14 | 15 | // 新增prompt 16 | export const addPrompt = (info) => { 17 | return axios({ 18 | method: 'post', 19 | url: `${baseUrl}/prompt/admin`, 20 | data: info 21 | }).then(res => res.data) 22 | } 23 | 24 | // 编辑prompt 25 | export const editPrompt = (info) => { 26 | return axios({ 27 | method: 'put', 28 | url: `${baseUrl}/prompt/admin`, 29 | data: info 30 | }).then(res => res.data) 31 | } 32 | 33 | // 删除prompt 34 | export const deletePrompt = (promptId) => { 35 | return axios({ 36 | method: 'delete', 37 | url: `${baseUrl}/prompt/admin/${promptId}`, 38 | }).then(res => res.data) 39 | } -------------------------------------------------------------------------------- /funai-front/src/assets/font/demo.css: -------------------------------------------------------------------------------- 1 | /* Logo 字体 */ 2 | @font-face { 3 | font-family: "iconfont logo"; 4 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); 5 | src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), 6 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), 7 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), 8 | url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); 9 | } 10 | 11 | .logo { 12 | font-family: "iconfont logo"; 13 | font-size: 160px; 14 | font-style: normal; 15 | -webkit-font-smoothing: antialiased; 16 | -moz-osx-font-smoothing: grayscale; 17 | } 18 | 19 | /* tabs */ 20 | .nav-tabs { 21 | position: relative; 22 | } 23 | 24 | .nav-tabs .nav-more { 25 | position: absolute; 26 | right: 0; 27 | bottom: 0; 28 | height: 42px; 29 | line-height: 42px; 30 | color: #666; 31 | } 32 | 33 | #tabs { 34 | border-bottom: 1px solid #eee; 35 | } 36 | 37 | #tabs li { 38 | cursor: pointer; 39 | width: 100px; 40 | height: 40px; 41 | line-height: 40px; 42 | text-align: center; 43 | font-size: 16px; 44 | border-bottom: 2px solid transparent; 45 | position: relative; 46 | z-index: 1; 47 | margin-bottom: -1px; 48 | color: #666; 49 | } 50 | 51 | 52 | #tabs .active { 53 | border-bottom-color: #f00; 54 | color: #222; 55 | } 56 | 57 | .tab-container .content { 58 | display: none; 59 | } 60 | 61 | /* 页面布局 */ 62 | .main { 63 | padding: 30px 100px; 64 | width: 960px; 65 | margin: 0 auto; 66 | } 67 | 68 | .main .logo { 69 | color: #333; 70 | text-align: left; 71 | margin-bottom: 30px; 72 | line-height: 1; 73 | height: 110px; 74 | margin-top: -50px; 75 | overflow: hidden; 76 | *zoom: 1; 77 | } 78 | 79 | .main .logo a { 80 | font-size: 160px; 81 | color: #333; 82 | } 83 | 84 | .helps { 85 | margin-top: 40px; 86 | } 87 | 88 | .helps pre { 89 | padding: 20px; 90 | margin: 10px 0; 91 | border: solid 1px #e7e1cd; 92 | background-color: #fffdef; 93 | overflow: auto; 94 | } 95 | 96 | .icon_lists { 97 | width: 100% !important; 98 | overflow: hidden; 99 | *zoom: 1; 100 | } 101 | 102 | .icon_lists li { 103 | width: 100px; 104 | margin-bottom: 10px; 105 | margin-right: 20px; 106 | text-align: center; 107 | list-style: none !important; 108 | cursor: default; 109 | } 110 | 111 | .icon_lists li .code-name { 112 | line-height: 1.2; 113 | } 114 | 115 | .icon_lists .icon { 116 | display: block; 117 | height: 100px; 118 | line-height: 100px; 119 | font-size: 42px; 120 | margin: 10px auto; 121 | color: #333; 122 | -webkit-transition: font-size 0.25s linear, width 0.25s linear; 123 | -moz-transition: font-size 0.25s linear, width 0.25s linear; 124 | transition: font-size 0.25s linear, width 0.25s linear; 125 | } 126 | 127 | .icon_lists .icon:hover { 128 | font-size: 100px; 129 | } 130 | 131 | .icon_lists .svg-icon { 132 | /* 通过设置 font-size 来改变图标大小 */ 133 | width: 1em; 134 | /* 图标和文字相邻时,垂直对齐 */ 135 | vertical-align: -0.15em; 136 | /* 通过设置 color 来改变 SVG 的颜色/fill */ 137 | fill: currentColor; 138 | /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 139 | normalize.css 中也包含这行 */ 140 | overflow: hidden; 141 | } 142 | 143 | .icon_lists li .name, 144 | .icon_lists li .code-name { 145 | color: #666; 146 | } 147 | 148 | /* markdown 样式 */ 149 | .markdown { 150 | color: #666; 151 | font-size: 14px; 152 | line-height: 1.8; 153 | } 154 | 155 | .highlight { 156 | line-height: 1.5; 157 | } 158 | 159 | .markdown img { 160 | vertical-align: middle; 161 | max-width: 100%; 162 | } 163 | 164 | .markdown h1 { 165 | color: #404040; 166 | font-weight: 500; 167 | line-height: 40px; 168 | margin-bottom: 24px; 169 | } 170 | 171 | .markdown h2, 172 | .markdown h3, 173 | .markdown h4, 174 | .markdown h5, 175 | .markdown h6 { 176 | color: #404040; 177 | margin: 1.6em 0 0.6em 0; 178 | font-weight: 500; 179 | clear: both; 180 | } 181 | 182 | .markdown h1 { 183 | font-size: 28px; 184 | } 185 | 186 | .markdown h2 { 187 | font-size: 22px; 188 | } 189 | 190 | .markdown h3 { 191 | font-size: 16px; 192 | } 193 | 194 | .markdown h4 { 195 | font-size: 14px; 196 | } 197 | 198 | .markdown h5 { 199 | font-size: 12px; 200 | } 201 | 202 | .markdown h6 { 203 | font-size: 12px; 204 | } 205 | 206 | .markdown hr { 207 | height: 1px; 208 | border: 0; 209 | background: #e9e9e9; 210 | margin: 16px 0; 211 | clear: both; 212 | } 213 | 214 | .markdown p { 215 | margin: 1em 0; 216 | } 217 | 218 | .markdown>p, 219 | .markdown>blockquote, 220 | .markdown>.highlight, 221 | .markdown>ol, 222 | .markdown>ul { 223 | width: 80%; 224 | } 225 | 226 | .markdown ul>li { 227 | list-style: circle; 228 | } 229 | 230 | .markdown>ul li, 231 | .markdown blockquote ul>li { 232 | margin-left: 20px; 233 | padding-left: 4px; 234 | } 235 | 236 | .markdown>ul li p, 237 | .markdown>ol li p { 238 | margin: 0.6em 0; 239 | } 240 | 241 | .markdown ol>li { 242 | list-style: decimal; 243 | } 244 | 245 | .markdown>ol li, 246 | .markdown blockquote ol>li { 247 | margin-left: 20px; 248 | padding-left: 4px; 249 | } 250 | 251 | .markdown code { 252 | margin: 0 3px; 253 | padding: 0 5px; 254 | background: #eee; 255 | border-radius: 3px; 256 | } 257 | 258 | .markdown strong, 259 | .markdown b { 260 | font-weight: 600; 261 | } 262 | 263 | .markdown>table { 264 | border-collapse: collapse; 265 | border-spacing: 0px; 266 | empty-cells: show; 267 | border: 1px solid #e9e9e9; 268 | width: 95%; 269 | margin-bottom: 24px; 270 | } 271 | 272 | .markdown>table th { 273 | white-space: nowrap; 274 | color: #333; 275 | font-weight: 600; 276 | } 277 | 278 | .markdown>table th, 279 | .markdown>table td { 280 | border: 1px solid #e9e9e9; 281 | padding: 8px 16px; 282 | text-align: left; 283 | } 284 | 285 | .markdown>table th { 286 | background: #F7F7F7; 287 | } 288 | 289 | .markdown blockquote { 290 | font-size: 90%; 291 | color: #999; 292 | border-left: 4px solid #e9e9e9; 293 | padding-left: 0.8em; 294 | margin: 1em 0; 295 | } 296 | 297 | .markdown blockquote p { 298 | margin: 0; 299 | } 300 | 301 | .markdown .anchor { 302 | opacity: 0; 303 | transition: opacity 0.3s ease; 304 | margin-left: 8px; 305 | } 306 | 307 | .markdown .waiting { 308 | color: #ccc; 309 | } 310 | 311 | .markdown h1:hover .anchor, 312 | .markdown h2:hover .anchor, 313 | .markdown h3:hover .anchor, 314 | .markdown h4:hover .anchor, 315 | .markdown h5:hover .anchor, 316 | .markdown h6:hover .anchor { 317 | opacity: 1; 318 | display: inline-block; 319 | } 320 | 321 | .markdown>br, 322 | .markdown>p>br { 323 | clear: both; 324 | } 325 | 326 | 327 | .hljs { 328 | display: block; 329 | background: white; 330 | padding: 0.5em; 331 | color: #333333; 332 | overflow-x: auto; 333 | } 334 | 335 | .hljs-comment, 336 | .hljs-meta { 337 | color: #969896; 338 | } 339 | 340 | .hljs-string, 341 | .hljs-variable, 342 | .hljs-template-variable, 343 | .hljs-strong, 344 | .hljs-emphasis, 345 | .hljs-quote { 346 | color: #df5000; 347 | } 348 | 349 | .hljs-keyword, 350 | .hljs-selector-tag, 351 | .hljs-type { 352 | color: #a71d5d; 353 | } 354 | 355 | .hljs-literal, 356 | .hljs-symbol, 357 | .hljs-bullet, 358 | .hljs-attribute { 359 | color: #0086b3; 360 | } 361 | 362 | .hljs-section, 363 | .hljs-name { 364 | color: #63a35c; 365 | } 366 | 367 | .hljs-tag { 368 | color: #333333; 369 | } 370 | 371 | .hljs-title, 372 | .hljs-attr, 373 | .hljs-selector-id, 374 | .hljs-selector-class, 375 | .hljs-selector-attr, 376 | .hljs-selector-pseudo { 377 | color: #795da3; 378 | } 379 | 380 | .hljs-addition { 381 | color: #55a532; 382 | background-color: #eaffea; 383 | } 384 | 385 | .hljs-deletion { 386 | color: #bd2c00; 387 | background-color: #ffecec; 388 | } 389 | 390 | .hljs-link { 391 | text-decoration: underline; 392 | } 393 | 394 | /* 代码高亮 */ 395 | /* PrismJS 1.15.0 396 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ 397 | /** 398 | * prism.js default theme for JavaScript, CSS and HTML 399 | * Based on dabblet (http://dabblet.com) 400 | * @author Lea Verou 401 | */ 402 | code[class*="language-"], 403 | pre[class*="language-"] { 404 | color: black; 405 | background: none; 406 | text-shadow: 0 1px white; 407 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 408 | text-align: left; 409 | white-space: pre; 410 | word-spacing: normal; 411 | word-break: normal; 412 | word-wrap: normal; 413 | line-height: 1.5; 414 | 415 | -moz-tab-size: 4; 416 | -o-tab-size: 4; 417 | tab-size: 4; 418 | 419 | -webkit-hyphens: none; 420 | -moz-hyphens: none; 421 | -ms-hyphens: none; 422 | hyphens: none; 423 | } 424 | 425 | pre[class*="language-"]::-moz-selection, 426 | pre[class*="language-"] ::-moz-selection, 427 | code[class*="language-"]::-moz-selection, 428 | code[class*="language-"] ::-moz-selection { 429 | text-shadow: none; 430 | background: #b3d4fc; 431 | } 432 | 433 | pre[class*="language-"]::selection, 434 | pre[class*="language-"] ::selection, 435 | code[class*="language-"]::selection, 436 | code[class*="language-"] ::selection { 437 | text-shadow: none; 438 | background: #b3d4fc; 439 | } 440 | 441 | @media print { 442 | 443 | code[class*="language-"], 444 | pre[class*="language-"] { 445 | text-shadow: none; 446 | } 447 | } 448 | 449 | /* Code blocks */ 450 | pre[class*="language-"] { 451 | padding: 1em; 452 | margin: .5em 0; 453 | overflow: auto; 454 | } 455 | 456 | :not(pre)>code[class*="language-"], 457 | pre[class*="language-"] { 458 | background: #f5f2f0; 459 | } 460 | 461 | /* Inline code */ 462 | :not(pre)>code[class*="language-"] { 463 | padding: .1em; 464 | border-radius: .3em; 465 | white-space: normal; 466 | } 467 | 468 | .token.comment, 469 | .token.prolog, 470 | .token.doctype, 471 | .token.cdata { 472 | color: slategray; 473 | } 474 | 475 | .token.punctuation { 476 | color: #999; 477 | } 478 | 479 | .namespace { 480 | opacity: .7; 481 | } 482 | 483 | .token.property, 484 | .token.tag, 485 | .token.boolean, 486 | .token.number, 487 | .token.constant, 488 | .token.symbol, 489 | .token.deleted { 490 | color: #905; 491 | } 492 | 493 | .token.selector, 494 | .token.attr-name, 495 | .token.string, 496 | .token.char, 497 | .token.builtin, 498 | .token.inserted { 499 | color: #690; 500 | } 501 | 502 | .token.operator, 503 | .token.entity, 504 | .token.url, 505 | .language-css .token.string, 506 | .style .token.string { 507 | color: #9a6e3a; 508 | background: hsla(0, 0%, 100%, .5); 509 | } 510 | 511 | .token.atrule, 512 | .token.attr-value, 513 | .token.keyword { 514 | color: #07a; 515 | } 516 | 517 | .token.function, 518 | .token.class-name { 519 | color: #DD4A68; 520 | } 521 | 522 | .token.regex, 523 | .token.important, 524 | .token.variable { 525 | color: #e90; 526 | } 527 | 528 | .token.important, 529 | .token.bold { 530 | font-weight: bold; 531 | } 532 | 533 | .token.italic { 534 | font-style: italic; 535 | } 536 | 537 | .token.entity { 538 | cursor: help; 539 | } 540 | -------------------------------------------------------------------------------- /funai-front/src/assets/font/demo_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | iconfont Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 36 | 37 | 38 |
39 |

40 | 41 | 42 |

43 | 53 |
54 |
55 |
    56 | 57 |
  • 58 | 59 |
    会话
    60 |
    &#xe614;
    61 |
  • 62 | 63 |
  • 64 | 65 |
    下载
    66 |
    &#xe60e;
    67 |
  • 68 | 69 |
  • 70 | 71 |
    图片
    72 |
    &#xe8ba;
    73 |
  • 74 | 75 |
  • 76 | 77 |
    清空
    78 |
    &#xe946;
    79 |
  • 80 | 81 |
  • 82 | 83 |
    游戏,游戏机
    84 |
    &#xe61e;
    85 |
  • 86 | 87 |
  • 88 | 89 |
    预览简历
    90 |
    &#xe613;
    91 |
  • 92 | 93 |
  • 94 | 95 |
    翻译
    96 |
    &#xe60d;
    97 |
  • 98 | 99 |
  • 100 | 101 |
    pdf
    102 |
    &#xe619;
    103 |
  • 104 | 105 |
  • 106 | 107 |
    发送
    108 |
    &#xe652;
    109 |
  • 110 | 111 |
  • 112 | 113 |
    登录
    114 |
    &#xe612;
    115 |
  • 116 | 117 |
118 |
119 |

Unicode 引用

120 |
121 | 122 |

Unicode 是字体在网页端最原始的应用方式,特点是:

123 |
    124 |
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • 125 |
  • 默认情况下不支持多色,直接添加多色图标会自动去色。
  • 126 |
127 |
128 |

注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)

129 |
130 |

Unicode 使用步骤如下:

131 |

第一步:拷贝项目下面生成的 @font-face

132 |
@font-face {
134 |   font-family: 'iconfont';
135 |   src: url('iconfont.woff2?t=1680858973117') format('woff2'),
136 |        url('iconfont.woff?t=1680858973117') format('woff'),
137 |        url('iconfont.ttf?t=1680858973117') format('truetype');
138 | }
139 | 
140 |

第二步:定义使用 iconfont 的样式

141 |
.iconfont {
143 |   font-family: "iconfont" !important;
144 |   font-size: 16px;
145 |   font-style: normal;
146 |   -webkit-font-smoothing: antialiased;
147 |   -moz-osx-font-smoothing: grayscale;
148 | }
149 | 
150 |

第三步:挑选相应图标并获取字体编码,应用于页面

151 |
152 | <span class="iconfont">&#x33;</span>
154 | 
155 |
156 |

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

157 |
158 |
159 |
160 |
161 |
    162 | 163 |
  • 164 | 165 |
    166 | 会话 167 |
    168 |
    .icon-huihua 169 |
    170 |
  • 171 | 172 |
  • 173 | 174 |
    175 | 下载 176 |
    177 |
    .icon-xiazai 178 |
    179 |
  • 180 | 181 |
  • 182 | 183 |
    184 | 图片 185 |
    186 |
    .icon-tupian 187 |
    188 |
  • 189 | 190 |
  • 191 | 192 |
    193 | 清空 194 |
    195 |
    .icon-qingkong 196 |
    197 |
  • 198 | 199 |
  • 200 | 201 |
    202 | 游戏,游戏机 203 |
    204 |
    .icon-youxiyouxiji 205 |
    206 |
  • 207 | 208 |
  • 209 | 210 |
    211 | 预览简历 212 |
    213 |
    .icon-yulanjianli 214 |
    215 |
  • 216 | 217 |
  • 218 | 219 |
    220 | 翻译 221 |
    222 |
    .icon-fanyi 223 |
    224 |
  • 225 | 226 |
  • 227 | 228 |
    229 | pdf 230 |
    231 |
    .icon-pdf 232 |
    233 |
  • 234 | 235 |
  • 236 | 237 |
    238 | 发送 239 |
    240 |
    .icon-fasong 241 |
    242 |
  • 243 | 244 |
  • 245 | 246 |
    247 | 登录 248 |
    249 |
    .icon-denglu 250 |
    251 |
  • 252 | 253 |
254 |
255 |

font-class 引用

256 |
257 | 258 |

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

259 |

与 Unicode 使用方式相比,具有如下特点:

260 |
    261 |
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • 262 |
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • 263 |
264 |

使用步骤如下:

265 |

第一步:引入项目下面生成的 fontclass 代码:

266 |
<link rel="stylesheet" href="./iconfont.css">
267 | 
268 |

第二步:挑选相应图标并获取类名,应用于页面:

269 |
<span class="iconfont icon-xxx"></span>
270 | 
271 |
272 |

" 273 | iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

274 |
275 |
276 |
277 |
278 |
    279 | 280 |
  • 281 | 284 |
    会话
    285 |
    #icon-huihua
    286 |
  • 287 | 288 |
  • 289 | 292 |
    下载
    293 |
    #icon-xiazai
    294 |
  • 295 | 296 |
  • 297 | 300 |
    图片
    301 |
    #icon-tupian
    302 |
  • 303 | 304 |
  • 305 | 308 |
    清空
    309 |
    #icon-qingkong
    310 |
  • 311 | 312 |
  • 313 | 316 |
    游戏,游戏机
    317 |
    #icon-youxiyouxiji
    318 |
  • 319 | 320 |
  • 321 | 324 |
    预览简历
    325 |
    #icon-yulanjianli
    326 |
  • 327 | 328 |
  • 329 | 332 |
    翻译
    333 |
    #icon-fanyi
    334 |
  • 335 | 336 |
  • 337 | 340 |
    pdf
    341 |
    #icon-pdf
    342 |
  • 343 | 344 |
  • 345 | 348 |
    发送
    349 |
    #icon-fasong
    350 |
  • 351 | 352 |
  • 353 | 356 |
    登录
    357 |
    #icon-denglu
    358 |
  • 359 | 360 |
361 |
362 |

Symbol 引用

363 |
364 | 365 |

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 366 | 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

367 |
    368 |
  • 支持多色图标了,不再受单色限制。
  • 369 |
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • 370 |
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • 371 |
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • 372 |
373 |

使用步骤如下:

374 |

第一步:引入项目下面生成的 symbol 代码:

375 |
<script src="./iconfont.js"></script>
376 | 
377 |

第二步:加入通用 CSS 代码(引入一次就行):

378 |
<style>
379 | .icon {
380 |   width: 1em;
381 |   height: 1em;
382 |   vertical-align: -0.15em;
383 |   fill: currentColor;
384 |   overflow: hidden;
385 | }
386 | </style>
387 | 
388 |

第三步:挑选相应图标并获取类名,应用于页面:

389 |
<svg class="icon" aria-hidden="true">
390 |   <use xlink:href="#icon-xxx"></use>
391 | </svg>
392 | 
393 |
394 |
395 | 396 |
397 |
398 | 417 | 418 | 419 | -------------------------------------------------------------------------------- /funai-front/src/assets/font/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 3946981 */ 3 | src: url('//at.alicdn.com/t/c/font_3946981_0oip03au5jwd.woff2?t=1683538105969') format('woff2'), 4 | url('//at.alicdn.com/t/c/font_3946981_0oip03au5jwd.woff?t=1683538105969') format('woff'), 5 | url('//at.alicdn.com/t/c/font_3946981_0oip03au5jwd.ttf?t=1683538105969') format('truetype'); 6 | } 7 | 8 | .iconfont { 9 | font-family: "iconfont" !important; 10 | font-size: 16px; 11 | font-style: normal; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | .icon-jiantou_xiangyou:before { 17 | content: "\eb08"; 18 | } 19 | 20 | .icon-jiantou_xiangzuo:before { 21 | content: "\eb09"; 22 | } 23 | 24 | .icon-double-arrows:before { 25 | content: "\e636"; 26 | } 27 | 28 | .icon-shuangxiangshujuhuchuan_transfer-data:before { 29 | content: "\e61b"; 30 | } 31 | 32 | .icon-ai-img:before { 33 | content: "\e615"; 34 | } 35 | 36 | .icon-jiqiren:before { 37 | content: "\e642"; 38 | } 39 | 40 | .icon-fuzhi:before { 41 | content: "\e605"; 42 | } 43 | 44 | .icon-jiqiren1:before { 45 | content: "\e6c0"; 46 | } 47 | 48 | .icon-qingchu:before { 49 | content: "\e747"; 50 | } 51 | 52 | .icon-jieshu:before { 53 | content: "\e624"; 54 | } 55 | 56 | .icon-yonghu:before { 57 | content: "\e604"; 58 | } 59 | 60 | .icon-gongneng:before { 61 | content: "\e84a"; 62 | } 63 | 64 | .icon-guanyuwomen:before { 65 | content: "\e628"; 66 | } 67 | 68 | .icon-guanyuwo:before { 69 | content: "\e603"; 70 | } 71 | 72 | .icon-zhankaishousuo:before { 73 | content: "\e648"; 74 | } 75 | 76 | .icon-zhuanjia:before { 77 | content: "\e607"; 78 | } 79 | 80 | .icon-31shengbo:before { 81 | content: "\e602"; 82 | } 83 | 84 | .icon-yuyin:before { 85 | content: "\e6e1"; 86 | } 87 | 88 | .icon-ziliaoku:before { 89 | content: "\e601"; 90 | } 91 | 92 | .icon-kouyuzhuanxiangke:before { 93 | content: "\e606"; 94 | } 95 | 96 | .icon-youxi:before { 97 | content: "\e620"; 98 | } 99 | 100 | .icon-kaishi1:before { 101 | content: "\e622"; 102 | } 103 | 104 | .icon-shanchu:before { 105 | content: "\e600"; 106 | } 107 | 108 | .icon-huihua:before { 109 | content: "\e614"; 110 | } 111 | 112 | .icon-xiazai:before { 113 | content: "\e60e"; 114 | } 115 | 116 | .icon-tupian:before { 117 | content: "\e8ba"; 118 | } 119 | 120 | .icon-qingkong:before { 121 | content: "\e946"; 122 | } 123 | 124 | .icon-youxiyouxiji:before { 125 | content: "\e61e"; 126 | } 127 | 128 | .icon-yulanjianli:before { 129 | content: "\e613"; 130 | } 131 | 132 | .icon-fanyi:before { 133 | content: "\e60d"; 134 | } 135 | 136 | .icon-pdf:before { 137 | content: "\e619"; 138 | } 139 | 140 | .icon-fasong:before { 141 | content: "\e652"; 142 | } 143 | 144 | .icon-denglu:before { 145 | content: "\e612"; 146 | } 147 | -------------------------------------------------------------------------------- /funai-front/src/assets/font/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3946981", 3 | "name": "ChatGPT-Web", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "13160269", 10 | "name": "会话", 11 | "font_class": "huihua", 12 | "unicode": "e614", 13 | "unicode_decimal": 58900 14 | }, 15 | { 16 | "icon_id": "9923737", 17 | "name": "下载", 18 | "font_class": "xiazai", 19 | "unicode": "e60e", 20 | "unicode_decimal": 58894 21 | }, 22 | { 23 | "icon_id": "11372711", 24 | "name": "图片", 25 | "font_class": "tupian", 26 | "unicode": "e8ba", 27 | "unicode_decimal": 59578 28 | }, 29 | { 30 | "icon_id": "6219264", 31 | "name": "清空", 32 | "font_class": "qingkong", 33 | "unicode": "e946", 34 | "unicode_decimal": 59718 35 | }, 36 | { 37 | "icon_id": "397919", 38 | "name": "游戏,游戏机", 39 | "font_class": "youxiyouxiji", 40 | "unicode": "e61e", 41 | "unicode_decimal": 58910 42 | }, 43 | { 44 | "icon_id": "1836665", 45 | "name": "预览简历", 46 | "font_class": "yulanjianli", 47 | "unicode": "e613", 48 | "unicode_decimal": 58899 49 | }, 50 | { 51 | "icon_id": "10108966", 52 | "name": "翻译", 53 | "font_class": "fanyi", 54 | "unicode": "e60d", 55 | "unicode_decimal": 58893 56 | }, 57 | { 58 | "icon_id": "19035886", 59 | "name": "pdf", 60 | "font_class": "pdf", 61 | "unicode": "e619", 62 | "unicode_decimal": 58905 63 | }, 64 | { 65 | "icon_id": "2085033", 66 | "name": "发送", 67 | "font_class": "fasong", 68 | "unicode": "e652", 69 | "unicode_decimal": 58962 70 | }, 71 | { 72 | "icon_id": "1312041", 73 | "name": "登录", 74 | "font_class": "denglu", 75 | "unicode": "e612", 76 | "unicode_decimal": 58898 77 | } 78 | ] 79 | } 80 | -------------------------------------------------------------------------------- /funai-front/src/assets/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/font/iconfont.ttf -------------------------------------------------------------------------------- /funai-front/src/assets/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/font/iconfont.woff -------------------------------------------------------------------------------- /funai-front/src/assets/font/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/font/iconfont.woff2 -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/clown-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/clown-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/face-screaming-in-fear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/face-screaming-in-fear.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/face-vomiting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/face-vomiting.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/face-with-tongue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/face-with-tongue.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/face-without-mouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/face-without-mouth.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/ghost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/ghost.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/hibiscus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/hibiscus.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/jack-o-lantern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/jack-o-lantern.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/lips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/lips.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/loudly-crying-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/loudly-crying-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/money-bag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/money-bag.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/money-mouth-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/money-mouth-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/new-moon-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/new-moon-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/ok-hand-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/ok-hand-yellow.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/pile-of-poo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/pile-of-poo.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/pouting-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/pouting-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/rainbow.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/rocket.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/shamrock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/shamrock.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/slightly-smiling-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/slightly-smiling-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/smiling-face-with-heart-eyes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/smiling-face-with-heart-eyes.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/smiling-face-with-horns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/smiling-face-with-horns.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/smiling-face-with-sunglasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/smiling-face-with-sunglasses.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/smiling-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/smiling-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/sparkles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/sparkles.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/star.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/thinking-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/thinking-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/thought-balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/thought-balloon.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/thumbs-up-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/thumbs-up-yellow.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/tired-face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/tired-face.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/two-hearts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/two-hearts.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/emoji/victory-hand-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/emoji/victory-hand-yellow.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/excel.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/pdf.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/ppt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/ppt.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/txt.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/unknowfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/unknowfile.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/word.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/fileImg/zpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/fileImg/zpi.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/head_portrait.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/head_portrait.jpg -------------------------------------------------------------------------------- /funai-front/src/assets/img/head_robot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/head_robot.jpg -------------------------------------------------------------------------------- /funai-front/src/assets/img/loginImg/weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/loginImg/weibo.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/loginImg/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/loginImg/weixin.png -------------------------------------------------------------------------------- /funai-front/src/assets/img/xuehua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/img/xuehua.png -------------------------------------------------------------------------------- /funai-front/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangPengL/ChatGPT-Vue-FunAi/ceabc2f7a76fed38d016a106a7398e7562508e11/funai-front/src/assets/logo.png -------------------------------------------------------------------------------- /funai-front/src/components/Emoji.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 66 | 67 | -------------------------------------------------------------------------------- /funai-front/src/components/FileCard.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 39 | 40 | -------------------------------------------------------------------------------- /funai-front/src/components/HeadPortrait.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /funai-front/src/components/Header.vue: -------------------------------------------------------------------------------- 1 | 75 | 76 | 201 | 202 | -------------------------------------------------------------------------------- /funai-front/src/components/Nav.vue: -------------------------------------------------------------------------------- 1 | 71 | 72 | 242 | 243 | -------------------------------------------------------------------------------- /funai-front/src/components/PersonCard.vue: -------------------------------------------------------------------------------- 1 | 14 | 88 | 89 | -------------------------------------------------------------------------------- /funai-front/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import ElementUI from 'element-ui'; 4 | import VueRouter from 'vue-router' 5 | import 'element-ui/lib/theme-chalk/index.css'; 6 | import router from './router/index' 7 | import "./mock/index.js" 8 | import VueTextareaAutosize from "vue-textarea-autosize"; 9 | Vue.use(VueTextareaAutosize); 10 | 11 | Vue.use(VueRouter) 12 | Vue.config.productionTip = false 13 | Vue.use(ElementUI); 14 | 15 | import VueSSE from 'vue-sse'; 16 | import { Message } from 'element-ui'; 17 | 18 | // using defaults 19 | Vue.use(VueSSE); 20 | Vue.prototype.$message = Message; 21 | 22 | export const EventBus = new Vue() 23 | 24 | new Vue({ 25 | router, 26 | render: h => h(App), 27 | }).$mount('#app') 28 | 29 | 30 | router.beforeEach((to,form,next) => { 31 | window.document.title = to.meta.title == undefined ? 'FunAi':to.meta.title 32 | next() 33 | }) -------------------------------------------------------------------------------- /funai-front/src/mock/index.js: -------------------------------------------------------------------------------- 1 | const Mock = require("mockjs"); 2 | 3 | Mock.mock(/friend\/friendList/, 'post', () => { //三个参数。第一个:路径,第二个:请求方式post/get,第三个:回调,返回值 4 | return friendList 5 | }) 6 | 7 | Mock.mock(/friend\/chatMsg/, 'post', (config) => { //三个参数。第一个:路径,第二个:请求方式post/get,第三个:回调,返回值 8 | let params = JSON.parse(config.body) 9 | if (params.sessionId == "1") 10 | return chatMsg1002 11 | if (params.sessionId == "2") 12 | return chatMsg1003 13 | if (params.sessionId == "3") 14 | return chatMsg1004 15 | }) 16 | 17 | 18 | let friendList = Mock.mock( 19 | [ 20 | { 21 | img: "", 22 | name: "ChatGPT", 23 | detail: "Welcome Chat", 24 | lastMsg: "to do", 25 | id: "1002", 26 | headImg: require("@/assets/img/head_robot.jpg"), 27 | 28 | }, 29 | { 30 | img: "", 31 | name: "ChatGPT", 32 | detail: "session 2", 33 | lastMsg: "to do", 34 | id: "1003", 35 | headImg: require("@/assets/img/head_robot.jpg"), 36 | 37 | }, 38 | // { 39 | // img: "", 40 | // name: "小毛", 41 | // detail: "我是小毛", 42 | // lastMsg: "dada dw ertgthy j uy", 43 | // id: "1003", 44 | // headImg: require("@/assets/img/head_portrait2.jpg"), 45 | 46 | // }, 47 | // { 48 | // img: "", 49 | // name: "小王", 50 | // detail: "我是小王", 51 | // lastMsg: "大萨达萨达所大大萨达", 52 | // id: "1004", 53 | // headImg: require("@/assets/img/head_portrait3.jpg"), 54 | 55 | // }, 56 | ] 57 | ) 58 | 59 | let chatMsg1002 = Mock.mock( 60 | [ 61 | // { 62 | // headImg: require("@/assets/img/head_portrait.jpg"), 63 | // name: "大毛是小白", 64 | // time: "09:12 AM", 65 | // msg: " 在吗?", 66 | // chatType: 0, //信息类型,0文字,1图片 67 | // uid: "1001", //uid 68 | // }, 69 | 70 | { 71 | headImg: require("@/assets/img/head_robot.jpg"), 72 | name: "ChatGPT", 73 | time: new Date().toLocaleTimeString(), 74 | msg: " ChatGPT为您服务~", 75 | chatType: 0, //信息类型,0文字,1图片 76 | uid: "1002", //uid 77 | } 78 | // { 79 | // headImg: require("@/assets/img/head_portrait.jpg"), 80 | // name: "大毛是小白", 81 | // time: "09:12 AM", 82 | // msg: require("@/assets/img/emoji/slightly-smiling-face.png"), 83 | // chatType: 1, //信息类型,0文字,1图片 84 | // extend: { 85 | // imgType: 1, //(1表情,2本地图片) 86 | // }, 87 | // uid: "1001", 88 | // }, 89 | ] 90 | ) 91 | let chatMsg1003 = Mock.mock( 92 | [ 93 | { 94 | 95 | }, 96 | { 97 | headImg: require("@/assets/img/head_portrait.jpg"), 98 | name: "大毛是小白", 99 | time: "09:12 AM", 100 | msg: "在干嘛呢", 101 | chatType: 0, //信息类型,0文字,1图片 102 | uid: "1001", //uid 103 | }, 104 | { 105 | headImg: require("@/assets/img/head_portrait.jpg"), 106 | name: "大毛是小白", 107 | time: "09:12 AM", 108 | msg: require("@/assets/img/emoji/slightly-smiling-face.png"), 109 | chatType: 1, //信息类型,0文字,1图片 110 | extend: { 111 | imgType: 1, //(1表情,2本地图片) 112 | }, 113 | uid: "1001", 114 | }, 115 | 116 | { 117 | headImg: require("@/assets/img/head_portrait.jpg"), 118 | name: "大毛是小白", 119 | time: "09:12 AM", 120 | msg: "吃的什么饭", 121 | chatType: 0, //信息类型,0文字,1图片, 2文件 122 | uid: "1001", 123 | }, 124 | 125 | { 126 | headImg: require("@/assets/img/head_portrait.jpg"), 127 | name: "大毛是小白", 128 | time: "09:12 AM", 129 | msg: "加蛋了吗?", 130 | chatType: 0, //信息类型,0文字,1图片, 2文件 131 | uid: "1001", 132 | }, 133 | 134 | ] 135 | ) 136 | let chatMsg1004 = Mock.mock( 137 | [ 138 | { 139 | headImg: require("@/assets/img/head_portrait.jpg"), 140 | name: "大毛是小白", 141 | time: "09:12 AM", 142 | msg: " sadasdawdas sadsad sad sad as despite ofhaving so much to do", 143 | chatType: 0, //信息类型,0文字,1图片 144 | uid: "1001", //uid 145 | }, 146 | { 147 | headImg: require("@/assets/img/head_portrait.jpg"), 148 | name: "大毛是小白", 149 | time: "09:12 AM", 150 | msg: require("@/assets/img/emoji/slightly-smiling-face.png"), 151 | chatType: 1, //信息类型,0文字,1图片 152 | extend: { 153 | imgType: 1, //(1表情,2本地图片) 154 | }, 155 | uid: "1001", 156 | }, 157 | 158 | { 159 | headImg: require("@/assets/img/head_portrait.jpg"), 160 | name: "大毛是小白", 161 | time: "09:12 AM", 162 | msg: "111212", 163 | chatType: 0, //信息类型,0文字,1图片, 2文件 164 | uid: "1001", 165 | }, 166 | 167 | ] 168 | ) -------------------------------------------------------------------------------- /funai-front/src/router/index.js: -------------------------------------------------------------------------------- 1 | import VueRouter from 'vue-router' 2 | 3 | const ChatHome = () => import('@/view/pages/chatHome/index.vue'); 4 | const LoginPage = () => import('@/view/pages/userLogin/index.vue'); 5 | const RegisterPage = () => import('@/view/pages/userLogin/register.vue'); 6 | const Translation = () => import('@/view/pages/linguist/index.vue'); 7 | const ResetPage = () => import('@/view/pages/userLogin/Reset.vue'); 8 | const ChatWithFile = () => import('@/view/pages/chatwithfile/index.vue'); 9 | const Prompt = () => import('@/view/pages/prompt/index.vue'); 10 | const PromptInfoOp = () => import('@/view/pages/prompt/info.vue'); 11 | const ExpertChat = () => import('@/view/pages/expertChat/index.vue'); 12 | const GameChat = () => import('@/view/pages/gameChat/index.vue'); 13 | const HomePage = () => import('@/view/pages/homePage/index.vue'); 14 | const UserList = () => import('@/view/pages/userInfo/userList.vue'); 15 | const ImgGenerate = () => import('@/view/pages/imgGenerate/index.vue'); 16 | const FileChatIndex = () => import('@/view/pages/chatwithfile/fileChatIndex.vue') 17 | 18 | 19 | 20 | export default new VueRouter({ 21 | routes: [ 22 | { 23 | path: "/", 24 | redirect: "/HomePage", 25 | name:'/', 26 | meta: { 27 | title: 'FunAi-首页' 28 | } 29 | }, 30 | { 31 | path: "/ChatHome/:type", 32 | name: "ChatHome", 33 | component: ChatHome, 34 | meta: { 35 | title: 'FunAi-畅聊AI' 36 | } 37 | }, 38 | { 39 | path: "/UserLogin", 40 | name: "UserLogin", 41 | component: LoginPage, 42 | meta: { 43 | title: 'FunAi-登录' 44 | } 45 | }, 46 | { 47 | path: "/UserReset", 48 | name: "UserReset", 49 | component: ResetPage, 50 | meta: { 51 | title: 'FunAi-重置密码' 52 | } 53 | }, 54 | { 55 | path: "/UserRegister", 56 | name: "UserRegister", 57 | component: RegisterPage, 58 | meta: { 59 | title: 'FunAi-注册' 60 | } 61 | }, 62 | { 63 | path: "/Translation", 64 | name: "Translation", 65 | component: Translation, 66 | meta: { 67 | title: 'FunAi-语言学家' 68 | } 69 | }, 70 | { 71 | path: "/ChatWithFile", 72 | name: "ChatWithFile", 73 | component: ChatWithFile, 74 | meta: { 75 | title: 'FunAi-PDF智能阅读' 76 | } 77 | }, 78 | { 79 | path: "/Prompt", 80 | name: "Prompt", 81 | component: Prompt, 82 | meta: { 83 | title: 'FunAi-提示库' 84 | } 85 | }, 86 | { 87 | path: "/Prompt/Info/:op", 88 | name: "PromptInfoOp", 89 | component: PromptInfoOp, 90 | meta: { 91 | title: 'FunAi-提示库操作' 92 | } 93 | }, 94 | { 95 | path: "/ExpertChat", 96 | name: "ExpertChat", 97 | component: ExpertChat, 98 | meta: { 99 | title: 'FunAi-专家系统' 100 | } 101 | }, 102 | { 103 | path: "/GameChat", 104 | name: "GameChat", 105 | component: GameChat, 106 | meta: { 107 | title: 'FunAi-冒险游戏' 108 | } 109 | }, 110 | { 111 | path: "/HomePage", 112 | name: "HomePage", 113 | component: HomePage, 114 | meta: { 115 | title: 'FunAi-首页' 116 | } 117 | }, 118 | { 119 | path: "/userList", 120 | name: "UserList", 121 | component: UserList, 122 | meta: { 123 | title: 'FunAi-用户管理' 124 | } 125 | }, 126 | { 127 | path: "/ImgGenerate", 128 | name: "ImgGenerate", 129 | component: ImgGenerate, 130 | meta: { 131 | title: 'FunAi-智能画图' 132 | } 133 | }, 134 | { 135 | path: "/FileChatIndex", 136 | name: "FileChatIndex", 137 | component: FileChatIndex, 138 | meta: { 139 | title: "文件聊天框主页" 140 | } 141 | } 142 | ] 143 | }) 144 | 145 | -------------------------------------------------------------------------------- /funai-front/src/util/auth.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const TokenKey = 'token' 4 | 5 | export function getToken() { 6 | return Cookies.get(TokenKey) 7 | } 8 | 9 | export function setToken(token) { 10 | return Cookies.set(TokenKey, token) 11 | } 12 | 13 | export function removeToken() { 14 | return Cookies.remove(TokenKey) 15 | } 16 | -------------------------------------------------------------------------------- /funai-front/src/util/request.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import { MessageBox, Message } from 'element-ui' 3 | import cookie from 'js-cookie' 4 | // 创建axios实例 5 | const service = axios.create({ 6 | baseURL: 'http://localhost', 7 | timeout: 15000 // 请求超时时间 8 | }) 9 | // http request 拦截器 10 | service.interceptors.request.use( 11 | config => { 12 | // cookie有token的话就放到header中。 13 | if(cookie.get('token')) { 14 | config.headers['token'] = cookie.get('token') 15 | } 16 | return config 17 | }, 18 | err => { 19 | return Promise.reject(err) 20 | }) 21 | // http response 拦截器 22 | service.interceptors.response.use( 23 | response => { 24 | //状态码是10002, 表示用户未登录 25 | if(response.data.code === 10002) { 26 | this.$message.error("用户未登录!") 27 | //弹出登录输入框 28 | this.$router.push({ path: '/UserLogin', query: {}}); 29 | return 30 | } else if(response.data.code != 20000){ 31 | this.$message.error(response.data.message) 32 | } 33 | return response.data 34 | }, 35 | error => { 36 | return Promise.reject(error.response) 37 | }) 38 | 39 | // 处理 json 格式的转换( 编码 解码 ) 40 | function unitToString(unitArray) { 41 | let encodedString = String.fromCharCode.apply(null, new Uint8Array(unitArray)) 42 | let decodedString = decodeURIComponent(escape(encodedString)) 43 | return JSON.parse(decodedString) // 转对象 44 | } 45 | 46 | export default service 47 | -------------------------------------------------------------------------------- /funai-front/src/util/util.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | //防抖 4 | export function debounce(fn) { 5 | let t = null //只会执行一次 6 | debugger 7 | 8 | return function (){ 9 | if(t){ 10 | clearTimeout(t) 11 | } 12 | t = setTimeout(()=>{ 13 | console.log(temp); //可以获取 14 | // console.log(arguments[0]) //undefined 15 | fn.apply(this,arguments) 16 | //在这个回调函数里面的argument是这个回调函数的参数,因为没有参数所以undefined,可以通过外面的函数赋值来进行访问 17 | //也可以改变成箭头函数,箭头函数的this是指向定义函数的那一层的,所以访问到的arguments是上一层函数的arguments 18 | },1000) 19 | 20 | } 21 | } 22 | //节流 23 | export function throttle(fn, delay = 200) { 24 | let timer = null 25 | console.log(fn); 26 | debugger 27 | return function () { 28 | if(timer) return 29 | timer = setTimeout(() => { 30 | debugger 31 | fn.apply(this,arguments) 32 | timer = null 33 | }) 34 | } 35 | } 36 | //下拉动画 37 | export function animation(obj, target, fn1) { 38 | // console.log(fn1); 39 | // fn是一个回调函数,在定时器结束的时候添加 40 | // 每次开定时器之前先清除掉定时器 41 | clearInterval(obj.timer); 42 | obj.timer = setInterval(function () { 43 | // 步长计算公式 越来越小 44 | // 步长取整 45 | var step = (target - obj.scrollTop) / 10; 46 | step = step > 0 ? Math.ceil(step) : Math.floor(step); 47 | if (obj.scrollTop >= target) { 48 | clearInterval(obj.timer); 49 | // 如果fn1存在,调用fn 50 | if (fn1) { 51 | fn1(); 52 | } 53 | } else { 54 | // 每30毫秒就将新的值给obj.left 55 | obj.scrollTop = obj.scrollTop + step; 56 | } 57 | }, 5); 58 | } 59 | 60 | //判断文件类型 61 | export function judgeFileType(file) { 62 | if (file == null||file == ""){ 63 | alert("请选择要上传的图片!"); 64 | return false; 65 | } 66 | if (file.lastIndexOf('.')==-1){ //如果不存在"." 67 | alert("路径不正确!"); 68 | return false; 69 | } 70 | var AllImgExt=".jpg|.jpeg|.gif|.bmp|.png|"; 71 | var extName = file.substring(file.lastIndexOf(".")).toLowerCase();//(把路径中的所有字母全部转换为小写) 72 | if(AllImgExt.indexOf(extName+"|")==-1) 73 | { 74 | ErrMsg="该文件类型不允许上传。请上传 "+AllImgExt+" 类型的文件,当前文件类型为"+extName; 75 | alert(ErrMsg); 76 | return false; 77 | } 78 | } 79 | 80 | //文件类型 81 | export function fileType() { 82 | return { 83 | 'application/msword': 'word', 84 | 'application/pdf': 'pdf', 85 | 'application/vnd.ms-powerpoint': 'ppt', 86 | 'application/vnd.ms-excel': 'excel', 87 | 'aplication/zip': 'zpi', 88 | } 89 | } -------------------------------------------------------------------------------- /funai-front/src/view/home.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 25 | 26 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/chatwithfile/fileChatIndex.vue: -------------------------------------------------------------------------------- 1 | 67 | 68 | 212 | 213 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/chatwithfile/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 124 | 125 | 298 | 299 | 310 | 311 | 451 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/chatwithfile/pdfWindow.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 147 | 148 | 160 | 161 | 241 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/expertChat/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 38 | 39 | 138 | 139 | 148 | 149 | 211 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/gameChat/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 125 | 126 | 135 | 136 | 183 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/homePage/index.vue: -------------------------------------------------------------------------------- 1 | 57 | 58 | 82 | 83 | 264 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/imgGenerate/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 95 | 96 | 170 | 171 | 180 | 181 | 312 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/linguist/index.vue: -------------------------------------------------------------------------------- 1 | 99 | 100 | 328 | 329 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/prompt/index.vue: -------------------------------------------------------------------------------- 1 | 106 | 107 | 260 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/prompt/info.vue: -------------------------------------------------------------------------------- 1 | 62 | 63 | 190 | 191 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/userInfo/userList.vue: -------------------------------------------------------------------------------- 1 | 137 | 138 | 303 | -------------------------------------------------------------------------------- /funai-front/src/view/pages/userLogin/Reset.vue: -------------------------------------------------------------------------------- 1 | 64 | 65 | 175 | 176 | -------------------------------------------------------------------------------- /funai-front/vue.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('@vue/cli-service') 2 | 3 | const CompressionWebpackPlugin = require('compression-webpack-plugin'); 4 | const productionGzipExtensions = ['js', 'css']; 5 | 6 | module.exports = defineConfig({ 7 | transpileDependencies: true, 8 | publicPath: './', 9 | devServer: { 10 | hot: true,//自动保存 11 | port: 80, 12 | // https: true, 13 | client: { 14 | webSocketURL: 'ws://0.0.0.0:80/ws', 15 | }, 16 | allowedHosts: [ 17 | 'funai.space', // 允许访问的域名地址,即花生壳内网穿透的地址 18 | '.funai.space',// .是二级域名的通配符 19 | 'funai.vip', 20 | '.funai.vip' 21 | ], 22 | }, 23 | configureWebpack: config => { 24 | config.plugins.push(new CompressionWebpackPlugin({ 25 | algorithm: 'gzip', 26 | test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'), 27 | threshold: 10240, 28 | minRatio: 0.8 29 | })); 30 | // config.plugins.push(new webpack.optimize.LimitChunkCountPlugin({ 31 | // maxChunks: 5, 32 | // minChunkSize: 100 33 | // })); 34 | 35 | config.devtool = false; 36 | }, 37 | chainWebpack: config => { 38 | config.plugins.delete("prefetch"); 39 | // 移除 preload 插件 40 | config.plugins.delete('preload'); 41 | // 压缩代码 42 | config.optimization.minimize(true) 43 | }, 44 | }) --------------------------------------------------------------------------------