Blame view

src/api/index.js 1.01 KB
9b7e125f   monkeyhouyi   属地页面
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
  import request from "@/utils/request";
  
  
  // 登录
  export async function login(data) {
      return await request({
          url: '/oauth/Login',
          headers: {
              'Content-Type': 'application/x-www-form-urlencoded',//类型设置
          },
          method: 'post',
          data: data
      });
  }
  // 获取用户信息
  export async function getInfo() {
      return await request({
          url: '/oauth/CurrentUser',
          method: 'get',
      });
  }
  // 退出登录
  export async function logout() {
      return await request({
          url: '/oauth/Logout',
          method: 'get',
      });
  }
  // 修改密码
  export async function updateUserPwd(id, userPassword, validatePassword) {
      return await request({
          url: `/permission/users/${id}/Actions/ResetPassword`,
          method: 'post',
          data: {userPassword, validatePassword}
      });
  }
  
  // 注册账号
  export async function register(data) {
      return await request({
          url: `/permission/users/CreateSimple`,
          method: 'post',
          data
      });
  }