51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
var http = require('./http');
|
|
|
|
const baseUrl = 'https://wechat-test.kingsome.cn';
|
|
export default {
|
|
sendSms: (mobile, captcha) => {
|
|
let data = {mobile: mobile};
|
|
if (captcha) {
|
|
data['captcha'] = captcha;
|
|
}
|
|
|
|
let url = baseUrl + '/activity/api/send_sms';
|
|
return http.post(url, data);
|
|
},
|
|
captchaUrl: () => {
|
|
return baseUrl + '/activity/ch/login'
|
|
},
|
|
preLogin: (data) => {
|
|
let url = baseUrl + '/activity/api/pre_login';
|
|
return http.post(url, data);
|
|
},
|
|
userInfo: () => {
|
|
let url = baseUrl + '/activity/api/user_info';
|
|
return http.get(url);
|
|
},
|
|
login: (mobile, code, shareUser) => {
|
|
let data = {
|
|
mobile: mobile,
|
|
captcha: code
|
|
};
|
|
(!!shareUser) && (data['shareUser'] = shareUser);
|
|
let url = baseUrl + '/activity/api/join';
|
|
return http.post(url, data);
|
|
},
|
|
logout: () => {
|
|
let url = baseUrl + '/activity/api/logout';
|
|
return http.post(url, {});
|
|
},
|
|
getShareUrl: () => {
|
|
let url = baseUrl + '/activity/api/getShareUrl';
|
|
return http.get(url);
|
|
},
|
|
getActivityInfo: () => {
|
|
let url = baseUrl + '/activity/api/activity_info';
|
|
return http.get(url);
|
|
},
|
|
updateInviteInfo: () => {
|
|
let url = baseUrl + '/activity/api/invite_info';
|
|
return http.get(url);
|
|
}
|
|
}
|