/** * 用户相关数据接口 */ import { get, post } from '../baseRequset'; import { inspectUrl, inspectPicUrl } from '../../config/index'; const app = getApp(); //登录 function fetchLoginPW(accessTokenPW) { return post({ url: '/wxuser/loginPW', data: accessTokenPW, }).then(res => { return res.data; }); } //获取用户账户信息 function fetchUserInfo(userId) { return get({ url: `/userInfo/${userId}`, }).then(res => { return res.data; }); } //获取用户基本信息 function fetchUserBaseInfo(userId) { return get({ url: `/baseInfo/${userId}`, }).then(res => { return res.data; }); } //修改密码 function fetchChangePw({ oldPassword, newPassword }) { return post({ url: `/userInfo/password/change`, params: { userId: app.globalData.accessToken.userId, oldPassword, newPassword, }, }).then(res => res.data); } //用户搜索 function fetchSearchUser({ page = 1, per_page = 30, data }) { return post({ url: `/userInfo/searchUser/${app.globalData.accessToken.userId}`, params: { page: page, per_page: per_page, }, data: data, }).then(res => res); } // 获取 function fetchUserMap(sceneId) { return get( { url: `/usermap`, params: { sceneId: sceneId, }, }, inspectUrl, ).then(res => res.data); } export { fetchLoginPW, fetchUserInfo, fetchUserBaseInfo, fetchChangePw, fetchSearchUser, fetchUserMap, };