Blame view

src/api/user.js 885 Bytes
80a28914e   吉鹏   init
1
2
3
4
  import request from '@/utils/request'
  
  export function login(data) {
    return request({
50760eab9   Adam   auto commit the c...
5
      url: '/yp/user/login',
80a28914e   吉鹏   init
6
      method: 'post',
d7d9c38c2   Adam   auto commit the c...
7
      data
c44ba96f6   Adam   auto commit the c...
8
9
    })
  }
d7d9c38c2   Adam   auto commit the c...
10
  export function getInfo(token) {
c44ba96f6   Adam   auto commit the c...
11
    return request({
50760eab9   Adam   auto commit the c...
12
      url: '/yp/user/info',
80a28914e   吉鹏   init
13
      method: 'get',
d7d9c38c2   Adam   auto commit the c...
14
      params: { token }
80a28914e   吉鹏   init
15
16
    })
  }
d7d9c38c2   Adam   auto commit the c...
17
  export function logout() {
1172ebb79   Adam   auto commit the c...
18
    return request({
50760eab9   Adam   auto commit the c...
19
      url: '/yp/user/logout',
d7d9c38c2   Adam   auto commit the c...
20
      method: 'post'
80a28914e   吉鹏   init
21
22
    })
  }
50760eab9   Adam   auto commit the c...
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
  
  export function fetchList(query) {
    return request({
      url: '/yp/user/list',
      method: 'get',
      params: query
    })
  }
  
  export function createUser(query) {
    return request({
      url: '/yp/user/create',
      method: 'post',
      params: query
    })
  }
  
  export function updateUser(query) {
    return request({
      url: '/yp/user/update',
      method: 'post',
      params: query
    })
  }
  
  export function delUser(query) {
    return request({
      url: '/yp/user/del',
      method: 'post',
      params: query
    })
  }