Merge remote-tracking branch 'origin/main' into main
commit
ce6e77efaf
@ -0,0 +1,72 @@
|
||||
import {makeAutoObservable, runInAction} from "mobx"
|
||||
import {
|
||||
CaretUpOutlined,
|
||||
CaretDownOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {Tag} from 'antd';
|
||||
import * as config from "../config";
|
||||
import moment from "moment";
|
||||
import {NavLink} from "react-router-dom";
|
||||
import * as req from '../utils/request';
|
||||
|
||||
|
||||
class Wechat {
|
||||
|
||||
constructor(rootStore) {
|
||||
this.rootStore = rootStore;
|
||||
makeAutoObservable(this);
|
||||
|
||||
// req.fetchJSON(config.HT_HOST + '/weixin/wxwork/get_permit_user_list')
|
||||
// .then(json => {
|
||||
// runInAction(() => {
|
||||
// this.userList = json.Result.filter(user => {
|
||||
// return user.SMPlatform === 'weixin';
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
}
|
||||
|
||||
fetchWechatUserList() {
|
||||
|
||||
req.fetchJSON(config.HT_HOST + '/weixin/wxwork/get_permit_user_list')
|
||||
.then(json => {
|
||||
runInAction(() => {
|
||||
this.userList = json.Result.filter(user => {
|
||||
return user.SMPlatform === 'weixin';
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
fetchContactList(user) {
|
||||
|
||||
req.fetchJSON(config.HT_HOST + '/weixin/wxwork/get_externalcontact_list?userid='+user.userid)
|
||||
.then(json => {
|
||||
runInAction(() => {
|
||||
this.contactList = json.Result.filter(user => {
|
||||
return user.SMPlatform === 'weixin';
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fetchChatMsgList(contact) {
|
||||
|
||||
req.fetchJSON(config.HT_HOST + '/weixin/wxwork/GetChatmsg?external_userid='+contact.userid+'&Page_count=20&curr_page=0')
|
||||
.then(json => {
|
||||
runInAction(() => {
|
||||
console.info(json.chatmsg);
|
||||
this.chatMsgList = json.chatmsg;
|
||||
});
|
||||
});
|
||||
}
|
||||
userList = [{username: '---', avatar: 'https://joeschmoe.io/api/v1/random'}];
|
||||
contactList = [{username: '---', avatar: 'https://joeschmoe.io/api/v1/random'}];
|
||||
chatMsgList = [{from_name: '---', from_avatar: 'https://joeschmoe.io/api/v1/random', content: {text: '---'}}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default Wechat;
|
Loading…
Reference in New Issue