Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsales
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
e75acfb6
authored
Aug 26, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
111
parent
75425bcc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
dist/js/chat/index.js
dist/js/global/api.js
dist/js/chat/index.js
View file @
e75acfb6
...
...
@@ -5,6 +5,7 @@ $(function () {
appName
:
"icsales"
,
defaultName
:
"001"
,
customerNum
:
""
,
customerP
:
""
,
templateObj
:
JSON
.
parse
(
Util
.
getCookie
(
'template'
)
||
"{}"
),
customerText
:
Util
.
getCookie
(
'customer'
)
||
""
,
isLoginSuccess
:
false
,
...
...
@@ -12,6 +13,7 @@ $(function () {
img
:
""
,
name
:
""
,
id
:
""
,
isRelogin
:
true
,
init
:
function
()
{
if
(
this
.
ieFun
())
{
this
.
getUserInfo
();
...
...
@@ -32,6 +34,12 @@ $(function () {
},
getUserInfo
:
function
()
{
//获取用户的基本信息
var
self
=
this
;
var
imN
=
self
.
customerNum
;
var
imP
=
self
.
customerP
;
if
(
imN
&&
imP
)
{
self
.
getHistoryUsers
(
imN
,
imP
);
return
;
}
IcController
.
getData
(
apis
.
authme
,
'GET'
,
{
"token"
:
Util
.
getCookie
(
'token'
)
||
''
,
},
function
(
res
)
{
...
...
@@ -40,6 +48,7 @@ $(function () {
self
.
name
=
res
.
data
.
company_name
||
'--'
;
self
.
id
=
res
.
data
.
user_id
+
''
;
self
.
customerNum
=
res
.
data
.
im_username
||
''
;
self
.
customerP
=
res
.
data
.
im_password
||
''
;
self
.
getHistoryUsers
(
res
.
data
.
im_username
,
res
.
data
.
im_password
);
}
else
{
...
...
@@ -594,12 +603,17 @@ $(function () {
title
:
'提示'
,
content
:
'您的聊天账号被迫下线!'
});
}
else
if
(
message
.
type
==
1
)
{
if
(
self
.
isRelogin
)
{
self
.
isRelogin
=
false
;
// self.registerIm();
self
.
registerIm
();
}
else
{
// layer.open({
// title: '提示',
// content: '聊天系统出现异常!'
// });
layer
.
open
({
title
:
'提示'
,
content
:
'聊天系统登录失败'
});
}
}
// layer.msg('聊天系统出错');
},
//失败回调;
...
...
@@ -631,11 +645,24 @@ $(function () {
try
{
this
.
conn
.
open
(
options
);
}
catch
(
e
)
{
console
.
log
(
e
);
layer
.
msg
(
'登入失败'
);
this
.
deleteCookie
();
}
},
registerIm
:
function
()
{
var
me
=
this
;
IcController
.
getData
(
apis
.
authregistim
,
'post'
,
{
"token"
:
Util
.
getCookie
(
'token'
)
||
''
},
function
(
res
)
{
if
(
res
.
errcode
==
0
)
{
me
.
getUserInfo
();
}
else
{
layer
.
open
({
title
:
'提示'
,
content
:
'聊天系统出现异常'
});
}
},
false
)
},
scrollToTop
:
function
(
userId
)
{
var
imgLen
=
$
(
'#'
+
userId
).
find
(
'img'
).
length
;
if
(
!
imgLen
)
{
...
...
dist/js/global/api.js
View file @
e75acfb6
...
...
@@ -166,6 +166,10 @@
* 环信通讯记录列表(最多显示30条最新的聊天记录)
*/
listrecord
:
user_url
+
'/im/list/record'
,
/***
* 手动注册im账号
*/
authregistim
:
auth_url
+
'/auth/registIMUser'
,
/**
* 批量上传商品列表
*/
...
...
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