5 changed files with 1837 additions and 1089 deletions
@ -0,0 +1,8 @@ |
|||||
|
import { request } from './http.js'; |
||||
|
export const listHouseWithCount = (data) => { |
||||
|
return request({ |
||||
|
url: '/system/dict/data/list', |
||||
|
method: 'GET', |
||||
|
data, |
||||
|
}); |
||||
|
}; |
@ -0,0 +1,26 @@ |
|||||
|
const baseUrl = 'http://219.146.91.110:30801/mz-api'; |
||||
|
export const request = (options) => { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
uni.request({ |
||||
|
url: baseUrl + options.url, // 拼接完整接口地址
|
||||
|
method: options.method , // 默认 GET 请求
|
||||
|
data: options.data || {}, // 请求参数
|
||||
|
header: { |
||||
|
'Content-Type': 'application/json', |
||||
|
Authorization: uni.getStorageSync('token') || '', // 携带 Token
|
||||
|
}, |
||||
|
success: (res) => { |
||||
|
if (res.statusCode === 200) { |
||||
|
resolve(res.data); // 请求成功返回数据
|
||||
|
} else { |
||||
|
uni.showToast({ title: res.data.message || '请求失败', icon: 'none' }); |
||||
|
reject(res); |
||||
|
} |
||||
|
}, |
||||
|
fail: (err) => { |
||||
|
uni.showToast({ title: '网络异常', icon: 'none' }); |
||||
|
reject(err); |
||||
|
}, |
||||
|
}); |
||||
|
}); |
||||
|
}; |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Loading…
Reference in new issue