驾考受理查询支付宝小程序、网页
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
891 B

import http from './http.js'
const config = {
getInfo : {url : '/api/getInfo', method : 'GET', auth : false},
getUserInfo : {url : '/api/getUserInfo', method : 'GET', auth : false, showLoading : true, loadingTitle : '搜索中...'},
getConfList : {url : '/api/getConfList', method : 'GET', auth : false, showLoading : true, loadingTitle : '搜索中...'},
}
export function api(key, data, callback, loadingTitle){
if (!config[key]) {
return console.error('无效key' + key);
}
// if (config[key].auth) {
// if (!localStorage.getItem('token')) {
// uni.navigateTo({
// url: '/pages/login/mobile'
// })
// console.error('需要登录')
// return {
// then() {}
// };
// }
// }
http.http(config[key].url, data, callback, config[key].method,
loadingTitle || config[key].showLoading, loadingTitle || config[key].loadingTitle)
}
export default api