内网开发
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import http from '@/common/request';
|
||||
import publicFc from '@/common/publicFc';
|
||||
|
||||
import customHttp from "@/common/customHttp.js"
|
||||
import * as sdk from "@/common/imSdk/lim-sdk.js";
|
||||
import lim from "@/common/imSdk/sdk-bridge.js";
|
||||
|
||||
import localForage from 'localforage';
|
||||
const _im = lim.lim.im
|
||||
|
||||
function sortBy(field) {
|
||||
@@ -37,7 +37,8 @@ const store = new Vuex.Store({
|
||||
chatDataUserId: '',
|
||||
topicReply: {},
|
||||
topicRed: {},
|
||||
friendApply: {}
|
||||
friendApply: {},
|
||||
addressList:[],
|
||||
},
|
||||
mutations: {
|
||||
update_UserInfo(state, data) { //个人信息
|
||||
@@ -60,6 +61,10 @@ const store = new Vuex.Store({
|
||||
update_friendApply(state, data) {
|
||||
state.friendApply = data
|
||||
uni.setStorageSync('friendApply', JSON.stringify(data));
|
||||
},
|
||||
update_addressList(state,data){
|
||||
state.addressList=data;
|
||||
localForage.setItem("addressList",data)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -347,6 +352,27 @@ const store = new Vuex.Store({
|
||||
},
|
||||
createChat(context, data) {
|
||||
|
||||
},
|
||||
getAddressList(context){
|
||||
//获取通讯录,存储通讯录数据到本地
|
||||
customHttp.customHttp.get('/api/im/app/addressList', {
|
||||
params: {}, /* 会加在url上 */
|
||||
header: {}, /* 会与全局header合并,如有同名属性,局部覆盖全局 */
|
||||
dataType: 'json',
|
||||
// 注:如果局部custom与全局custom有同名属性,则后面的属性会覆盖前面的属性,相当于Object.assign(全局,局部)
|
||||
custom: {target: "znzq"} , // 可以加一些自定义参数,在拦截器等地方使用。比如这里我加了一个auth,可在拦截器里拿到,如果true就传token
|
||||
}).then(res => {
|
||||
console.log("=========获取到数据")
|
||||
console.log(res)
|
||||
if(res.statusCode==200){
|
||||
if(res.data.code==200){
|
||||
var records=res.data.result.records
|
||||
context.state.addressList = records
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user