Blame view

src/api/user.js 1.42 KB
80a28914e   吉鹏   init
1
  import request from '@/utils/request'
60fa0be9d   Adam   auto commit the c...
2
  // var qs = require('Qs');
80a28914e   吉鹏   init
3
4
  
  export function login(data) {
60fa0be9d   Adam   auto commit the c...
5
    console.log('login.1111...', data)
80a28914e   吉鹏   init
6
    return request({
c40d344e2   Adam   auto commit the c...
7
8
      url: '/yp/user/login',
      // url: '/yp.user.login.php',
80a28914e   吉鹏   init
9
      method: 'post',
c40d344e2   Adam   auto commit the c...
10
11
12
      // headers: {
      //   'Content-type': 'application/x-www-form-urlencoded'
      // },
60fa0be9d   Adam   auto commit the c...
13
14
15
16
17
18
      data,
      // responseType: 'text/plain',
      // onDownloadProgress: false,
      // onUploadProgress: true,
      // proxy: {}
    });
80a28914e   吉鹏   init
19
20
21
  }
  
  export function getInfo(token) {
a795fa7b1   Adam   auto commit the c...
22
    console.log('getInfo....', token)
80a28914e   吉鹏   init
23
    return request({
c44ba96f6   Adam   auto commit the c...
24
      url: '/yp/user/info',
c40d344e2   Adam   auto commit the c...
25
      // url: '/yp.user.info.php',
c44ba96f6   Adam   auto commit the c...
26
      method: 'get',
60fa0be9d   Adam   auto commit the c...
27
28
29
      params: {
        token
      }
c40d344e2   Adam   auto commit the c...
30
31
32
33
      // ,
      // headers: {
      //   'Content-type': 'application/x-www-form-urlencoded'
      // },
c44ba96f6   Adam   auto commit the c...
34
35
36
37
38
39
40
    })
  }
  
  export function list(token) {
    console.log('listUser....', token)
    return request({
      url: '/yp/user/list',
80a28914e   吉鹏   init
41
      method: 'get',
60fa0be9d   Adam   auto commit the c...
42
43
44
      params: {
        token
      }
80a28914e   吉鹏   init
45
46
    })
  }
1172ebb79   Adam   auto commit the c...
47
48
49
50
  export function add(token) {
    console.log('addUser....', token)
    return request({
      url: '/yp/user/add',
c40d344e2   Adam   auto commit the c...
51
      method: 'post',
60fa0be9d   Adam   auto commit the c...
52
53
54
      params: {
        token
      }
1172ebb79   Adam   auto commit the c...
55
56
57
58
59
60
61
    })
  }
  
  export function modi(token) {
    console.log('modiUser....', token)
    return request({
      url: '/yp/user/modi',
c40d344e2   Adam   auto commit the c...
62
      method: 'post',
60fa0be9d   Adam   auto commit the c...
63
64
65
      params: {
        token
      }
1172ebb79   Adam   auto commit the c...
66
67
    })
  }
c40d344e2   Adam   auto commit the c...
68
69
  export function logout(token) {
    console.log('logout....', token)
80a28914e   吉鹏   init
70
    return request({
c44ba96f6   Adam   auto commit the c...
71
      url: '/yp/user/logout',
c40d344e2   Adam   auto commit the c...
72
73
      // url: '/yp.user.logout.php',
      method: 'post',
80a28914e   吉鹏   init
74
75
    })
  }