微信接口
This commit is contained in:
54
utils/api.js
54
utils/api.js
@@ -17,7 +17,7 @@ function buildURL(url, needToken) {
|
||||
})
|
||||
setTimeout(function () {
|
||||
wx.hideLoading()
|
||||
}, 2000)
|
||||
}, 4000)
|
||||
return;
|
||||
}
|
||||
if (url != '/user/login'){
|
||||
@@ -265,10 +265,52 @@ export default {
|
||||
return fetchPost('/user/login',params,true,false);
|
||||
},
|
||||
|
||||
/**
|
||||
* 任务清单
|
||||
*/
|
||||
taskList(params) {
|
||||
return fetchPost('/test', params, true,false);
|
||||
addSetting(params) {
|
||||
return fetchPost('user/settings/add',params,true,false);
|
||||
},
|
||||
deleteSetting(params) {
|
||||
return fetchPost('user/settings/delete',params,true,false);
|
||||
},
|
||||
getSettings(type) {
|
||||
let result;
|
||||
if (type == 'INCOME_SETTING'){
|
||||
result = wx.getStorageSync('INCOME_SETTING');
|
||||
}
|
||||
if (type == 'EXPEND_SETTING'){
|
||||
result = wx.getStorageSync('INCOME_SETTING');
|
||||
}
|
||||
if (type == 'ACCOUNT_SETTING'){
|
||||
result = wx.getStorageSync('INCOME_SETTING');
|
||||
}
|
||||
if (result){
|
||||
return result;
|
||||
}
|
||||
let income;
|
||||
let expend;
|
||||
let account;
|
||||
fetchPost('/user/settings', null, true,false).then(res => {
|
||||
income = res.INCOME_SETTING;
|
||||
expend = res.INCOME_SETTING;
|
||||
account = res.INCOME_SETTING;
|
||||
wx.setStorageSync('INCOME_SETTING',income)
|
||||
wx.setStorageSync('EXPEND_SETTING',expend)
|
||||
wx.setStorageSync('ACCOUNT_SETTING',account)
|
||||
if (type == 'INCOME_SETTING'){
|
||||
return income;
|
||||
}
|
||||
if (type == 'EXPEND_SETTING'){
|
||||
return expend;
|
||||
}
|
||||
if (type == 'ACCOUNT_SETTING'){
|
||||
return account;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getSettingsExpend(){
|
||||
return fetchPost('/user/settings/expend',null,true,false);
|
||||
},
|
||||
getSettingsIncome(){
|
||||
return fetchPost('/user/settings/income',null,true,false);
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user