Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
im-demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
eb8fb6f6
authored
Feb 24, 2022
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
readme ad setting
parent
98b45360
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
7 deletions
.gitignore
.vscode/extensions.json
.vscode/settings.json
README.md
src/views/home.vue
.gitignore
View file @
eb8fb6f6
...
@@ -15,7 +15,6 @@ pnpm-debug.log*
...
@@ -15,7 +15,6 @@ pnpm-debug.log*
# Editor directories and files
# Editor directories and files
.idea
.idea
.vscode
*.suo
*.suo
*.ntvs*
*.ntvs*
*.njsproj
*.njsproj
...
...
.vscode/extensions.json
0 → 100644
View file @
eb8fb6f6
{
"recommendations"
:
[
"dbaeumer.vscode-eslint"
,
"esbenp.prettier-vscode"
,
"eamodio.gitlens"
,
"octref.vetur"
]
}
\ No newline at end of file
.vscode/settings.json
0 → 100644
View file @
eb8fb6f6
{
"cSpell.userWords"
:
[],
//
only
use
words
from
.cspell.json
"cSpell.enabled"
:
true
,
"editor.formatOnSave"
:
true
,
"typescript.tsdk"
:
"node_modules/typescript/lib"
,
"typescript.enablePromptUseWorkspaceTsdk"
:
true
,
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
,
"[typescript]"
:
{
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
},
"[javascript]"
:
{
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
},
"[vue]"
:
{
"editor.defaultFormatter"
:
"octref.vetur"
},
"[json]"
:
{
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
},
"[html]"
:
{
"editor.defaultFormatter"
:
"esbenp.prettier-vscode"
},
"vetur.format.options.tabSize"
:
4
,
"files.exclude"
:
{
"node_modules"
:
false
},
"prettier.semi"
:
false
,
"prettier.printWidth"
:
100
,
"vetur.format.scriptInitialIndent"
:
true
,
"vetur.format.styleInitialIndent"
:
true
,
"vetur.format.defaultFormatterOptions"
:
{
"prettyhtml"
:
{
"printWidth"
:
500
,
},
"prettier"
:
{
"semi"
:
false
,
"singleQuote"
:
false
,
"printWidth"
:
100
,
}
},
"javascript.format.insertSpaceAfterConstructor"
:
true
,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions"
:
false
,
"[javascript][typescript]"
:
{
"editor.maxTokenizationLineLength"
:
2500
},
"cSpell.words"
:
[
"bjrsy"
,
"caiji"
,
"desheng"
,
"ifdef"
,
"mescroll"
,
"tecsun"
,
"uview"
,
"vuex"
,
"WEIXIN"
,
"xchat"
,
"xxcj"
],
"[env]"
:
{
"editor.defaultFormatter"
:
"IronGeek.vscode-env"
}
}
\ No newline at end of file
README.md
View file @
eb8fb6f6
# im-demo2
# im-demo2
### src/customer-service
是一个基于 VueX 和 xchat 的客服子模块,本身不能单独运行,通过
`src/store/index.ts`
中
`modules`
进行挂载
在
`src/service/chat.ts`
中
`initChat`
进行初始化
但是在
`initChat`
需要依赖我们自研的
`api`
对接
`sdk`
,所以在初始化前还需要传入已登录的
`sdk`
`sdk`
提供多种登录,demo 中提供的是统一认证中心
`passport`
的方式登录
demo 请看
`src/views/home.vue`
## Project setup
## Project setup
```
```
yarn install
npm run init
```
```
### Compiles and hot-reloads for development
### Compiles and hot-reloads for development
```
```
yar
n serve
npm ru
n serve
```
```
### Compiles and minifies for production
### Compiles and minifies for production
```
```
yar
n build
npm ru
n build
```
```
### Lints and fixes files
### Lints and fixes files
```
```
yarn lint
yarn lint
```
```
### Customize configuration
See
[
Configuration Reference
](
https://cli.vuejs.org/config/
)
.
src/views/home.vue
View file @
eb8fb6f6
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
:size=
"600"
:size=
"600"
>
>
<div
class=
"chat"
v-loading=
"!chatTitle"
>
<div
class=
"chat"
v-loading=
"!chatTitle"
>
<!-- @/customer-service 中的组件 -->
<chat-room
/>
<chat-room
/>
</div>
</div>
</el-drawer>
</el-drawer>
...
@@ -46,11 +47,14 @@
...
@@ -46,11 +47,14 @@
}
}
private
init
()
{
private
init
()
{
// 登录统一认证中心passport
return
getPassportTokenByPassport
(
config
.
testAccount
,
config
.
testPassword
)
return
getPassportTokenByPassport
(
config
.
testAccount
,
config
.
testPassword
)
.
then
((
token
)
=>
{
.
then
((
token
)
=>
{
// 使用passport Token初始化sdk
return
sdk
.
setup
(
token
)
return
sdk
.
setup
(
token
)
})
})
.
then
(()
=>
{
.
then
(()
=>
{
// sdk初始化完后,chat使用全局sdk实例去初始化会话链接以及会话列表
return
initChat
()
return
initChat
()
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment