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.
40 lines
937 B
40 lines
937 B
const API_URL = 'http://localhost:3000' |
|
const app = getApp() |
|
|
|
function getZichanSlides (resolve) { |
|
wx.request({ |
|
url: `${API_URL}/profiles/zichan_sildes`, |
|
data: {token: app.globalData.token}, |
|
header: { 'Content-Type': 'application/json'}, |
|
success: resolve, |
|
fail: function(){} |
|
}) |
|
} |
|
|
|
function getCustomerInfo (cb) { |
|
wx.request({ |
|
url: `${API_URL}/sessions/new`, |
|
header: { 'Content-Type': 'application/json'}, |
|
data: { |
|
code: 'sadjfskdf', |
|
mobile: '13054277977', |
|
name: 'test' |
|
}, |
|
success: function(res) { |
|
app.globalData.currentCustomer = res.data.customer |
|
app.globalData.token = res.data.token |
|
typeof cb == "function" && cb(app.globalData.currentCustomer) |
|
}, |
|
fail: function(res) { |
|
} |
|
}) |
|
} |
|
|
|
module.exports = { |
|
getZichanSlides (resolve) { |
|
return getZichanSlides(resolve) |
|
}, |
|
getCustomerInfo (resolve) { |
|
return getCustomerInfo(resolve) |
|
} |
|
} |