Commit 3eff5c53 by 施宇

11

parent 693d61dd
......@@ -19,7 +19,7 @@
<span class="icon iconfont iconjuxing"></span>
<input type="text" placeholder="请输入要搜索的内容">
</div>
<div class="input_btn fl btn_48 btn bold">
<div class="input_btn fl btn_48 btn bold btn_blue">
搜索
</div>
</div>
......
......@@ -14,7 +14,7 @@ $(function () {
var self = this;
IcController.getData(apis.authme, 'POST', null, function (res) {
if (res.err_code == 0) {
self.testUser(res.data.mobile, res.data.im_password)
self.login(res.data.im_username, res.data.im_password)
} else {
console.log('获取用户名失败')
}
......@@ -39,45 +39,6 @@ $(function () {
};
self.conn.registerUser(options);
},
testUser: function (user, password) { //检测用户是否登入
var self = this;
var data = JSON.stringify({
"grant_type": "client_credentials",
"client_id": "YXA6UWJlUJGNEemA0XUSlr6mDA",
"client_secret": "YXA6n8pckF065e7FPtukjJHAoa-4G74"
}, )
$.ajax({
type: 'post',
url: 'http://a1.easemob.com/' + self.orgName + '/' + self.appName + '/token',
data: data,
contentType: "application/json",
success: function (data) {
var token = data.access_token;
$.ajax({
type: 'get',
url: 'http://a1.easemob.com/' + self.orgName + '/' + self.appName + '/users/' + user,
headers: {
Authorization: 'Bearer ' + token
},
success: function (data) { //用户已注册,主动帮用户登入
self.login(user, password)
},
error: function (err) {
if (err.status == '404') { //主动帮用户注册
self.registerUser(user, password);
} else {
layer.msg('网络出现问题,请重试!');
}
}
});
},
error: function () {
layer.msg('网络出现问题,请重试!');
}
});
},
defaultUser: function () {
//默认客服
this.addUser('18664936975', true)
......
......@@ -31,7 +31,7 @@ $(function () {
layui.laytpl(getTpl).render(arr, function (html) {
$(".goods_data_list").empty().html(html);
});
} else if (res.errcode == 105001) {
} else if (res.errcode == type==1?105013:105001) {
layui.laytpl(getTpl).render([], function (html) {
$(".goods_data_list").empty().html(html);
......
$(function () {
var inquiry = {
params: {
"offset": 1,
"offset": 7,
"p": 1,
"token": Util.getCookie('token') || ""
},
......@@ -44,7 +44,7 @@ $(function () {
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 1,
limit: 7,
curr: page,
jump: function (obj, first) {
if (!first) {
......
......@@ -59,7 +59,7 @@ $(function () {
}
});
});
} else if (res.errcode == 105001) {
} else if (res.errcode == 105013) {
self.listData = [];
layui.laytpl(getTpl).render([], function (html) {
$(".quote_content .inquiry_data").empty().html(html);
......
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