diff --git a/assets/image/customer.jpg b/assets/image/customer.jpg new file mode 100644 index 0000000..d93ed40 Binary files /dev/null and b/assets/image/customer.jpg differ diff --git a/nuxt.config.js b/nuxt.config.js index b6d1769..c836319 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -57,7 +57,7 @@ export default { plugins: [ '~plugins/main', '~plugins/axios', - { src: "~plugins/websocket.js", ssr: true }, + // { src: "~plugins/websocket.js", ssr: true }, { src: "~plugins/router.js", ssr: true }, { src: "~plugins/i18n.js", ssr: true }, { src: "~plugins/element-ui.js", ssr: true }, diff --git a/package-lock.json b/package-lock.json index 34c1cc9..351c330 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "core-js": "^3.43.0", "dayjs": "^1.11.7", "element-ui": "^2.15.14", + "fingerprintjs2": "^2.1.4", "jquery": "^3.4.1", "lru-cache": "^7.18.3", "nuxt": "2.15.0", @@ -4178,6 +4179,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", @@ -6922,6 +6932,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz", @@ -6999,6 +7015,12 @@ "micromatch": "^4.0.2" } }, + "node_modules/fingerprintjs2": { + "version": "2.1.4", + "resolved": "https://registry.npmmirror.com/fingerprintjs2/-/fingerprintjs2-2.1.4.tgz", + "integrity": "sha512-veP2yVsnYvjDVkzZMyIEwpqCAQfsBLH+U4PK5MlFAnLjZrttbdRqEArE1fPcnJFz5oS5CrdONbsV7J6FGpIJEQ==", + "deprecated": "Package has been renamed to @fingerprintjs/fingerprintjs. Install @fingerprintjs/fingerprintjs to get updates." + }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmmirror.com/flat/-/flat-5.0.2.tgz", @@ -9523,6 +9545,12 @@ "resolved": "https://registry.npmmirror.com/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "node_modules/nan": { + "version": "2.23.0", + "resolved": "https://registry.npmmirror.com/nan/-/nan-2.23.0.tgz", + "integrity": "sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==", + "optional": true + }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", @@ -20381,6 +20409,15 @@ "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.3.0.tgz", "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==" }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", @@ -22497,6 +22534,12 @@ } } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, "fill-range": { "version": "7.1.1", "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.1.1.tgz", @@ -22561,6 +22604,11 @@ "micromatch": "^4.0.2" } }, + "fingerprintjs2": { + "version": "2.1.4", + "resolved": "https://registry.npmmirror.com/fingerprintjs2/-/fingerprintjs2-2.1.4.tgz", + "integrity": "sha512-veP2yVsnYvjDVkzZMyIEwpqCAQfsBLH+U4PK5MlFAnLjZrttbdRqEArE1fPcnJFz5oS5CrdONbsV7J6FGpIJEQ==" + }, "flat": { "version": "5.0.2", "resolved": "https://registry.npmmirror.com/flat/-/flat-5.0.2.tgz", @@ -24397,6 +24445,12 @@ "resolved": "https://registry.npmmirror.com/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "nan": { + "version": "2.23.0", + "resolved": "https://registry.npmmirror.com/nan/-/nan-2.23.0.tgz", + "integrity": "sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==", + "optional": true + }, "nanoid": { "version": "3.3.11", "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.11.tgz", diff --git a/package.json b/package.json index 8aded25..2faa98b 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "core-js": "^3.43.0", "dayjs": "^1.11.7", "element-ui": "^2.15.14", + "fingerprintjs2": "^2.1.4", "jquery": "^3.4.1", "lru-cache": "^7.18.3", "nuxt": "2.15.0", diff --git a/pages/products/_id.vue b/pages/products/_id.vue index 4fffe56..eb720a1 100644 --- a/pages/products/_id.vue +++ b/pages/products/_id.vue @@ -187,12 +187,15 @@ + + diff --git a/pages/products/chatForm.vue b/pages/products/chatForm.vue new file mode 100644 index 0000000..9e5e81d --- /dev/null +++ b/pages/products/chatForm.vue @@ -0,0 +1,246 @@ + + + + + diff --git a/plugins/element-ui.js b/plugins/element-ui.js index 1567525..e3cd14b 100644 --- a/plugins/element-ui.js +++ b/plugins/element-ui.js @@ -2,8 +2,32 @@ import Vue from 'vue' import { // 添加你需要的其他组件 Tree, - Drawer + Drawer, + Dialog, + Button, + Card, + Container, + Header, + Aside, + Input, + Main, + Footer, + Row, + Col, + Avatar } from 'element-ui' Vue.use(Tree) -Vue.use(Drawer) \ No newline at end of file +Vue.use(Drawer) +Vue.use(Dialog) +Vue.use(Button) +Vue.use(Card) +Vue.use(Container) +Vue.use(Header) +Vue.use(Aside) +Vue.use(Input) +Vue.use(Main) +Vue.use(Footer) +Vue.use(Row) +Vue.use(Col) +Vue.use(Avatar) \ No newline at end of file diff --git a/plugins/websocket.js b/plugins/websocket.js index 1a16765..e7a3cce 100644 --- a/plugins/websocket.js +++ b/plugins/websocket.js @@ -1,6 +1,13 @@ -export default ({ store }) => { - if (process.client){ - const websocketUrl = 'ws://localhost:8099/ws/asset/kehuduan' - store.dispatch('modules/websocket/websocket_init', websocketUrl) - } -} \ No newline at end of file + +// import Fingerprint2 from 'fingerprintjs2'; +// +// export default ({ store }) => { +// if (process.client){ +// const fingerprint = Fingerprint2.get((components) => { +// const values = components.map((component)=>component.value) +// const murmur = Fingerprint2.x64hash128(values.join(''),31) +// const websocketUrl = 'ws://localhost:8099/ws/asset/'+murmur +// store.dispatch('modules/websocket/websocket_init', websocketUrl) +// }) +// } +// } \ No newline at end of file diff --git a/store/modules/websocket.js b/store/modules/websocket.js index 1bbc11d..96d31cb 100644 --- a/store/modules/websocket.js +++ b/store/modules/websocket.js @@ -15,16 +15,16 @@ export const mutations = { console.log("WebSocket连接成功"); }; state.socket.onmessage = function (e) { + console.log(e,'接收到的消息') if (e.data.startsWith("C")) { state.count = e.data; } else if (e.data.startsWith("系统通知")){ state.notices.push(e.data); - console.log(state.notices); } else { - state.message.push(JSON.parse(e.data)); - console.log(state.message); + state.messages.push(JSON.parse(e.data)); + console.log(state.messages); } }; state.socket.onerror= function () {