Commit eb8fb6f6 by 杨铁龙

readme ad setting

parent 98b45360
...@@ -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
......
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"eamodio.gitlens",
"octref.vetur"
]
}
\ No newline at end of file
{
"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
# 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
``` ```
yarn serve npm run serve
``` ```
### Compiles and minifies for production ### Compiles and minifies for production
``` ```
yarn build npm run build
``` ```
### Lints and fixes files ### Lints and fixes files
``` ```
yarn lint yarn lint
``` ```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
...@@ -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()
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment