|
@@ -73,7 +73,7 @@
|
|
|
},
|
|
|
onShow: async function() {
|
|
|
const that = this;
|
|
|
- that.searchToken();
|
|
|
+ that.searchUser();
|
|
|
that.searchConfig();
|
|
|
// 判断是否是选择图片刷新
|
|
|
if (!that.is_img) {
|
|
@@ -88,10 +88,10 @@
|
|
|
uni.stopPullDownRefresh();
|
|
|
},
|
|
|
methods: {
|
|
|
- searchToken() {
|
|
|
+ searchUser() {
|
|
|
const that = this;
|
|
|
try {
|
|
|
- const res = uni.getStorageSync('token');
|
|
|
+ const res = uni.getStorageSync('user');
|
|
|
if (res) that.$set(that, `user`, res);
|
|
|
} catch (e) {
|
|
|
uni.showToast({
|
|
@@ -122,7 +122,7 @@
|
|
|
limit: that.limit,
|
|
|
user: that.user._id
|
|
|
}
|
|
|
- const res = await that.$api(`/chat`, 'GET', {
|
|
|
+ const res = await that.$api(`chat`, 'GET', {
|
|
|
...info,
|
|
|
})
|
|
|
if (res.errcode == '0') {
|
|
@@ -175,7 +175,7 @@
|
|
|
"msg_type": e.type
|
|
|
};
|
|
|
// 发送给服务器消息
|
|
|
- let res = await that.$api(`/chat`, `POST`, data);
|
|
|
+ let res = await that.$api(`chat`, `POST`, data);
|
|
|
if (res.errcode == '0') {
|
|
|
that.msgList.push(res.data);
|
|
|
} else {
|
|
@@ -188,7 +188,7 @@
|
|
|
that.goBottom();
|
|
|
} else {
|
|
|
uni.navigateTo({
|
|
|
- url: `/pagesIndex/login/index`
|
|
|
+ url: `/pagesHome/login/index`
|
|
|
})
|
|
|
}
|
|
|
},
|