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
076c0e4e
authored
Feb 24, 2022
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
test account
parent
5ed4172c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
30 deletions
.env.test1
.env.test2
README.md
package.json
src/.env
src/config/index.ts
src/service/chat.ts
src/views/home.vue
.env.test1
0 → 100644
View file @
076c0e4e
VUE_APP_TEST_ACCOUNT="15132146321"
VUE_APP_TEST_PASSWORD="erhao521"
VUE_APP_ROOT_ENTRANCE="城市就业服务平台-求职招聘服务"
\ No newline at end of file
.env.test2
0 → 100644
View file @
076c0e4e
VUE_APP_TEST_ACCOUNT="18040417207"
VUE_APP_TEST_PASSWORD="y1234567"
VUE_APP_ROOT_ENTRANCE="大爱毕节小程序"
\ No newline at end of file
README.md
View file @
076c0e4e
# 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
```
...
...
@@ -21,7 +9,9 @@ npm run init
### Compiles and hot-reloads for development
```
npm run serve
npm run serve:test1
npm run serve:test2
可以启动不同的测试账号
```
### Compiles and minifies for production
...
...
@@ -35,3 +25,15 @@ npm run build
```
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`
package.json
View file @
076c0e4e
...
...
@@ -3,7 +3,8 @@
"version"
:
"0.1.0"
,
"private"
:
true
,
"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"
,
"lint"
:
"vue-cli-service lint"
,
"init"
:
"npm install --registry http://npm.job.qinqinxiaobao.com && npx browserslist@latest --update-db && npm run init-submodule"
,
...
...
src/.env
deleted
100644 → 0
View file @
5ed4172c
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
src/config/index.ts
View file @
076c0e4e
...
...
@@ -5,7 +5,7 @@ export const config = {
clientId
:
'daai_bijie_wechat_mini_app'
,
uniplatSocketUrl
:
'ws://channel.jinsehuaqin.com:8080/ws'
,
clientSecret
:
'123456'
,
testAccount
:
'18040417207'
,
testPassword
:
'y1234567'
,
rootEntrance
:
'大爱毕节小程序'
,
testAccount
:
process
.
env
.
VUE_APP_TEST_ACCOUNT
,
testPassword
:
process
.
env
.
VUE_APP_TEST_PASSWORD
,
rootEntrance
:
process
.
env
.
VUE_APP_ROOT_ENTRANCE
,
}
src/service/chat.ts
View file @
076c0e4e
...
...
@@ -13,7 +13,7 @@ export function initChat() {
sdk
:
()
=>
sdk
.
core
,
orgId
:
()
=>
sdk
.
orgId
,
connection
:
config
.
uniplatSocketUrl
,
serviceType
:
ServiceType
.
Front
end
,
serviceType
:
ServiceType
.
Back
end
,
}).
then
(()
=>
{
console
.
log
(
'初始化chat✅ 开始获取和监听消息列表'
)
return
initChatMsg
()
...
...
src/views/home.vue
View file @
076c0e4e
<
template
>
<div>
<div
v-for=
"item in chatList"
:key=
"item.id"
@
click=
"openChat(item)"
>
<el-button>
<div>
{{
item
.
title
}}
</div>
<div>
{{
(
item
.
last_msg_ts
*
1000
)
|
time2Relative
}}
</div>
</el-button>
</div>
<el-drawer
...
...
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