Blame view

src/api/community/communityApi.js 1.66 KB
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
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
  import { setCommunitys,setCurrentCommunity } from "@/utils/vc"
  import request from '@/utils/request'
  export function _loadCommunityInfo(_param) {
      return new Promise((resolve, reject) => {
          request({
              url: '/community.listMyEnteredCommunitys',
              method: 'get',
              params: {
                  page: 1,
                  row: 3
              }
          }).then(response => {
              const res = response.data
              let _communityInfos = res.communitys;
              if (_communityInfos && _communityInfos.length > 0) {
                  setCurrentCommunity(_communityInfos[0]);
                  setCommunitys(_communityInfos);
                  if (_param && _param.communityId) {
                      let _communityId = _param.communityId;
                      _communityInfos.forEach(_c => {
                          if (_c.communityId == _communityId) {
                              setCurrentCommunity(_c);
                          }
                      })
                  }
              }
              // 获取验证码成功
              resolve(res)
          }).catch(error => {
              reject(error)
          })
      })
  }
  
  export function getDict(tableName,tableColumns) {
      return new Promise((resolve, reject) => {
          request({
              url: '/callComponent/core/list',
              method: 'get',
              params: {
                  name: tableName,
                  type: tableColumns,
                  page:1,
                  row:500
              }
          }).then(response => {
              const res = response.data
              // 获取验证码成功
              resolve(res)
          }).catch(error => {
              reject(error)
          })
      })
  }