Commit 076c0e4e by 杨铁龙

test account

parent 5ed4172c
VUE_APP_TEST_ACCOUNT="15132146321"
VUE_APP_TEST_PASSWORD="erhao521"
VUE_APP_ROOT_ENTRANCE="城市就业服务平台-求职招聘服务"
\ No newline at end of file
VUE_APP_TEST_ACCOUNT="18040417207"
VUE_APP_TEST_PASSWORD="y1234567"
VUE_APP_ROOT_ENTRANCE="大爱毕节小程序"
\ No newline at end of file
# im-demo # im-demo
### 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
``` ```
...@@ -21,7 +9,9 @@ npm run init ...@@ -21,7 +9,9 @@ npm run init
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
npm run serve npm run serve:test1
npm run serve:test2
可以启动不同的测试账号
``` ```
### Compiles and minifies for production ### Compiles and minifies for production
...@@ -35,3 +25,15 @@ npm run build ...@@ -35,3 +25,15 @@ npm run build
``` ```
yarn lint yarn lint
``` ```
### 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`
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve:test1": "vue-cli-service serve --mode test1",
"serve:test2": "vue-cli-service serve --mode test2",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"init": "npm install --registry http://npm.job.qinqinxiaobao.com && npx browserslist@latest --update-db && npm run init-submodule", "init": "npm install --registry http://npm.job.qinqinxiaobao.com && npx browserslist@latest --update-db && npm run init-submodule",
...@@ -90,4 +91,4 @@ ...@@ -90,4 +91,4 @@
"last 2 versions", "last 2 versions",
"not dead" "not dead"
] ]
} }
\ No newline at end of file
VUE_APP_WWW_WORK_APP_URL="http://106.120.107.150:45000"
VUE_APP_API_WORK_APP_URL="http://106.120.107.150:48090"
VUE_APP_USER_CENTER="http://106.120.107.150:48080"
VUE_APP_UNIPLAT="http://hro.dev-xim-api.qqxb.jinsehuaqin.com:8800"
VUE_APP_H5_URL="https://pre-bj.hrs100.com"
VUE_APP_LAND_PAGE="https://static-bijie.qinqinxiaobao.com"
VUE_APP_BJRSY_COLLECTION="https://bjcjtest.e-tecsun.com"
VUE_APP_CLIENT_ID="daai_bijie_wechat_mini_app"
VUE_APP_UNIPLAT_WEBSOCKET_URI="ws://channel.jinsehuaqin.com:8080/ws"
VUE_APP_CLIENT_SECRET="123456"
VUE_APP_LOG_ENV="dev"
\ No newline at end of file
...@@ -5,7 +5,7 @@ export const config = { ...@@ -5,7 +5,7 @@ export const config = {
clientId: 'daai_bijie_wechat_mini_app', clientId: 'daai_bijie_wechat_mini_app',
uniplatSocketUrl: 'ws://channel.jinsehuaqin.com:8080/ws', uniplatSocketUrl: 'ws://channel.jinsehuaqin.com:8080/ws',
clientSecret: '123456', clientSecret: '123456',
testAccount: '18040417207', testAccount: process.env.VUE_APP_TEST_ACCOUNT,
testPassword: 'y1234567', testPassword: process.env.VUE_APP_TEST_PASSWORD,
rootEntrance: '大爱毕节小程序', rootEntrance: process.env.VUE_APP_ROOT_ENTRANCE,
} }
...@@ -13,7 +13,7 @@ export function initChat() { ...@@ -13,7 +13,7 @@ export function initChat() {
sdk: () => sdk.core, sdk: () => sdk.core,
orgId: () => sdk.orgId, orgId: () => sdk.orgId,
connection: config.uniplatSocketUrl, connection: config.uniplatSocketUrl,
serviceType: ServiceType.Frontend, serviceType: ServiceType.Backend,
}).then(() => { }).then(() => {
console.log('初始化chat✅ 开始获取和监听消息列表') console.log('初始化chat✅ 开始获取和监听消息列表')
return initChatMsg() return initChatMsg()
......
<template> <template>
<div> <div>
<div v-for="item in chatList" :key="item.id" @click="openChat(item)"> <div v-for="item in chatList" :key="item.id" @click="openChat(item)">
<div>{{ item.title }}</div> <el-button>
<div>{{ (item.last_msg_ts * 1000) | time2Relative }}</div> <div>{{ item.title }}</div>
<div>{{ (item.last_msg_ts * 1000) | time2Relative }}</div>
</el-button>
</div> </div>
<el-drawer <el-drawer
......
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