├── .babelrc
├── .editorconfig
├── .gitignore
├── .postcssrc.js
├── README.md
├── build
├── build.js
├── check-versions.js
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
└── webpack.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── index.html
├── package-lock.json
├── package.json
├── src
├── App.vue
├── PopUps.vue
├── SVGComponents
│ ├── chat.vue
│ └── empty.vue
├── api
│ ├── index.js
│ └── modules
│ │ ├── goodfriend.js
│ │ ├── group.js
│ │ ├── singlemessage.js
│ │ ├── sys.js
│ │ ├── user.js
│ │ └── validate.js
├── assets
│ └── img
│ │ └── file.png
├── components
│ ├── avatarChoose
│ │ └── index.vue
│ ├── bearingModal
│ │ └── index.vue
│ ├── beizhuModal
│ │ └── index.vue
│ ├── colorPick
│ │ └── index.vue
│ ├── copyright
│ │ └── index.vue
│ ├── createGroup
│ │ └── index.vue
│ ├── customEmoji
│ │ └── index.vue
│ ├── customGroupUserList
│ │ └── index.vue
│ ├── customPictureView
│ │ └── index.vue
│ ├── customSearchList
│ │ ├── groupList.vue
│ │ └── userList.vue
│ ├── customUploadFile
│ │ └── index.vue
│ ├── fenzuModal
│ │ └── index.vue
│ ├── groupProfile
│ │ └── index.vue
│ ├── messageTypes
│ │ ├── artBoard.vue
│ │ ├── audio.vue
│ │ ├── file.vue
│ │ ├── img.vue
│ │ ├── index.js
│ │ ├── messageTextMenu.vue
│ │ ├── sys.vue
│ │ ├── text.vue
│ │ └── video.vue
│ ├── partTitle
│ │ └── index.vue
│ ├── picturePreview
│ │ └── index.vue
│ ├── search
│ │ └── index.vue
│ ├── theme
│ │ └── index.vue
│ ├── toast
│ │ ├── main.js
│ │ └── main.vue
│ ├── todo
│ │ └── index.vue
│ ├── userProfile
│ │ └── index.vue
│ └── validateNews
│ │ └── index.vue
├── const
│ ├── emoji.json
│ └── index.js
├── directives
│ └── index.js
├── libs
│ └── fullCalendar
│ │ └── fullCalendar.js
├── main.js
├── router
│ └── index.js
├── store
│ ├── constants.js
│ ├── index.js
│ └── modules
│ │ ├── app.js
│ │ ├── device.js
│ │ ├── news.js
│ │ ├── theme.js
│ │ └── user.js
├── utils
│ ├── artboard.js
│ ├── cvcode.js
│ ├── index.js
│ ├── reg.js
│ ├── request.js
│ ├── token.js
│ └── xss.js
└── views
│ ├── 404.vue
│ ├── Add.vue
│ ├── CoArtBoard.vue
│ ├── CoVideo.vue
│ ├── Index.vue
│ ├── Login.vue
│ ├── Schedule.vue
│ ├── Setting.vue
│ ├── SystemNews.vue
│ ├── chat
│ ├── ChatArea.vue
│ ├── components
│ │ ├── GroupDesc.vue
│ │ ├── Header.vue
│ │ ├── HistoryMsg.vue
│ │ ├── HistoryMsgItem.vue
│ │ ├── MessageItem.vue
│ │ ├── MessageList.vue
│ │ └── settingPanel.vue
│ └── index.vue
│ ├── conversation
│ ├── ConversationItem.vue
│ ├── ConversationList.vue
│ ├── FenzuConversation.vue
│ ├── FenzuMenu.vue
│ ├── GroupConversation.vue
│ ├── Menu.vue
│ ├── RecentConversation.vue
│ └── TopSearch.vue
│ └── layout
│ ├── Index.vue
│ └── components
│ ├── Aside.vue
│ ├── Header.vue
│ └── operMenu.vue
└── static
├── .gitkeep
├── audio
├── apple.mp3
├── default.mp3
├── huaji.mp3
├── mobileqq.mp3
├── momo.mp3
├── notify.mp3
└── pcqq.mp3
├── css
├── animation.scss
├── base.css
├── base.scss
├── theme.scss
└── var.scss
├── iconfont
├── iconfont.css
├── iconfont.eot
├── iconfont.js
├── iconfont.json
├── iconfont.svg
├── iconfont.ttf
├── iconfont.woff
└── iconfont.woff2
└── image
├── 1.jpg
├── 2.jpg
├── 3.jpg
├── 4.jpg
├── 404.gif
├── bg.jpg
├── bg.png
├── canvas.jpg
├── canvas2.jpg
├── empty.png
├── favicon.ico
├── icons.png
├── logo.jpg
├── ocean1.jpg
└── theme
├── abstract.jpg
├── city.jpg
└── ocean.jpg
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # chatclient
2 |
3 | > 网页在线聊天系统前端
4 |
5 | ## Front-end Stack
6 | > `Vue`、`Vuex`、`Element-UI`、`Axios`、`ES6`、`WebSocket`、`WebRTC`等。
7 |
8 | ## Description
9 |
10 | - 启动本项目前,先修改一下`src/views/CoArtBoard.vue`和`src/views/CoVideo.vue`这2个文件中的`iceServers`参数值,即配置`coturn`中继服务器信息。如何搭建`coturn`服务器?[传送门](https://www.jianshu.com/p/7e9d0af05396)
11 | - 若不想搭建`coturn`服务器,则白板协作、语音视频通话功能只能在本地进行。其中,`1v1`视频通话失败,因为需要两个不同的视频输出流,其它功能都使用正常。注意:将下面这行代码的参数去掉即可。
12 |
13 | ```js
14 | this.peer = new PeerConnection(this.iceServers) //已搭建 coturn 服务器
15 | this.peer = new PeerConnection() // 只在本地环境测试进行
16 | ```
17 |
18 | - 打包并部署到服务器注意事项:[传送门](https://www.jianshu.com/p/83b76e62976b)
19 |
20 | ## Build Setup
21 |
22 | ``` bash
23 | # install dependencies
24 | npm install
25 |
26 | # serve with hot reload at localhost:3000
27 | npm run dev
28 |
29 | # build for production with minification
30 | npm run build
31 | ```
32 |
33 | ## Reference
34 |
35 | > 前端界面参考:https://github.com/CCZX/wechat
36 |
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | require('./check-versions')()
3 |
4 | process.env.NODE_ENV = 'production'
5 |
6 | const ora = require('ora')
7 | const rm = require('rimraf')
8 | const path = require('path')
9 | const chalk = require('chalk')
10 | const webpack = require('webpack')
11 | const config = require('../config')
12 | const webpackConfig = require('./webpack.prod.conf')
13 |
14 | const spinner = ora('building for production...')
15 | spinner.start()
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop()
21 | if (err) throw err
22 | process.stdout.write(stats.toString({
23 | colors: true,
24 | modules: false,
25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26 | chunks: false,
27 | chunkModules: false
28 | }) + '\n\n')
29 |
30 | if (stats.hasErrors()) {
31 | console.log(chalk.red(' Build failed with errors.\n'))
32 | process.exit(1)
33 | }
34 |
35 | console.log(chalk.cyan(' Build complete.\n'))
36 | console.log(chalk.yellow(
37 | ' Tip: built files are meant to be served over an HTTP server.\n' +
38 | ' Opening index.html over file:// won\'t work.\n'
39 | ))
40 | })
41 | })
42 |
--------------------------------------------------------------------------------
/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/build/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const config = require('../config')
4 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
5 | const packageConfig = require('../package.json')
6 |
7 | exports.assetsPath = function (_path) {
8 | const assetsSubDirectory = process.env.NODE_ENV === 'production'
9 | ? config.build.assetsSubDirectory
10 | : config.dev.assetsSubDirectory
11 |
12 | return path.posix.join(assetsSubDirectory, _path)
13 | }
14 |
15 | exports.cssLoaders = function (options) {
16 | options = options || {}
17 |
18 | const cssLoader = {
19 | loader: 'css-loader',
20 | options: {
21 | sourceMap: options.sourceMap
22 | }
23 | }
24 |
25 | const postcssLoader = {
26 | loader: 'postcss-loader',
27 | options: {
28 | sourceMap: options.sourceMap
29 | }
30 | }
31 |
32 | // generate loader string to be used with extract text plugin
33 | function generateLoaders(loader, loaderOptions) {
34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35 |
36 | if (loader) {
37 | loaders.push({
38 | loader: loader + '-loader',
39 | options: Object.assign({}, loaderOptions, {
40 | sourceMap: options.sourceMap
41 | })
42 | })
43 | }
44 |
45 | // Extract CSS when that option is specified
46 | // (which is the case during production build)
47 | if (options.extract) {
48 | return ExtractTextPlugin.extract({
49 | use: loaders,
50 | fallback: 'vue-style-loader',
51 | publicPath: '../../'
52 | })
53 | } else {
54 | return ['vue-style-loader'].concat(loaders)
55 | }
56 | }
57 |
58 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
59 | return {
60 | css: generateLoaders(),
61 | postcss: generateLoaders(),
62 | less: generateLoaders('less'),
63 | sass: generateLoaders('sass', {indentedSyntax: true}),
64 | scss: generateLoaders('sass'),
65 | stylus: generateLoaders('stylus'),
66 | styl: generateLoaders('stylus')
67 | }
68 | }
69 |
70 | // Generate loaders for standalone style files (outside of .vue)
71 | exports.styleLoaders = function (options) {
72 | const output = []
73 | const loaders = exports.cssLoaders(options)
74 |
75 | for (const extension in loaders) {
76 | const loader = loaders[extension]
77 | output.push({
78 | test: new RegExp('\\.' + extension + '$'),
79 | use: loader
80 | })
81 | }
82 |
83 | return output
84 | }
85 |
86 | exports.createNotifierCallback = () => {
87 | const notifier = require('node-notifier')
88 |
89 | return (severity, errors) => {
90 | if (severity !== 'error') return
91 |
92 | const error = errors[0]
93 | const filename = error.file && error.file.split('!').pop()
94 |
95 | notifier.notify({
96 | title: packageConfig.name,
97 | message: severity + ': ' + error.name,
98 | subtitle: filename || '',
99 | //icon: path.join(__dirname, 'logo.png')
100 | })
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const config = require('../config')
5 | const vueLoaderConfig = require('./vue-loader.conf')
6 |
7 | function resolve(dir) {
8 | return path.join(__dirname, '..', dir)
9 | }
10 |
11 |
12 | module.exports = {
13 | context: path.resolve(__dirname, '../'),
14 | entry: {
15 | app: './src/main.js'
16 | },
17 | output: {
18 | path: config.build.assetsRoot,
19 | filename: '[name].js',
20 | publicPath: process.env.NODE_ENV === 'production'
21 | ? config.build.assetsPublicPath
22 | : config.dev.assetsPublicPath
23 | },
24 | resolve: {
25 | extensions: ['.js', '.vue', '.json'],
26 | alias: {
27 | 'vue$': 'vue/dist/vue.esm.js',
28 | '@': resolve('src'),
29 | }
30 | },
31 | module: {
32 | rules: [
33 | {
34 | test: /\.vue$/,
35 | loader: 'vue-loader',
36 | options: vueLoaderConfig
37 | },
38 | {
39 | test: /\.js$/,
40 | loader: 'babel-loader',
41 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
42 | },
43 | {
44 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
45 | loader: 'url-loader',
46 | options: {
47 | limit: 10000,
48 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
49 | }
50 | },
51 | {
52 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
53 | loader: 'url-loader',
54 | options: {
55 | limit: 10000,
56 | name: utils.assetsPath('media/[name].[hash:7].[ext]')
57 | }
58 | },
59 | {
60 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
61 | loader: 'url-loader',
62 | options: {
63 | limit: 10000,
64 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
65 | }
66 | },
67 | {
68 | test: /\.sass$/,
69 | loaders: ['style', 'css', 'sass']
70 | }
71 | ]
72 | },
73 | node: {
74 | // prevent webpack from injecting useless setImmediate polyfill because Vue
75 | // source contains it (although only uses it if it's native).
76 | setImmediate: false,
77 | // prevent webpack from injecting mocks to Node native modules
78 | // that does not make sense for the client
79 | dgram: 'empty',
80 | fs: 'empty',
81 | net: 'empty',
82 | tls: 'empty',
83 | child_process: 'empty'
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const webpack = require('webpack')
4 | const config = require('../config')
5 | const merge = require('webpack-merge')
6 | const path = require('path')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11 | const portfinder = require('portfinder')
12 |
13 | const HOST = process.env.HOST
14 | const PORT = process.env.PORT && Number(process.env.PORT)
15 |
16 | const devWebpackConfig = merge(baseWebpackConfig, {
17 | module: {
18 | rules: utils.styleLoaders({sourceMap: config.dev.cssSourceMap, usePostCSS: true})
19 | },
20 | // cheap-module-eval-source-map is faster for development
21 | devtool: config.dev.devtool,
22 |
23 | // these devServer options should be customized in /config/index.js
24 | devServer: {
25 | clientLogLevel: 'warning',
26 | historyApiFallback: {
27 | rewrites: [
28 | {from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html')},
29 | ],
30 | },
31 | hot: true,
32 | contentBase: false, // since we use CopyWebpackPlugin.
33 | compress: true,
34 | host: HOST || config.dev.host,
35 | port: PORT || config.dev.port,
36 | open: config.dev.autoOpenBrowser,
37 | overlay: config.dev.errorOverlay
38 | ? {warnings: false, errors: true}
39 | : false,
40 | publicPath: config.dev.assetsPublicPath,
41 | proxy: config.dev.proxyTable,
42 | quiet: true, // necessary for FriendlyErrorsPlugin
43 | watchOptions: {
44 | poll: config.dev.poll,
45 | }
46 | },
47 | plugins: [
48 | new webpack.DefinePlugin({
49 | 'process.env': require('../config/dev.env')
50 | }),
51 | new webpack.HotModuleReplacementPlugin(),
52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
53 | new webpack.NoEmitOnErrorsPlugin(),
54 | // https://github.com/ampedandwired/html-webpack-plugin
55 | new HtmlWebpackPlugin({
56 | filename: 'index.html',
57 | template: 'index.html',
58 | inject: true
59 | }),
60 | // copy custom static assets
61 | new CopyWebpackPlugin([
62 | {
63 | from: path.resolve(__dirname, '../static'),
64 | to: config.dev.assetsSubDirectory,
65 | ignore: ['.*']
66 | }
67 | ])
68 | ]
69 | })
70 |
71 | module.exports = new Promise((resolve, reject) => {
72 | portfinder.basePort = process.env.PORT || config.dev.port
73 | portfinder.getPort((err, port) => {
74 | if (err) {
75 | reject(err)
76 | } else {
77 | // publish the new Port, necessary for e2e tests
78 | process.env.PORT = port
79 | // add port to devServer config
80 | devWebpackConfig.devServer.port = port
81 |
82 | // Add FriendlyErrorsPlugin
83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
84 | compilationSuccessInfo: {
85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
86 | },
87 | onErrors: config.dev.notifyOnErrors
88 | ? utils.createNotifierCallback()
89 | : undefined
90 | }))
91 |
92 | resolve(devWebpackConfig)
93 | }
94 | })
95 | })
96 |
--------------------------------------------------------------------------------
/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const path = require('path')
3 | const utils = require('./utils')
4 | const webpack = require('webpack')
5 | const config = require('../config')
6 | const merge = require('webpack-merge')
7 | const baseWebpackConfig = require('./webpack.base.conf')
8 | const CopyWebpackPlugin = require('copy-webpack-plugin')
9 | const HtmlWebpackPlugin = require('html-webpack-plugin')
10 | const ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13 |
14 | const env = require('../config/prod.env')
15 |
16 | const webpackConfig = merge(baseWebpackConfig, {
17 | module: {
18 | rules: utils.styleLoaders({
19 | sourceMap: config.build.productionSourceMap,
20 | extract: true,
21 | usePostCSS: true
22 | })
23 | },
24 | devtool: config.build.productionSourceMap ? config.build.devtool : false,
25 | output: {
26 | path: config.build.assetsRoot,
27 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
29 | },
30 | plugins: [
31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
32 | new webpack.DefinePlugin({
33 | 'process.env': env
34 | }),
35 | new UglifyJsPlugin({
36 | uglifyOptions: {
37 | compress: {
38 | warnings: false
39 | }
40 | },
41 | sourceMap: config.build.productionSourceMap,
42 | parallel: true
43 | }),
44 | // extract css into its own file
45 | new ExtractTextPlugin({
46 | filename: utils.assetsPath('css/[name].[contenthash].css'),
47 | // Setting the following option to `false` will not extract CSS from codesplit chunks.
48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
51 | allChunks: true,
52 | }),
53 | // Compress extracted CSS. We are using this plugin so that possible
54 | // duplicated CSS from different components can be deduped.
55 | new OptimizeCSSPlugin({
56 | cssProcessorOptions: config.build.productionSourceMap
57 | ? { safe: true, map: { inline: false } }
58 | : { safe: true }
59 | }),
60 | // generate dist index.html with correct asset hash for caching.
61 | // you can customize output by editing /index.html
62 | // see https://github.com/ampedandwired/html-webpack-plugin
63 | new HtmlWebpackPlugin({
64 | filename: config.build.index,
65 | template: 'index.html',
66 | inject: true,
67 | minify: {
68 | removeComments: true,
69 | collapseWhitespace: true,
70 | removeAttributeQuotes: true
71 | // more options:
72 | // https://github.com/kangax/html-minifier#options-quick-reference
73 | },
74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
75 | chunksSortMode: 'dependency'
76 | }),
77 | // keep module.id stable when vendor modules does not change
78 | new webpack.HashedModuleIdsPlugin(),
79 | // enable scope hoisting
80 | new webpack.optimize.ModuleConcatenationPlugin(),
81 | // split vendor js into its own file
82 | new webpack.optimize.CommonsChunkPlugin({
83 | name: 'vendor',
84 | minChunks (module) {
85 | // any required modules inside node_modules are extracted to vendor
86 | return (
87 | module.resource &&
88 | /\.js$/.test(module.resource) &&
89 | module.resource.indexOf(
90 | path.join(__dirname, '../node_modules')
91 | ) === 0
92 | )
93 | }
94 | }),
95 | // extract webpack runtime and module manifest to its own file in order to
96 | // prevent vendor hash from being updated whenever app bundle is updated
97 | new webpack.optimize.CommonsChunkPlugin({
98 | name: 'manifest',
99 | minChunks: Infinity
100 | }),
101 | // This instance extracts shared chunks from code splitted chunks and bundles them
102 | // in a separate chunk, similar to the vendor chunk
103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
104 | new webpack.optimize.CommonsChunkPlugin({
105 | name: 'app',
106 | async: 'vendor-async',
107 | children: true,
108 | minChunks: 3
109 | }),
110 |
111 | // copy custom static assets
112 | new CopyWebpackPlugin([
113 | {
114 | from: path.resolve(__dirname, '../static'),
115 | to: config.build.assetsSubDirectory,
116 | ignore: ['.*']
117 | }
118 | ])
119 | ]
120 | })
121 |
122 | if (config.build.productionGzip) {
123 | const CompressionWebpackPlugin = require('compression-webpack-plugin')
124 |
125 | webpackConfig.plugins.push(
126 | new CompressionWebpackPlugin({
127 | asset: '[path].gz[query]',
128 | algorithm: 'gzip',
129 | test: new RegExp(
130 | '\\.(' +
131 | config.build.productionGzipExtensions.join('|') +
132 | ')$'
133 | ),
134 | threshold: 10240,
135 | minRatio: 0.8
136 | })
137 | )
138 | }
139 |
140 | if (config.build.bundleAnalyzerReport) {
141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
143 | }
144 |
145 | module.exports = webpackConfig
146 |
--------------------------------------------------------------------------------
/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"',
7 | IMG_URL: '"http://localhost:5555/chat/"',
8 | SOCKET_URL: '"http://localhost:9999/"'
9 | })
10 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | // Template version: 1.3.1
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path')
6 |
7 | module.exports = {
8 | dev: {
9 | // Paths
10 | assetsSubDirectory: 'static',
11 | assetsPublicPath: '/',
12 | proxyTable: { //设置开发接口代理
13 | '/api': {
14 | target: 'http://localhost:5555/chat',
15 | changeOrigin: true,
16 | pathRewrite: {
17 | '^/api': '/' //将前缀 /api 转为 /
18 | }
19 | }
20 | },
21 |
22 | // Various Dev Server settings
23 | host: 'localhost', // can be overwritten by process.env.HOST
24 | port: 3000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
25 | autoOpenBrowser: false,
26 | errorOverlay: true,
27 | notifyOnErrors: true,
28 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
29 |
30 |
31 | /**
32 | * Source Maps
33 | */
34 |
35 | // https://webpack.js.org/configuration/devtool/#development
36 | devtool: 'source-map',
37 |
38 | // If you have problems debugging vue-files in devtools,
39 | // set this to false - it *may* help
40 | // https://vue-loader.vuejs.org/en/options.html#cachebusting
41 | cacheBusting: true,
42 |
43 | cssSourceMap: true
44 | },
45 |
46 | build: {
47 | // Template for index.html
48 | // index: path.resolve(__dirname, '../dist/index.html'),
49 | index: path.resolve(__dirname, '../../chatclient/index.html'), // 编译输入的 index.html 文件
50 |
51 | // Paths
52 | assetsRoot: path.resolve(__dirname, '../dist'), //编译输出的静态资源路径
53 | assetsSubDirectory: 'static', // 编译输出的二级目录
54 | assetsPublicPath: '/frontend/', // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名,Nginx 访问目录下建这个文件夹作为当前项目的访问路径
55 |
56 | /**
57 | * Source Maps
58 | */
59 |
60 | productionSourceMap: true,
61 | // https://webpack.js.org/configuration/devtool/#production
62 | devtool: '#source-map',
63 |
64 | // Gzip off by default as many popular static hosts such as
65 | // Surge or Netlify already gzip all static assets for you.
66 | // Before setting to `true`, make sure to:
67 | // npm install --save-dev compression-webpack-plugin
68 | productionGzip: false,
69 | productionGzipExtensions: ['js', 'css'],
70 |
71 | // Run the build command with an extra argument to
72 | // View the bundle analyzer report after build finishes:
73 | // `npm run build --report`
74 | // Set to `true` or `false` to always turn it on or off
75 | bundleAnalyzerReport: process.env.npm_config_report
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"',
4 | IMG_URL: '"https://xxxxx/api/"', // xxxxx 为域名
5 | SOCKET_URL: '"https://xxxxx/"'
6 | }
7 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | chatroom
8 |
9 |
10 |
11 |
12 |
13 |
56 |
57 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chatclient",
3 | "version": "1.0.0",
4 | "description": "chatclient",
5 | "author": "acgoto <1728387033@qq.com>",
6 | "private": true,
7 | "scripts": {
8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9 | "start": "npm run dev",
10 | "build": "node build/build.js"
11 | },
12 | "dependencies": {
13 | "area-data": "^5.0.6",
14 | "axios": "^0.21.1",
15 | "element-ui": "^2.12.0",
16 | "js-cookie": "^2.2.1",
17 | "lodash": "^4.17.15",
18 | "marked": "^1.0.0",
19 | "normalize.css": "^8.0.1",
20 | "vue": "^2.5.2",
21 | "vue-draggable-resizable": "^2.1.0",
22 | "vue-router": "^3.0.1",
23 | "vue-socket.io": "^3.0.7",
24 | "vuex": "^3.1.1",
25 | "xss": "^1.0.6"
26 | },
27 | "devDependencies": {
28 | "autoprefixer": "^7.1.2",
29 | "babel-core": "^6.22.1",
30 | "babel-helper-vue-jsx-merge-props": "^2.0.3",
31 | "babel-loader": "^7.1.1",
32 | "babel-plugin-syntax-jsx": "^6.18.0",
33 | "babel-plugin-transform-runtime": "^6.22.0",
34 | "babel-plugin-transform-vue-jsx": "^3.5.0",
35 | "babel-preset-env": "^1.3.2",
36 | "babel-preset-stage-2": "^6.22.0",
37 | "chalk": "^2.0.1",
38 | "copy-webpack-plugin": "^4.0.1",
39 | "css-loader": "^0.28.0",
40 | "extract-text-webpack-plugin": "^3.0.0",
41 | "file-loader": "^1.1.4",
42 | "friendly-errors-webpack-plugin": "^1.6.1",
43 | "html-webpack-plugin": "^2.30.1",
44 | "node-notifier": "^5.1.2",
45 | "node-sass": "^4.13.1",
46 | "optimize-css-assets-webpack-plugin": "^3.2.0",
47 | "ora": "^1.2.0",
48 | "portfinder": "^1.0.13",
49 | "postcss-import": "^11.0.0",
50 | "postcss-loader": "^2.0.8",
51 | "postcss-url": "^7.2.1",
52 | "rimraf": "^2.6.0",
53 | "sass-loader": "^7.3.1",
54 | "semver": "^5.3.0",
55 | "shelljs": "^0.7.6",
56 | "socket.io-client": "^2.3.0",
57 | "uglifyjs-webpack-plugin": "^1.1.1",
58 | "url-loader": "^0.5.8",
59 | "vue-loader": "^13.3.0",
60 | "vue-style-loader": "^3.0.1",
61 | "vue-template-compiler": "^2.5.2",
62 | "webpack": "^3.6.0",
63 | "webpack-bundle-analyzer": "^2.9.0",
64 | "webpack-cli": "^4.5.0",
65 | "webpack-dev-server": "^2.11.5",
66 | "webpack-merge": "^4.1.0"
67 | },
68 | "engines": {
69 | "node": ">= 6.0.0",
70 | "npm": ">= 3.0.0"
71 | },
72 | "browserslist": [
73 | "> 1%",
74 | "last 2 versions",
75 | "not ie <= 8"
76 | ]
77 | }
78 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
58 |
--------------------------------------------------------------------------------
/src/PopUps.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
29 |
30 |
31 |
32 |
114 |
--------------------------------------------------------------------------------
/src/api/index.js:
--------------------------------------------------------------------------------
1 | import goodfriend from './modules/goodfriend'
2 | import group from './modules/group'
3 | import singlemessage from './modules/singlemessage'
4 | import sys from './modules/sys'
5 | import validate from './modules/validate'
6 | import user from './modules/user'
7 |
8 |
9 | export default {
10 | ...user,
11 | ...goodfriend,
12 | ...group,
13 | ...singlemessage,
14 | ...sys,
15 | ...validate,
16 | }
17 |
--------------------------------------------------------------------------------
/src/api/modules/goodfriend.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export default {
4 | /** 获取我的好友列表 */
5 | getMyFriendsList(userId) {
6 | return request.get(`/api/goodFriend/getMyFriendsList?userId=${userId}`)
7 | },
8 | /** 查询最近的好友列表 */
9 | getRecentConversationList(data) {
10 | return request.post(`/api/goodFriend/recentConversationList`, data)
11 | },
12 | /** 删除好友 */
13 | deleteGoodFriend(data) {
14 | return request.delete(`/api/goodFriend/deleteGoodFriend`, {data: data})
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/api/modules/group.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export default {
4 | /**
5 | * 根据用户名获取其对应的群聊,用户名在user实体中对应name字段
6 | */
7 | getMyGroupList(username) {
8 | return request.get(`/api/group/getMyGroupList?username=${username}`)
9 | },
10 | /**
11 | * 根据id获取群聊详情
12 | */
13 | getGroupInfo(groupId) {
14 | return request.get(`/api/group/getGroupInfo?groupId=${groupId}`)
15 | },
16 | /**
17 | * 根据条件搜索群聊
18 | */
19 | preFetchGroup(data) {
20 | return request.post(`/api/group/preFetchGroup`, data)
21 | },
22 | /**
23 | * 创建群聊
24 | */
25 | createGroup(data) {
26 | return request.post(`/api/group/createGroup`, data)
27 | },
28 | /** 获取最近的群聊 */
29 | getRecentGroup(data) {
30 | return request.post(`/api/group/recentGroup`, data)
31 | },
32 | /**
33 | * 获取最近的群消息
34 | */
35 | getRecentGroupMessages(data) {
36 | const {roomId, pageIndex, pageSize} = data
37 | return request.get(`/api/groupMessage/getRecentGroupMessages?roomId=${roomId}&pageIndex=${pageIndex}&pageSize=${pageSize}`)
38 | },
39 | /**
40 | * 获取群聊历史记录
41 | */
42 | getGroupHistoryMessages(data) {
43 | return request.post(`/api/groupMessage/historyMessages`, data)
44 | },
45 | /**
46 | * 获取群最后一条消息
47 | */
48 | getGroupLastMessage(roomId) {
49 | return request.get(`/api/groupMessage/lastMessage?roomId=${roomId}`)
50 | },
51 | /**
52 | * 退出或解散群聊
53 | */
54 | quitGroup(data) {
55 | return request.post(`/api/group/quitGroup`, data)
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/api/modules/singlemessage.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export default {
4 | /**
5 | * 获取最近的单聊消息
6 | */
7 | getRecentSingleMessages(data) {
8 | const {roomId, pageIndex, pageSize} = data
9 | return request.get(`/api/singleMessage/getRecentSingleMessages?roomId=${roomId}&pageIndex=${pageIndex}&pageSize=${pageSize}`)
10 | },
11 |
12 | /**
13 | * 获取好友之间的最后一条聊天记录
14 | */
15 | getLastMessage(roomId) {
16 | return request.get(`/api/singleMessage/getLastMessage?roomId=${roomId}`)
17 | },
18 |
19 | /**
20 | * 当用户在切换会话阅读消息后,标记该消息已读
21 | */
22 | userIsReadMessage(data) {
23 | return request.post(`/api/singleMessage/isRead`, data)
24 | },
25 |
26 | /**
27 | * 获取单聊历史记录
28 | */
29 | getSingleHistoryMessages(data) {
30 | return request.post(`/api/singleMessage/historyMessage`, data)
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/api/modules/sys.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export default {
4 | //获取系统用户
5 | getSysUsers() {
6 | return request.get(`/api/sys/getSysUsers`)
7 | },
8 | // 获取天气信息
9 | getWeather(city) {
10 | return request.get(`http://wthrcdn.etouch.cn/weather_mini?city=${city}`)
11 | },
12 | /** 获取注册时的头像 */
13 | getFaceImages() {
14 | return request.get(`/api/sys/getFaceImages`)
15 | },
16 | /**上传文件 */
17 | uploadFile(data) {
18 | return request.post(`/api/sys/uploadFile`, data)
19 | },
20 | /** 获取图片的真实路径 */
21 | getRealFilePath(fileId) {
22 | return request.get(`/api/sys/getRealFilePath?fileId=${fileId}`)
23 | },
24 | /** 添加反馈信息 */
25 | addFeedBack(data) {
26 | return request.post(`/api/sys/addFeedBack`, data)
27 | },
28 | /** 搜索好友或加过的群聊 */
29 | topSearch(keyword) {
30 | return request.get(`/api/sys/topSearch?keyword=${keyword}`)
31 | },
32 | /** 过滤发送的消息 */
33 | filterMessage(message) {
34 | return request.post(`/api/sys/filterMessage`, message)
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/api/modules/user.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export default {
4 | /**登录 */
5 | login(data) {
6 | return request.post(`/api/user/login`, data)
7 | },
8 | /**获取验证码 */
9 | getCVCode() {
10 | return request.get(`/api/user/getCode`)
11 | },
12 | /** 用户注册 */
13 | register(data) {
14 | return request.post(`/api/user/register`, data)
15 | },
16 | /**获取用户详情 */
17 | getUserInfo(uid) {
18 | return request.get(`/api/user/getUserInfo?uid=${uid}`)
19 | },
20 | /**获取用户(搜索) */
21 | preFetchUser(data) {
22 | return request.post(`/api/user/preFetchUser`, data)
23 | },
24 | /**添加分组 */
25 | addNewFenZu(data) {
26 | return request.post(`/api/user/addFenZu`, data)
27 | },
28 | /**修改好友所在的分组 */
29 | modifyFriendFenZu(data) {
30 | return request.post(`/api/user/modifyFriendFenZu`, data)
31 | },
32 | /**修改好友的备注 */
33 | modifyFriendBeiZhu(data) {
34 | return request.post(`/api/user/modifyFriendBeiZhu`, data)
35 | },
36 | /** 删除分组 */
37 | deleteFenZu(data) {
38 | return request.delete(`/api/user/delFenZu`, {data: data}) //todo:待测试,参数只能放在data中
39 | },
40 | /** 编辑分组 */
41 | editFenZu(data) {
42 | return request.post(`/api/user/editFenZu`, data)
43 | },
44 | /**更新用户相关信息 */
45 | updateUserInfo(data) {
46 | return request.post(`/api/user/updateUserInfo`, data)
47 | },
48 | /**更新用户密码 */
49 | updateUserPwd(data) {
50 | return request.post(`/api/user/updateUserPwd`, data)
51 | },
52 | /** 更新用户的一些配置信息 */
53 | updateUserConfigure(data) {
54 | return request.post(`/api/user/updateUserConfigure`, data)
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/api/modules/validate.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export default {
4 | getMyValidateMessageList(userId) {
5 | return request.get(`/api/validate/getMyValidateMessageList?userId=${userId}`)
6 | },
7 | getValidateMessage(data) {
8 | const {roomId, status, validateType} = data
9 | return request.get(`/api/validate/getValidateMessage?roomId=${roomId}&status=${status}&validateType=${validateType}`)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/assets/img/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/src/assets/img/file.png
--------------------------------------------------------------------------------
/src/components/avatarChoose/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
选择头像
6 |
11 |
![]()
12 |
13 |
14 |
15 |
16 |
17 |
48 |
49 |
73 |
--------------------------------------------------------------------------------
/src/components/bearingModal/index.vue:
--------------------------------------------------------------------------------
1 | /**
2 | 通用承载modal框
3 | */
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
48 |
49 |
66 |
--------------------------------------------------------------------------------
/src/components/beizhuModal/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
61 |
62 |
80 |
--------------------------------------------------------------------------------
/src/components/colorPick/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
请输入正确16进制色值
7 |
8 |
15 |
17 | #
18 |
19 |
20 |
21 |
22 |
23 |
69 |
70 |
116 |
--------------------------------------------------------------------------------
/src/components/copyright/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Copyright©2020-{{endTime}}
4 |
作者:wzomg
5 |
邮箱:sharezzw@163.com
6 |
7 |
8 |
9 |
18 |
19 |
34 |
--------------------------------------------------------------------------------
/src/components/createGroup/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 提交
25 | 重置
26 |
27 |
28 |
29 |
30 |
31 |
32 |
105 |
106 |
115 |
--------------------------------------------------------------------------------
/src/components/customEmoji/index.vue:
--------------------------------------------------------------------------------
1 |
2 | {}">
3 |
4 |
5 |
6 |
11 | {{item}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
55 |
56 |
73 |
--------------------------------------------------------------------------------
/src/components/customGroupUserList/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
true">
13 |
14 |
15 |
16 |
17 | {{item.userInfo.beiZhu ? item.userInfo.beiZhu : item.userInfo.nickname}}
18 |
19 | · 群主
20 |
21 |
22 |
23 |
24 |
25 |
26 |
63 |
64 |
98 |
99 |
--------------------------------------------------------------------------------
/src/components/customPictureView/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 图片{{pitures.length}}/{{size}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
![]()
15 |
图片上传中...
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
46 |
47 |
97 |
--------------------------------------------------------------------------------
/src/components/customSearchList/groupList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
12 |
13 | {{item.title}}
14 |
15 |
16 |
{{item.desc}}
17 |
18 |
19 |
20 |
添加
26 |
27 |
已添加
32 |
33 |
37 |
38 |
43 |
44 |
45 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
136 |
137 |
185 |
--------------------------------------------------------------------------------
/src/components/customSearchList/userList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
22 |
23 |
添加
30 |
31 |
已添加
36 |
37 |
41 |
42 |
47 |
48 |
49 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
134 |
135 |
183 |
--------------------------------------------------------------------------------
/src/components/customUploadFile/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
20 | 选取文件
21 | 传输
22 | 文件大小不超过1MB
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
72 |
73 |
75 |
--------------------------------------------------------------------------------
/src/components/fenzuModal/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
17 | {{item}}({{userInfo.friendFenZu[item].length}})
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
78 |
79 |
118 |
119 |
--------------------------------------------------------------------------------
/src/components/groupProfile/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
17 |
18 |
19 | 群号码:{{ groupInfo.code }}
20 | 群名称:{{ groupInfo.title }}
21 | 群主账号:{{ groupInfo.holderName }}
22 | 群人数:{{ groupInfo.userNum }}
23 | 群描述:{{ groupInfo.desc }}
24 | 本群创建于{{ groupInfo.createDate | formatDateToZH }}
25 |
26 |
27 |
28 |
29 |
30 |
35 |
36 |
37 |
41 |
42 |
43 | 群号码:{{ groupInfo.code }}
44 | 群名称:{{ groupInfo.title }}
45 | 群主账号:{{ groupInfo.holderName }}
46 | 群人数:{{ groupInfo.userNum }}
47 | 群描述:{{ groupInfo.desc }}
48 | 本群创建于{{ groupInfo.createDate | formatDateToZH }}
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
86 |
87 |
160 |
161 |
--------------------------------------------------------------------------------
/src/components/messageTypes/artBoard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 白板协作
4 |
5 |
6 |
7 |
14 |
--------------------------------------------------------------------------------
/src/components/messageTypes/audio.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 语音通话
4 |
5 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/src/components/messageTypes/file.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 | {{message.fileRawName.lastIndexOf('.') > 12 ? message.fileRawName.slice(0, 12) +
6 | '...' + message.fileRawName.slice(message.fileRawName.lastIndexOf('.')) : message.fileRawName}}
7 |
8 | 发送成功
9 |
10 |
11 |
12 |
13 |
14 |
15 |
22 |
44 |
--------------------------------------------------------------------------------
/src/components/messageTypes/img.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
![图片加载失败]()
5 |
6 |
图片上传中...
7 |
12 |
13 |
19 |
20 |
21 |
22 |
23 |
57 |
58 |
97 |
--------------------------------------------------------------------------------
/src/components/messageTypes/index.js:
--------------------------------------------------------------------------------
1 | import { MSG_TYPES } from '@/const'
2 | import messageVideo from './video'
3 | import messageArtBoard from './artBoard'
4 | import messageAudio from './audio'
5 | import messageFile from './file'
6 | import messageSys from './sys'
7 | import messageText from './text'
8 | import messageImg from './img'
9 |
10 | export default {
11 | messageVideo,
12 | messageArtBoard,
13 | messageAudio,
14 | messageFile,
15 | messageSys,
16 | messageText,
17 | messageImg
18 | }
19 |
20 | export const messageTypesCmp = {
21 | [MSG_TYPES.text+'cmp']: messageText,
22 | [MSG_TYPES.img+'cmp']: messageImg,
23 | [MSG_TYPES.sys+'cmp']: messageSys,
24 | [MSG_TYPES.file+'cmp']: messageFile,
25 | [MSG_TYPES.artBoard+'cmp']: messageArtBoard,
26 | [MSG_TYPES.video+'cmp']: messageVideo,
27 | [MSG_TYPES.audio+'cmp']: messageAudio,
28 | }
29 |
30 | export const mixins = {
31 | props: {
32 | message: {
33 | type: Object
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/components/messageTypes/messageTextMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
55 |
56 |
69 |
70 |
--------------------------------------------------------------------------------
/src/components/messageTypes/sys.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{message.message}}
4 |
5 |
6 |
7 |
14 |
15 |
22 |
--------------------------------------------------------------------------------
/src/components/messageTypes/text.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{message.message}}
4 |
5 |
6 |
7 |
25 |
--------------------------------------------------------------------------------
/src/components/messageTypes/video.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 视频通话
4 |
5 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/src/components/partTitle/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{text}}
5 |
6 |
7 |
8 |
26 |
27 |
42 |
--------------------------------------------------------------------------------
/src/components/picturePreview/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
![图片地址]()
12 |
13 |
14 |
15 |
18 |
22 |
26 |
30 |
34 |
38 |
43 |
44 | {{currImgIndex}} / {{imgList.length ? imgList.length : 1}}
45 |
46 |
47 |
48 | {{currImgIndex}} / {{imgList.length ? imgList.length : 1}}
49 |
50 |
51 | 图片加载失败
52 |
53 |
54 |
55 |
56 |
142 |
143 |
207 |
--------------------------------------------------------------------------------
/src/components/search/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
70 |
71 |
99 |
--------------------------------------------------------------------------------
/src/components/toast/main.js:
--------------------------------------------------------------------------------
1 | // main.js
2 | import Vue from "vue"; // 引入 Vue 是因为要用到 Vue.extend() 这个方法
3 | import Main from "./main.vue"; // 引入刚才的 toast 组件
4 |
5 | let ToastConstructor = Vue.extend(Main); // 这个在前面的前置知识内容里面有讲到
6 | let instance;
7 |
8 | const Toast = function (options = {}) {
9 | instance = new ToastConstructor({
10 | data: options
11 | }).$mount(); // 渲染组件
12 | document.body.appendChild(instance.$el); // 挂载到 body 下
13 | };
14 | ["success", "error"].forEach(type => {
15 | Toast[type] = options => {
16 | options.type = type
17 | return Toast(options)
18 | }
19 | })
20 |
21 | export default Toast;
22 |
--------------------------------------------------------------------------------
/src/components/toast/main.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
25 |
26 |
56 |
57 |
--------------------------------------------------------------------------------
/src/components/todo/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 今日待办 : {{todos.length}}
5 |
6 |
7 |
8 |
46 |
47 |
66 |
--------------------------------------------------------------------------------
/src/components/userProfile/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
17 |
18 |
19 | 昵称:{{ friendInfo.nickname }}
20 | 个性签名:{{ friendInfo.signature === '' ? '这个人很懒,什么都没有留下..': friendInfo.signature }}
21 | 性别:{{ friendInfo.sex === 0 ? "男" : friendInfo.sex === 1 ? "女" : "保密"}}
22 | 年龄:{{ friendInfo.age }}
23 | 省份:{{ friendInfo.province && friendInfo.province.name }}
24 | 城市:{{ friendInfo.city && friendInfo.city.name }}
25 | 城镇:{{ friendInfo.town && friendInfo.town.name }}
26 | 邮箱:{{ friendInfo.email }}
27 |
28 |
29 |
30 |
31 |
32 |
38 |
39 |
40 |
45 |
46 |
47 | 昵称:{{ friendInfo.nickname }}
48 | 个性签名:{{ friendInfo.signature === '' ? '这个人很懒,什么都没有留下..': friendInfo.signature }}
49 | 性别:{{ friendInfo.sex === 0 ? "男" : friendInfo.sex === 1 ? "女" : "保密"}}
50 | 年龄:{{ friendInfo.age }}
51 | 省份:{{ friendInfo.province && friendInfo.province.name }}
52 | 城市:{{ friendInfo.city && friendInfo.city.name }}
53 | 城镇:{{ friendInfo.town && friendInfo.town.name }}
54 | 邮箱:{{ friendInfo.email }}
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
86 |
87 |
154 |
155 |
--------------------------------------------------------------------------------
/src/const/emoji.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": {
3 | "face": ["😀", "😁", "😂", "😃", "😄", "😅", "😆", "😉", "😊", "😋", "😎", "😍", "😘", "😗", "😙", "😚", "😇", "😐", "😑", "😶", "😏", "😣", "😥", "😮", "😯", "😪", "😫", "😴", "😌", "😛", "😜", "😝", "😒", "😓", "😔", "😕", "😲", "😷", "😖", "😞", "😟", "😤", "😢", "😭", "😦", "😧", "😨", "😬", "😰", "😱", "😳", "😵", "😡", "😠", "😈", "👿", "👹", "👺", "💀", "☠", "👻", "👽", "👾", "💣"],
4 | "heart": ["💘", "❤", "💓", "💔", "💕", "💖", "💗", "💙", "💚", "💛", "💜", "💝", "💞", "💟", "❣", "💪", "👈", "👉", "☝", "👆", "👇", "✌", "✋", "👌", "👍", "👎", "✊", "👊", "👋", "👏", "👐", "✍"],
5 | "food": ["🍇", "🍈", "🍉", "🍊", "🍋", "🍌", "🍍", "🍎", "🍏", "🍐", "🍑", "🍒", "🍓", "🍅", "🍆", "🌽", "🍄", "🌰", "🍞", "🍖", "🍗", "🍔", "🍟", "🍕", "🍳", "🍲", "🍱", "🍘", "🍙", "🍚", "🍛", "🍜", "🍝", "🍠", "🍢", "🍣", "🍤", "🍥", "🍡", "🍦", "🍧", "🍨", "🍩", "🍪", "🎂", "🍰", "🍫", "🍬", "🍭"],
6 | "drink": ["🍮", "🍯", "🍼", "☕", "🍵", "🍶", "🍷", "🍸", "🍹", "🍺", "🍻", "🍴", "🌹", "🍀", "🍎", "💰", "📱", "🌙", "🍁", "🍂", "🍃", "🌷", "💎", "🔪", "🔫", "🏀", "⚽", "⚡", "👄", "👍", "🔥"],
7 | "animal": ["🙈", "🙉", "🙊", "🐵", "🐒", "🐶", "🐕", "🐩", "🐺", "🐱", "😺", "😸", "😹", "😻", "😼", "😽", "🙀", "😿", "😾", "🐈", "🐯", "🐅", "🐆", "🐴", "🐎", "🐮", "🐂", "🐃", "🐄", "🐷", "🐖", "🐗", "🐽", "🐏", "🐑", "🐐", "🐪", "🐫", "🐘", "🐭", "🐁", "🐀", "🐹", "🐰", "🐇", "🐻", "🐨", "🐼", "🐾", "🐔", "🐓", "🐣", "🐤", "🐥", "🐦", "🐧", "🐸", "🐊", "🐢", "🐍", "🐲", "🐉", "🐳", "🐋", "🐬", "🐟", "🐠", "🐡", "🐙", "🐚", "🐌", "🐛", "🐜", "🐝", "🐞", "🦋"]
8 | }
9 | }
--------------------------------------------------------------------------------
/src/const/index.js:
--------------------------------------------------------------------------------
1 | export const conversationTypes = {
2 | friend: 'FRIEND',
3 | group: 'GROUP'
4 | }
5 |
6 | export const APP_VERSION = '1.0.0'
7 |
8 | // 在添加好友或者群聊时对应的搜索条件
9 | export const searchObjectMap = [
10 | {id: 1, label: '人', value: 'friend'},
11 | {id: 2, label: '群', value: 'group'}
12 | ]
13 |
14 | export const searchTypes = {
15 | friend: [
16 | {id: 1, label: 'Chat账号', value: 'code'},
17 | {id: 2, label: '用户账号', value: 'username'},
18 | {id: 3, label: '昵称', value: 'nickname'}
19 | ],
20 | group: [
21 | {id: 1, label: 'Chat账号', value: 'code'},
22 | {id: 2, label: '名称', value: 'title'}
23 | ]
24 | }
25 |
26 | export const validateNewsTips = {
27 | applyFriend: '请求添加你为好友',
28 | applyGroup: '请求加入群聊'
29 | }
30 |
31 | // 上传文件时的状态
32 | export const uploadStatusMap = {
33 | error: 'error',
34 | next: 'next',
35 | complete: 'complete'
36 | }
37 |
38 | // 在CoArtBoard组件中对调色板的操作
39 | export const coArtBoardHandleOption = [
40 | {name: "圆", type: "arc"},
41 | {name: "线条", type: "line"},
42 | {name: "矩形", type: "rect"},
43 | {name: "多边形", type: "polygon"},
44 | {name: "橡皮擦", type: "eraser"},
45 | {name: "撤回", type: "cancel"},
46 | {name: "前进", type: "go"},
47 | {name: "清屏", type: "clear"},
48 | {name: "线宽", type: "lineWidth"},
49 | {name: "颜色", type: "color"}
50 | ]
51 |
52 | export const coArtBoardReplyTypes = {
53 | agree: 'agree',
54 | disagree: 'disagree',
55 | busy: 'busy',
56 | }
57 |
58 | export const weatherMap = {
59 | "阴": 'icon-tianqi',
60 | "多云": 'icon-tianqi1',
61 | "晴": 'icon-ziyuan',
62 | "小雨下雨": 'icon-n1'
63 | }
64 |
65 | export const weekNumZHMap = {
66 | "0": '星期天',
67 | "1": '星期一',
68 | "2": '星期二',
69 | "3": '星期三',
70 | "4": '星期四',
71 | "5": '星期五',
72 | "6": '星期六',
73 | }
74 |
75 | export const WEB_RTC_MSG_TYPE = {
76 | artBoard: 'artBoard',
77 | video: 'video',
78 | audio: 'audio'
79 | }
80 |
81 | export const MSG_TYPES = {
82 | ...WEB_RTC_MSG_TYPE,
83 | sys: 'sys',
84 | text: 'text',
85 | img: 'img',
86 | file: 'file'
87 | }
88 |
--------------------------------------------------------------------------------
/src/directives/index.js:
--------------------------------------------------------------------------------
1 | import {Message} from 'element-ui'
2 |
3 | const IMG_URL = process.env.IMG_URL
4 | export default {
5 | watchMouse: { // v-watchMouse="flag"
6 | update: function (el, binding, vnode) {
7 | let watchMouse = (e) => {
8 | if (!el.contains(e.target) || (el.contains(e.target) && !binding.value)) {
9 | document.documentElement.removeEventListener('click', watchMouse);
10 | binding.value = false;
11 | }
12 | };
13 | if (binding.value) {
14 | document.documentElement.addEventListener('click', watchMouse)
15 | }
16 | }
17 | },
18 | /**
19 | * 为元素设置行内CSS样式
20 | * @param {HTMLDataElement} el
21 | * @param {Object} binding binding的value也是是一个对象如:{width: 100px, height: 20px}
22 | */
23 | css(el, binding) {
24 | const {value} = binding
25 | const valueEntries = Object.entries(value)
26 | for (const [key, value] of valueEntries) {
27 | el.style[key] = value
28 | if (key === 'background-image' || key === 'backgroundImage') {
29 | el.style.backgroundRepeat = 'no-repeat'
30 | el.style.backgroundSize = 'cover'
31 | }
32 | }
33 | },
34 | bgImage(el, binding) {
35 | el.style.backgroundImage = `url(${IMG_URL}${binding.value})`
36 | el.style.backgroundRepeat = 'no-repeat'
37 | el.style.backgroundSize = 'cover'
38 | el.style.backgroundPosition = 'center'
39 | },
40 | copy: {
41 | bind(el, {value}) {
42 | el.$value = value
43 | el.handler = () => {
44 | if (!el.$value) {
45 | return
46 | }
47 | const textarea = document.createElement('textarea')
48 | textarea.readOnly = 'readonly'
49 | textarea.style.position = 'absolute'
50 | textarea.style.left = '-9999px'
51 | textarea.value = el.$value
52 | document.body.appendChild(textarea)
53 | textarea.select()
54 | textarea.setSelectionRange(0, textarea.value.length)
55 | const result = document.execCommand('Copy')
56 | if (result) {
57 | Message.success('复制成功!')
58 | }
59 | document.body.removeChild(textarea)
60 | }
61 | el.addEventListener('click', el.handler)
62 | },
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | // The Vue build version to load with the `import` command
2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3 | import Vue from 'vue'
4 | import ElementUI from 'element-ui'
5 | import 'element-ui/lib/theme-chalk/index.css'
6 | import VueSocketIO from 'vue-socket.io'
7 | import ClientSocketIO from 'socket.io-client'
8 | import 'normalize.css/normalize.css'
9 | import App from './App'
10 | import router from './router'
11 | import Toast from './components/toast/main.js'
12 | import axios from './api'
13 | import store from './store'
14 | import directives from './directives'
15 | import './../static/css/base.scss'
16 | import './../static/css/var.scss'
17 | import './../static/css/theme.scss'
18 |
19 | let fullCalendar = require('./libs/fullCalendar/fullCalendar');
20 |
21 | Vue.use(ElementUI)
22 | Vue.component('full-calendar', fullCalendar.VueFullcalendar)
23 |
24 | // socket连接
25 | Vue.use(new VueSocketIO({
26 | // debug: true,
27 | connection: ClientSocketIO.connect(process.env.SOCKET_URL, {
28 | transports: ['websocket']
29 | }),
30 | }))
31 |
32 | // 注册全局指令
33 | Object.keys(directives).forEach(i => Vue.directive(i, directives[i]))
34 |
35 | Vue.config.productionTip = false
36 | Vue.prototype.$toast = Toast
37 | Vue.prototype.$http = axios
38 | Vue.prototype.$eventBus = new Vue()
39 |
40 | /* eslint-disable no-new */
41 | new Vue({
42 | el: '#app',
43 | router,
44 | store,
45 | render: h => h(App)
46 | }).$mount('#app')
47 |
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Router from 'vue-router'
3 | import store from './../store'
4 |
5 | Vue.use(Router)
6 |
7 | const router = new Router({
8 | mode: 'history',
9 | // base: '/frontend/', //编译打包时才去掉这个注释,配置 nginx 访问相对路径的目录文件夹
10 | routes: [
11 | {
12 | path: '/',
13 | redirect: '/chat',
14 | meta: {
15 | requiresAuth: true
16 | }
17 | },
18 | {
19 | path: '/login',
20 | name: 'Login',
21 | component: () => import("@/views/Login"),
22 | meta: {
23 | deepth: 0.5
24 | }
25 | },
26 | {
27 | path: '/chat',
28 | name: 'Layout',
29 | component: () => import('@/views/layout'),
30 | redirect: '/chat/home',
31 | meta: {
32 | requiresAuth: true,
33 | keepAlive: true
34 | },
35 | children: [
36 | {
37 | path: 'home',
38 | name: 'Home',
39 | component: () => import('@/views/Index'),
40 | meta: {
41 | requiresAuth: true,
42 | keepAlive: true,
43 | deepth: 1
44 | },
45 | },
46 | {
47 | path: 'add',
48 | name: 'Add',
49 | component: () => import('@/views/Add'),
50 | meta: {
51 | requiresAuth: true
52 | },
53 | },
54 | {
55 | path: 'setting',
56 | name: 'Setting',
57 | component: () => import('@/views/Setting'),
58 | meta: {
59 | requiresAuth: true
60 | },
61 | },
62 | {
63 | path: 'system',
64 | name: 'System',
65 | component: () => import('@/views/SystemNews'),
66 | meta: {
67 | requiresAuth: true
68 | },
69 | },
70 | {
71 | path: 'schedule',
72 | name: 'Schedule',
73 | component: () => import('@/views/Schedule'),
74 | meta: {
75 | requiresAuth: true
76 | },
77 | },
78 | ]
79 | },
80 | {
81 | path: '*',
82 | name: 'NotFound',
83 | component: () => import('@/views/404')
84 | }
85 | ]
86 | })
87 |
88 |
89 | router.beforeEach((to, from, next) => {
90 | /**tips:需要在钩子函数内读取登录状态 */
91 | const userIsLogin = store.state.user.isLogin
92 | if (to.meta.requiresAuth) {
93 | if (userIsLogin) {
94 | next()
95 | } else {
96 | // alert('请先登录再进行此操作!')
97 | next({
98 | path: '/login',
99 | /** 将刚刚要去的路由path(却无权限)作为参数,方便登录成功后直接跳转到该路由 */
100 | query: {redirect: to.fullPath}
101 | })
102 | }
103 | } else {
104 | next()
105 | }
106 | })
107 |
108 | export default router
109 |
--------------------------------------------------------------------------------
/src/store/constants.js:
--------------------------------------------------------------------------------
1 | export const SET_UNREAD_NEWS_TYPE_MAP = {
2 | add: 'ADD',
3 | clear: 'CLEAR',
4 | replace: 'REPLACE'
5 | }
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueX from 'vuex'
3 |
4 | import user from './modules/user'
5 | import news from './modules/news'
6 | import app from './modules/app'
7 | import theme from './modules/theme'
8 | import device from './modules/device'
9 |
10 | Vue.use(VueX)
11 |
12 | export default new VueX.Store({
13 | modules: {
14 | user,
15 | news,
16 | app,
17 | theme,
18 | device
19 | }
20 | })
21 |
--------------------------------------------------------------------------------
/src/store/modules/app.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | sysUsers: '' || JSON.parse(window.localStorage.getItem('sysUsers')),
3 | isToCoArtBoard: false, // 是否在白板协作
4 | isVideoing: false, //是否正在视频通话
5 | isAudioing: false, //是否正在语音通话
6 | currentConversation: {}, // 当前的会话,在白板协作、音视频通话会使用
7 | agreeFriendValidate: false, // 同意好友申请
8 | recentConversation: [], // 最近的会话列表
9 | onlineUser: [], // 在线用户
10 | allConversation: [], // 所有会话
11 | allFriends: [], // 所有的好友
12 | }
13 |
14 | const mutations = {
15 | setSysUsers(state, data) {
16 | state.sysUsers = data
17 | const dataStr = JSON.stringify(data)
18 | // console.log("store下的系统用户为:", dataStr)
19 | window.localStorage.setItem('sysUsers', dataStr)
20 | },
21 | setIsToCoArtBoard(state, data) {
22 | state.isToCoArtBoard = data
23 | },
24 | setIsAudioing(state, data) {
25 | state.isAudioing = data
26 | },
27 | setIsVideoing(state, data) {
28 | state.isVideoing = data
29 | },
30 | setCurrentConversation(state, data) {
31 | state.currentConversation = data
32 | },
33 | setAgreeFriendValidate(state, data) {
34 | state.agreeFriendValidate = data
35 | },
36 | setRecentConversation(state, data) {
37 | const res = data.data
38 | // console.log("vuex全局保存最近会话列表信息:", res, "其类型为:", data.type)
39 | // console.log("当前全局会话列表信息为:", state.recentConversation)
40 | if (data.type === 'init') {
41 | state.recentConversation = res
42 | } else if (data.type === 'add') {
43 | // console.log("vuex全局保存最近会话列表信息:", state.recentConversation)
44 | const ids = state.recentConversation.map(item => item.id)
45 | const newData = !ids.includes(res.id) ? [...state.recentConversation, res] : [...state.recentConversation] //判断是否重复
46 | // console.log("vuex全局保存最近会话列表信息(add):", newData)
47 | state.recentConversation = newData
48 | } else if (data.type === 'delete') {
49 | const newData = JSON.parse(JSON.stringify(state.recentConversation))
50 | let index;
51 | if (res.groupInfo && res.groupInfo.gid) { //若是群聊,则根据roomId来过滤
52 | index = state.recentConversation.findIndex(item => item.roomId === res.roomId)
53 | } else {
54 | index = state.recentConversation.findIndex(item => item.id === res.id)
55 | }
56 | index !== -1 && newData.splice(index, 1)
57 | // console.log("待删除的会话在全局最近会话列表中的位置为:", index)
58 | // console.log("vuex全局保存最近会话列表信息(delete):", newData)
59 | state.recentConversation = newData
60 | }
61 | },
62 | setOnlineUser(state, data) {
63 | state.onlineUser = data
64 | },
65 | setAllConversation(state, data) {
66 | state.allConversation = [...state.allConversation, ...data]
67 | // console.log("所有会话为:", state.allConversation)
68 | },
69 | setAllFriends(state, data) {
70 | const {resource, type} = data
71 | // console.log("setAllFriends:", resource, "type:", type)
72 | if (type === 'init') {
73 | // resourece === [{...}, {...}, ...]
74 | state.allFriends = resource
75 | } else if (type === 'delete') { //删除的时候resource带的是好友id
76 | // resource === 删除被好友ID
77 | state.allFriends = (state.allFriends || []).filter(item => item.id !== resource)
78 | }
79 | }
80 | }
81 |
82 | const actions = {
83 | SET_SYS_USERS({commit}, data) {
84 | commit('setSysUsers', data)
85 | },
86 | SET_ISTOCOARTBOARD({commit}, data) {
87 | commit('setIsToCoArtBoard', data)
88 | },
89 | SET_IS_AUDIOING({commit}, data) {
90 | commit('setIsAudioing', data)
91 | },
92 | SET_IS_VIDEOING({commit}, data) {
93 | commit('setIsVideoing', data)
94 | },
95 | SET_CURRENT_CONVERSATION({commit}, data) {
96 | commit('setCurrentConversation', data)
97 | },
98 | SET_AGREE_FRIEND_VALIDATE({commit}, data) {
99 | commit('setAgreeFriendValidate', data)
100 | },
101 | SET_RECENT_CONVERSATION({commit}, data) {
102 | commit('setRecentConversation', data)
103 | },
104 | SET_ONLINE_USER({commit}, data) {
105 | commit('setOnlineUser', data)
106 | },
107 | SET_ALL_CONVERSATION({commit}, data) {
108 | commit('setAllConversation', data)
109 | },
110 | SET_ALL_FRIENDS({commit}, data) {
111 | commit('setAllFriends', data)
112 | }
113 | }
114 |
115 | export default {
116 | namespaced: true,
117 | state,
118 | mutations,
119 | actions
120 | }
121 |
--------------------------------------------------------------------------------
/src/store/modules/device.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 设备信息查询
3 | */
4 | import {getDeviceType, findParentNode} from '@/utils'
5 |
6 | const deviceMap = {
7 | Desktop: 'Desktop',
8 | Mobile: 'Mobile'
9 | }
10 |
11 | const _registerEvent = () => {
12 | document.addEventListener('click', (e) => {
13 | // conversation-list
14 | const conversationList = findParentNode(e.target, 'conversation-list')
15 | // conversationitem__cmp active
16 | const conversationItem = findParentNode(e.target, 'conversationitem__cmp')
17 | /**同时会话进入聊天区域 */
18 | if (conversationItem && conversationList) {
19 | state.currentUI = UIMap.chatArea
20 | }
21 | })
22 | }
23 |
24 | const _initCSS = () => {
25 | const style = document.createElement('style')
26 | style.setAttribute('device', 'mobile')
27 | style.innerText = `.el-message-box {width: auto} !important;`
28 | const head = document.querySelector('head')
29 | head.appendChild(style)
30 | }
31 |
32 | /**
33 | * 针对移动端设备下,【会话列表】和【聊天区域】等...不可以同时出现的情况
34 | */
35 | const UIMap = {
36 | conversation: 'conversation',
37 | chatArea: 'chatArea'
38 | }
39 |
40 | const state = {
41 | deviceType: deviceMap[getDeviceType()],
42 | currentUI: UIMap.conversation
43 | }
44 |
45 | if (state.deviceType === deviceMap.Mobile) {
46 | _registerEvent()
47 | _initCSS()
48 | }
49 |
50 | const mutations = {
51 | setCurrentUI(state, data) {
52 | state.currentUI = data
53 | }
54 | }
55 |
56 | const actions = {
57 | SET_CURRENT_UI({commit}, data) {
58 | commit('setCurrentUI', data)
59 | }
60 | }
61 |
62 | export default {
63 | namespaced: true,
64 | state,
65 | mutations,
66 | actions
67 | }
68 |
--------------------------------------------------------------------------------
/src/store/modules/news.js:
--------------------------------------------------------------------------------
1 | // const localData = window.localStorage.getItem('unreadnewslist')
2 | // const initState = localData ? JSON.parse(localData) : []
3 | /**
4 | * unreadNewsList: {roomId: count1, roomId: count2, ...}
5 | */
6 | import {SET_UNREAD_NEWS_TYPE_MAP} from './../constants'
7 |
8 | const state = {
9 | unreadNews: {},
10 | lastNews: {}, // 好友之间最后发送的一条消息 {roomId1: {}, roomId2: {}}
11 | userIsReadMsg: { // 好友是否已读你发送的消息
12 | }
13 | }
14 |
15 | /**
16 | * 提交data的格式:{roomId: '标识消息对应的房间id', count: '标识未读数', type: 'ADD\CLEAR\REPLACE'}
17 | */
18 | const mutations = {
19 | setUnreadNews(state, data) {
20 | const {roomId, count, type} = data
21 | // console.log("设置未读消息:", data, "其类型为:", type, "数量为:", count)
22 | if (type === SET_UNREAD_NEWS_TYPE_MAP.add) { //未读消息加1
23 | const oldCount = state.unreadNews[roomId] === undefined ? 0 : state.unreadNews[roomId]
24 | const item = {[roomId]: oldCount + 1}
25 | state.unreadNews = Object.assign({}, state.unreadNews, item)
26 | } else if (type === SET_UNREAD_NEWS_TYPE_MAP.clear) { //清除未读消息
27 | const item = {[roomId]: 0}
28 | state.unreadNews = Object.assign({}, state.unreadNews, item)
29 | } else { //其余情况,默认 roomId -> count
30 | const item = {[roomId]: count}
31 | state.unreadNews = Object.assign({}, state.unreadNews, item)
32 | }
33 | },
34 | setLastNews(state, data) {
35 | // console.log("设置最后一条信息:", data.res, "其类型为:", data.type)
36 | if (data.type === 'init') {
37 | state.lastNews = data.res
38 | } else if (data.type === 'concat') {
39 | state.lastNews = Object.assign({}, state.lastNews, data.res)
40 | } else if (data.type === 'edit') {
41 | const {roomId, news} = data.res
42 | const item = {[roomId]: news}
43 | state.lastNews = Object.assign({}, state.lastNews, item)
44 | } else if (data.type === 'default') { // 判断是否为新添加的会话
45 | const {roomId} = data
46 | if (roomId in state.lastNews) return
47 | const item = {[roomId]: {time: Date.now(), messageType: 'text', message: ''}}
48 | state.lastNews = Object.assign({}, state.lastNews, item)
49 | }
50 | },
51 | setUserIsReadMsg(state, data) {
52 | const {roomId, status} = data
53 | const newData = {...state.userIsReadMsg} || {}
54 | for (const key in newData) {
55 | if (newData.hasOwnProperty(key)) {
56 | newData[key] = false
57 | }
58 | }
59 | // console.log("全局设置用户已读消息:", newData)
60 | newData[roomId] = status
61 | state.userIsReadMsg = newData
62 | }
63 | }
64 |
65 | const actions = {
66 | SET_UNREAD_NEWS({commit}, data) {
67 | commit('setUnreadNews', data)
68 | },
69 | SET_LAST_NEWS({commit}, data) {
70 | commit('setLastNews', data)
71 | },
72 | SET_USER_IS_READ_MSG({commit}, data) {
73 | commit('setUserIsReadMsg', data)
74 | }
75 | }
76 |
77 | export default {
78 | namespaced: true,
79 | state,
80 | mutations,
81 | actions
82 | }
83 |
--------------------------------------------------------------------------------
/src/store/modules/theme.js:
--------------------------------------------------------------------------------
1 | import {LocalStorageManager, colorRgb} from '@/utils'
2 | import {colorHexReg} from '@/utils/reg'
3 |
4 | const localStorageManager = new LocalStorageManager()
5 |
6 | /**
7 | * 初始化系统的主题CSS变量
8 | * @param {String} color 文字颜色 16进制
9 | * @param {String} bgColor 背景颜色 16进制
10 | */
11 | const _initThemeCSSVariable = (color, bgColor) => {
12 | if (!colorHexReg.test(color) || !colorHexReg.test(bgColor)) {
13 | return
14 | }
15 | let CSSVar = ''
16 | color = colorRgb(color)
17 | bgColor = colorRgb(bgColor)
18 | for (let i = 1; i <= 10; i++) {
19 | CSSVar += `--primary-color-${i}: rgba(${color.r}, ${color.g}, ${color.b}, ${i / 10});`
20 | CSSVar += `--primary-bgcolor-${i}: rgba(${bgColor.r}, ${bgColor.g}, ${bgColor.b}, ${i / 10});`
21 | }
22 | document.documentElement.style.cssText = CSSVar
23 | }
24 |
25 | const state = {
26 | /**透明度 */
27 | opacity: localStorageManager.getJson('theme-opacity') || 0.75,
28 | /**模糊度,filter: blur(10px) */
29 | blur: localStorageManager.getJson('theme-blur') || 10,
30 | /**
31 | * 背景图片,用户上传的图片会转为base64存在localStorage中
32 | * 系统默认的有abstract.jpg\city.jpg\ocean.jpg
33 | * 区分系统自带和用户自定义判断是否包含base64
34 | * */
35 | //背景种类名称,若是自定义,则为 customBgImgUrl
36 | bgImg: localStorageManager.getStr('theme-bgimg') || 'abstract',
37 | notifySound: localStorageManager.getStr('theme-notifysound') || 'default',
38 | // isNotifySound: localStorageManager.get('theme-blur') || 10
39 | /**字体颜色 #000 */
40 | color: localStorageManager.getStr('theme-color') || '#000',
41 | /**背景颜色 #fff */
42 | bgColor: localStorageManager.getStr('theme-bgcolor') || '#fff',
43 | /**自定义的背景图访问链接 */
44 | customBgImgUrl: localStorageManager.getStr('theme-custombgimgurl') || ''
45 | }
46 |
47 | _initThemeCSSVariable(state.color, state.bgColor)
48 |
49 | const mutations = {
50 | setOpacity(state, value) {
51 | localStorageManager.set('theme-opacity', value)
52 | state.opacity = value
53 | },
54 | setBlur(state, value) {
55 | localStorageManager.set('theme-blur', value)
56 | state.blur = value
57 | },
58 | setBgImg(state, value) {
59 | localStorageManager.set('theme-bgimg', value)
60 | state.bgImg = value
61 | },
62 | setNotifySound(state, value) {
63 | localStorageManager.set('theme-notifysound', value)
64 | state.notifySound = value
65 | },
66 | setColor(state, value) {
67 | localStorageManager.set('theme-color', value)
68 | state.color = value
69 | _initThemeCSSVariable(state.color, state.bgColor)
70 | },
71 | setBgColor(state, value) {
72 | localStorageManager.set('theme-bgcolor', value)
73 | state.bgColor = value
74 | _initThemeCSSVariable(state.color, state.bgColor)
75 | },
76 | setCustomBgImgUrl(state, value) {
77 | localStorageManager.set('theme-custombgimgurl', value)
78 | state.customBgImgUrl = value
79 | }
80 | }
81 |
82 | const actions = {
83 | SET_OPACITY({commit}, value) {
84 | commit('setOpacity', value)
85 | },
86 | SET_BLUR({commit}, value) {
87 | commit('setBlur', value)
88 | },
89 | SET_BG_IMG({commit}, value) {
90 | commit('setBgImg', value)
91 | },
92 | SET_NOTIFY_SOUND({commit}, value) {
93 | commit('setNotifySound', value)
94 | },
95 | SET_COLOR({commit}, value) {
96 | commit('setColor', value)
97 | },
98 | SET_BG_COLOR({commit}, value) {
99 | commit('setBgColor', value)
100 | },
101 | SET_CUSTOM_BG_IMG_URL({commit}, value) {
102 | commit('setCustomBgImgUrl', value)
103 | }
104 | }
105 |
106 | export default {
107 | namespaced: true,
108 | state,
109 | mutations,
110 | actions
111 | }
112 |
--------------------------------------------------------------------------------
/src/store/modules/user.js:
--------------------------------------------------------------------------------
1 |
2 | const state = {
3 | isLogin: JSON.parse(window.sessionStorage.getItem('isLogin') || "false"),
4 | userInfo: JSON.parse(window.localStorage.getItem('userInfo') || '{}')
5 | }
6 |
7 | const mutations = {
8 | login(state, data) {
9 | state.isLogin = true
10 | state.userInfo = data
11 | let dataString = JSON.stringify(data)
12 | // console.log("存放在store的用户信息为:", dataString)
13 | window.localStorage.setItem('userInfo', dataString)
14 | window.sessionStorage.setItem('isLogin', true)
15 | },
16 | logout(state) {
17 | state.isLogin = false
18 | state.userInfo = ''
19 | window.localStorage.setItem('userInfo', '')
20 | window.sessionStorage.setItem('isLogin', false)
21 | }
22 | }
23 |
24 | const actions = {
25 | LOGIN({commit}, data) {
26 | commit('login', data)
27 | },
28 | LOGOUT({commit}, data) {
29 | commit('logout', data)
30 | }
31 | }
32 |
33 | export default {
34 | namespaced: true,
35 | state,
36 | mutations,
37 | actions
38 | }
39 |
--------------------------------------------------------------------------------
/src/utils/cvcode.js:
--------------------------------------------------------------------------------
1 | // 生成验证码
2 | export function createCanvas(value, dom, imgUrl, loadedCb) {
3 | const tempArr = value.split('')
4 | const canvasStr = tempArr.join(' ')
5 | const canvas = dom
6 | const ctx = canvas.getContext('2d')
7 | const x = canvas.width / 2
8 | const oImg = new Image()
9 | oImg.src = imgUrl
10 | oImg.width = 120
11 | oImg.width = 40
12 | oImg.onload = function () {
13 | loadedCb && typeof (loadedCb) === 'function' && loadedCb()
14 | const pattern = ctx.createPattern(oImg, 'repeat');//在指定的方向内重复指定的元素
15 | ctx.fillStyle = pattern;//填充绘画的颜色
16 | ctx.fillRect(0, 0, canvas.width, canvas.height);
17 | ctx.textAlign = 'center';
18 | ctx.fillStyle = ' #DC143C';
19 | ctx.font = '26px Roboto Slab';
20 | ctx.setTransform(1, -0.12, 0.2, 1, 0, 0);
21 | ctx.fillText(canvasStr, x, 40);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/utils/reg.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 1. 正则表达式
3 | * 2. 验证信息
4 | */
5 |
6 | export const validateNickname = (rule, value, callback) => {
7 | if (value === "") {
8 | callback();
9 | } else {
10 | if (value.length > 12) {
11 | callback(new Error("请输入不超过12位字符"));
12 | return;
13 | }
14 | callback();
15 | }
16 | }
17 | export const validatePhone = (rule, value, callback) => {
18 | if (value === "") {
19 | callback();
20 | } else {
21 | let reg = /^1[3|4|5|7|8]\d{9}$/;
22 | if (!reg.test(value)) {
23 | callback(new Error("请输入正确的手机格式!"));
24 | return;
25 | }
26 | callback();
27 | }
28 | }
29 | export const validateEmail = (rule, value, callback) => {
30 | if (value === "") {
31 | callback();
32 | } else {
33 | let reg = /^[A-Za-z0-9._%-]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2,4}$/;
34 | if (!reg.test(value)) {
35 | callback(new Error("请输入正确的邮箱格式!"));
36 | return;
37 | }
38 | callback();
39 | }
40 | }
41 | export const validateSignature = (rule, value, callback) => {
42 | if (value === "") {
43 | callback();
44 | } else {
45 | if (value.length > 100) {
46 | callback(new Error("请输入不超过100位字符"));
47 | return;
48 | }
49 | callback();
50 | }
51 | }
52 |
53 | /**16进制颜色 */
54 | export const colorHexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
55 |
--------------------------------------------------------------------------------
/src/utils/request.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 | import {Message} from 'element-ui'
3 | import {isProduction} from './index'
4 | import router from './../router'
5 | import {getCookie, setCookie, removeCookie} from './token'
6 |
7 | let instance = axios.create({
8 | timeout: 700000,
9 | baseURL: '/'
10 | })
11 |
12 | instance.interceptors.request.use(
13 | config => {
14 | const token = getCookie()
15 | if (token) {
16 | config.headers.Authorization = token
17 | }
18 | return config
19 | },
20 | err => {
21 | Promise.reject(err)
22 | }
23 | )
24 |
25 | // 成功:2000,失败(无数据):2001,未登录:2002,服务端错误:2003
26 | // 登录成功:1000,登录失败(账号或密码错误):1001,验证码错误:1002
27 | // 用户已被注册:1003,注册失败:1004,注册成功:1005,用户验证过期:1006
28 | // 验证码过期:1007,非法登录(token无效,解析异常):1009
29 | instance.interceptors.response.use(
30 | response => {
31 | if (response.data.code === 1000) {
32 | setCookie(response.data.data.token)
33 | }
34 | if (response.data.code === 2002) { // 未登录
35 | Message({
36 | message: '请先登录',
37 | type: 'warning',
38 | duration: 3000
39 | })
40 | router.push('/login')
41 | } else if (response.data.code === 2003) {
42 | Message({
43 | message: '服务端错误,请稍后重试',
44 | type: 'error',
45 | duration: 3000
46 | })
47 | } else if (response.data.code === 1006) {
48 | Message({
49 | message: '登录过期',
50 | type: 'warning',
51 | duration: 3000
52 | })
53 | removeCookie()
54 | router.push('/login')
55 | } else if (response.data.code === 1007) {
56 | Message({
57 | message: '验证码过期!',
58 | type: 'warning',
59 | duration: 3000
60 | })
61 | } else if (response.data.code === 1009) {
62 | Message({
63 | message: '非法登录,请注意规范!',
64 | type: 'error',
65 | duration: 3000
66 | })
67 | }
68 | return response
69 | },
70 | error => {
71 | console.log('请求错误', error)
72 | Message({
73 | message: '网络超时!',
74 | type: 'error',
75 | duration: 3000
76 | })
77 | return Promise.reject(error)
78 | }
79 | )
80 |
81 | export default instance
82 |
--------------------------------------------------------------------------------
/src/utils/token.js:
--------------------------------------------------------------------------------
1 | import Cookies from 'js-cookie'
2 |
3 | const authorization = "authorization"
4 |
5 | export const setCookie = (token) => {
6 | Cookies.set(authorization, token)
7 | }
8 |
9 | export const getCookie = () => {
10 | return Cookies.get(authorization)
11 | }
12 |
13 | export const removeCookie = () => {
14 | return Cookies.remove(authorization)
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/xss.js:
--------------------------------------------------------------------------------
1 | import xss from 'xss'
2 |
3 | const myXSS = new xss.FilterXSS({
4 | whiteList: {}
5 | })
6 |
7 | export default function processXSS(text) {
8 | return myXSS.process(text)
9 | }
10 |
--------------------------------------------------------------------------------
/src/views/404.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
页面走丢了(╯-_-),访问其他页面试试吧(ง •̀_•́)ง
4 |
返回上一级
5 |
6 |
7 |
8 |
60 |
61 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/src/views/Index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
12 |
13 |
14 |
15 |
18 |
23 |
24 |
25 |
聊天~打开心灵的窗户
26 |
27 |
28 |
29 |
30 |
31 |
32 |
129 |
130 |
165 |
--------------------------------------------------------------------------------
/src/views/SystemNews.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
58 |
59 |
71 |
--------------------------------------------------------------------------------
/src/views/chat/components/GroupDesc.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 富强、民主、文明、和谐、自由、平等、公正、法治,倡导爱国、敬业、诚信、友善
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
47 |
48 |
64 |
--------------------------------------------------------------------------------
/src/views/chat/components/HistoryMsg.vue:
--------------------------------------------------------------------------------
1 |
2 |
56 |
57 |
58 |
151 |
152 |
202 |
--------------------------------------------------------------------------------
/src/views/chat/components/HistoryMsgItem.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
![]()
10 |
11 |

12 |
13 | {{msgItem.fileRawName.lastIndexOf('.') > 12 ? msgItem.fileRawName.slice(0, 12) +
14 | '...' + msgItem.fileRawName.slice(msgItem.fileRawName.lastIndexOf('.')) : msgItem.fileRawName}}
15 |
16 | 下载
17 |
18 |
19 |
20 |
21 |
{{msgItem.message}}
22 |
23 |
24 |
29 |
30 |
31 |
32 |
33 |
85 |
86 |
144 |
--------------------------------------------------------------------------------
/src/views/chat/components/MessageList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 点击加载更多...
7 |
8 |
9 | 没有更多了~
10 |
11 |
12 |
13 |
14 |
15 |
23 |
24 |
25 |
26 |
27 |
28 |
105 |
106 |
120 |
121 |
--------------------------------------------------------------------------------
/src/views/chat/components/settingPanel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 切换分组
8 | 修改备注
13 |
14 |
15 |
16 |
17 | 查看群资料
21 |
25 | {{ isHolderMsg }}
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
111 |
112 |
130 |
131 |
--------------------------------------------------------------------------------
/src/views/chat/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
28 |
29 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/views/conversation/FenzuMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 | 删除后分组下的好友会自动添加到【我的好友】,确认删除?
7 |
8 | 取消
9 | 确定
10 |
11 |
12 |
13 |
14 |
15 |
16 |
37 |
38 |
50 |
--------------------------------------------------------------------------------
/src/views/conversation/GroupConversation.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
124 |
125 |
140 |
--------------------------------------------------------------------------------
/src/views/conversation/Menu.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | 删除好友后聊天记录等信息也会被删除,是否删除?
12 |
13 | 取消
14 | 确定
15 |
16 |
17 |
18 |
19 |
20 |
21 |
104 |
105 |
121 |
--------------------------------------------------------------------------------
/src/views/conversation/TopSearch.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
36 |
--------------------------------------------------------------------------------
/src/views/layout/components/Aside.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{userInfo.nickname}}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
49 |
50 |
105 |
--------------------------------------------------------------------------------
/src/views/layout/components/operMenu.vue:
--------------------------------------------------------------------------------
1 |
2 |
56 |
57 |
58 |
133 |
134 |
141 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/.gitkeep
--------------------------------------------------------------------------------
/static/audio/apple.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/apple.mp3
--------------------------------------------------------------------------------
/static/audio/default.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/default.mp3
--------------------------------------------------------------------------------
/static/audio/huaji.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/huaji.mp3
--------------------------------------------------------------------------------
/static/audio/mobileqq.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/mobileqq.mp3
--------------------------------------------------------------------------------
/static/audio/momo.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/momo.mp3
--------------------------------------------------------------------------------
/static/audio/notify.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/notify.mp3
--------------------------------------------------------------------------------
/static/audio/pcqq.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wzomg/chatclient/05104c6e8653e19b26eca74a32ba88ff12346910/static/audio/pcqq.mp3
--------------------------------------------------------------------------------
/static/css/animation.scss:
--------------------------------------------------------------------------------
1 |
2 | @mixin fade-in-out($name) {
3 | .#{$name}-enter-active {
4 | transition: all .3s ease;
5 | }
6 | .#{$name}-leave-active {
7 | transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
8 | }
9 | .#{$name}-fade-enter, .#{$name}-fade-leave-to
10 | /* .slide-fade-leave-active for below version 2.1.8 */ {
11 | transform: translateX(10px);
12 | opacity: 0;
13 | }
14 | }
15 |
16 | .roll-enter {
17 | opacity: 0;
18 | transform: translateY(30px);
19 | }
20 |
21 | .roll-leave-to {
22 | opacity: 0;
23 | transform: translateY(-30px)
24 | }
25 |
26 | .roll-enter-active,
27 | .roll-leave-active {
28 | transition: all 0.6s ease;
29 | }
30 |
31 | .hor-scroll-enter {
32 | // position: absolute;
33 | transform: translateX(100px)
34 | }
35 | .hor-scroll-leave-to {
36 | // opacity: 0;
37 | // position: absolute;
38 | transform: translateX(-100px)
39 | }
40 |
41 | .hor-scroll-enter-active,
42 | .hor-scroll-leave-active {
43 | // position: absolute;
44 | transition: all 1s ease-out;
45 | }
46 |
47 | .common-enter {
48 | // position: absolute;
49 | transform: translateX(100px)
50 | }
51 | .common-leave-to {
52 | // opacity: 0;
53 | // position: absolute;
54 | transform: translateX(100px)
55 | }
56 |
57 | .common-enter-active,
58 | .common-leave-active {
59 | // position: absolute;
60 | opacity: 0;
61 | transition: all 1s ease-out;
62 | }
63 |
64 |
65 | // dowm
66 | .slide-down-enter-active { transition: all .4s ease;}
67 | .slide-down-leave-active { transition: all .4s cubic-bezier(1.0, 0.5, 0.8, 1.0);}
68 | .slide-down-enter, .slide-down-leave-active { transform: translateY(20px); opacity: 0;}
69 | .slide-down-move { transition: all .4s;}
70 | .slide-down-leave-active { position: absolute !important; width: 100%;}
71 |
72 | // up
73 | .slide-up-enter-active { transition: all .5s ease .3s;}
74 | .slide-up-leave-active { transition: all .5s ease;}
75 | .slide-up-enter, .slide-up-leave-active{ transform: translateY(-20px); opacity: 0;}
76 | .slide-up-move { transition: all .5s; }
77 |
78 | // left
79 | .slide-left-enter-active { transition: all .5s ease;}
80 | .slide-left-leave-active { transition: all .5s cubic-bezier(.55,0,.1,1);}
81 | .slide-left-enter,{ transform: translateX(20px); opacity: 0;}
82 | .slide-left-leave-active { transform: translateX(20px); opacity: 0;}
83 | .slide-left-move { transition: all .5s;}
84 |
85 | // right
86 | .slide-right-enter-active { transition: all .5s ease;}
87 | .slide-right-leave-active { transition: all .5s cubic-bezier(.55,0,.1,1);}
88 | .slide-right-enter { transform: translateX(-20px); opacity: 0;}
89 | .slide-right-leave-active { transform: translateX(20px); opacity: 0;}
90 | .slide-right-move { transition: all .5s;}
91 |
92 |
93 | // list
94 | .list-enter-active { transition: all .5s ease-in-out;}
95 | .list-leave-active { transition: all .2s ease; opacity: 0;}
96 | .list-enter { transform: translateY(20px); opacity: 0;}
97 | .list-move { transition: all .5s;}
98 | .list-leave-active { position: absolute; width: 100%;}
99 |
100 | // fade
101 | .fade-enter-active, .fade-leave-active { transition: opacity .3s; }
102 | .fade-enter, .fade-leave-active { opacity: 0; }
103 | .fade-move { transition: transform .3s; }
104 | .fade-leave-active { position: absolute; }
105 |
106 | // btn
107 | .btn-enter-active, .btn-leave-active { transition: all .5s; }
108 | .btn-enter, .btn-leave-active { opacity: 0; transform: translateX(30px); }
109 | .btn-move { transition: all .5s; }
110 | .btn-leave-active { position: absolute; }
111 |
112 | .fade-left-enter-active,.fade-right-enter-active{
113 | transition: all .08 ease;
114 | position: absolute;
115 | }
116 | .fade-left-leave-active, .fade-right-leave-active {
117 | transition: all .3s cubic-bezier(1.0, 0.5, 0.8, 1.0);
118 | position: absolute;
119 | }
120 | .fade-left-leave-to, .fade-right-enter{
121 | position: absolute;
122 | transform: translate3d(-50%, 0, 0);
123 | opacity: 0
124 | }
125 | .fade-left-enter, .fade-right-leave-to{
126 | position: absolute;
127 | transform: translate3d(50%, 0, 0);
128 | opacity: 0
129 | }
130 |
--------------------------------------------------------------------------------
/static/css/base.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | min-height: 100%;
3 | width: 100%;
4 | }
5 |
6 | #app {
7 | min-height: 100%;
8 | min-width: 1120px;
9 | }
10 |
11 | * {
12 | box-sizing: border-box;
13 | }
14 |
15 | /* .avatar {
16 | box-sizing: border-box;
17 | margin-right: 20px;
18 | width: 50px;
19 | height: 50px;
20 | border: 1px solid DCDFE6;
21 | border-radius: 50%;
22 | background-color: #ffffff;
23 | background-size: contain;
24 | } */
25 |
26 | .ellipsis{
27 | display: inline-block;
28 | width: 100%;
29 | overflow: hidden;
30 | text-overflow:ellipsis;
31 | white-space: nowrap;
32 | }
33 |
34 | .primary-font {
35 | color: #303133;
36 | font-size: 16px;
37 | }
38 |
39 | .secondary-font {
40 | color: #909399;
41 | font-size: 12px;
42 | }
43 |
44 | .bottom-line {
45 | border-bottom: 1px solid #E4E7ED;
46 | }
47 |
48 | .hor-ver-center {
49 | position: absolute;
50 | top: 50%;
51 | left: 50%;
52 | transform: translate(-50%, -50%);
53 | }
54 |
55 | /* 美化滚动条 */
56 | *::-webkit-scrollbar{
57 | width:4px;
58 | height:4px;
59 | }
60 | *::-webkit-scrollbar-track{
61 | background: #e9ebee;
62 | border-radius:2px;
63 | }
64 | *::-webkit-scrollbar-thumb{
65 | background: #aaa;
66 | border-radius:2px;
67 | }
68 | *::-webkit-scrollbar-thumb:hover{
69 | background: #747474;
70 | }
71 | *::-webkit-scrollbar-corner{
72 | background: #f6f6f6;
73 | }
74 |
75 | /* --lns-color-purple: hsla(230,84%,63%,1);
76 | --lns-color-salmon: hsla(359,98%,68%,1);
77 | --lns-color-green: hsla(149,78%,53%,1);
78 | --lns-color-blue: hsla(201,100%,55%,1);
79 | --lns-color-red: hsla(356,86%,55%,1);
80 | --lns-color-yellow: hsla(40,100%,66%,1);
81 | --lns-color-grey8: hsla(230,11%,19%,1);
82 | --lns-color-grey7: hsla(230,10%,30%,1);
83 | --lns-color-grey6: hsla(230,9%,45%,1);
84 | --lns-color-grey5: hsla(230,8%,60%,1);
85 | --lns-color-grey4: hsla(230,7%,75%,1);
86 | --lns-color-grey3: hsla(230,7%,84%,1);
87 | --lns-color-grey2: hsla(230,7%,92%,1);
88 | --lns-color-grey1: hsla(230,7%,97%,1);
89 | --lns-color-white: hsla(230,7%,100%,1);
90 | --lns-themeLight-color-body: hsla(230,11%,19%,1);
91 | --lns-themeLight-color-bodyDimmed: hsla(230,40%,19%,0.6);
92 | --lns-themeLight-color-background: hsla(230,7%,100%,1);
93 | --lns-themeLight-color-overlay: hsla(230,7%,100%,1);
94 | --lns-themeLight-color-primary: hsla(230,84%,63%,1);
95 | --lns-themeLight-color-focusRing: hsla(230,84%,63%,0.5);
96 | --lns-themeLight-color-border: hsla(230,9%,45%,0.2);
97 | --lns-themeLight-color-disabledContent: hsla(230,8%,60%,1);
98 | --lns-themeLight-color-disabledBackground: hsla(230,7%,92%,1);
99 | --lns-themeLight-color-backdrop: hsla(230,11%,19%,0.5);
100 | --lns-themeLight-color-formFieldBorder: hsla(230,7%,84%,1);
101 | --lns-themeLight-color-formFieldBackground: hsla(230,7%,100%,1);
102 | --lns-themeDark-color-body: hsla(230,7%,97%,1);
103 | --lns-themeDark-color-bodyDimmed: hsla(230,40%,97%,0.6);
104 | --lns-themeDark-color-background: hsla(230,11%,19%,1);
105 | --lns-themeDark-color-overlay: hsla(230,10%,30%,1);
106 | --lns-themeDark-color-primary: hsla(230,84%,63%,1);
107 | --lns-themeDark-color-focusRing: hsla(230,84%,63%,0.5);
108 | --lns-themeDark-color-border: hsla(230,7%,75%,0.2);
109 | --lns-themeDark-color-disabledContent: hsla(230,8%,60%,1);
110 | --lns-themeDark-color-disabledBackground: hsla(230,10%,30%,1);
111 | --lns-themeDark-color-backdrop: hsla(230,11%,19%,0.5);
112 | --lns-themeDark-color-formFieldBorder: hsla(230,9%,45%,1);
113 | --lns-themeDark-color-formFieldBackground: hsla(230,11%,19%,1);
114 | --lns-fontSize-small: 12px;
115 | --lns-lineHeight-small: 18px;
116 | --lns-fontSize-medium: 14px;
117 | --lns-lineHeight-medium: 22px;
118 | --lns-fontSize-large: 18px;
119 | --lns-lineHeight-large: 26px;
120 | --lns-fontSize-xlarge: 22px;
121 | --lns-lineHeight-xlarge: 32px;
122 | --lns-fontSize-xxlarge: 32px;
123 | --lns-lineHeight-xxlarge: 38px;
124 | --lns-fontWeight-normal: 400;
125 | Show All Properties (11 more)
126 | }
127 |