riku
2025-04-27 f46786f11c5c08ead7501a82e5a71430ad69b782
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
 * 用户相关数据接口
 */
 
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,
};