python学习

This commit is contained in:
2020-11-20 14:06:42 +08:00
parent 51fd976127
commit ea0e57b9f2
7 changed files with 548 additions and 458 deletions

View File

@@ -94,11 +94,13 @@ module.exports =
/* eslint-disable */
// 小程序开发api接口工具包https://github.com/gooking/wxapi
var API_BASE_URL = 'https://api.it120.cc';
//var API_BASE_URL = 'https://api.it120.cc';
var API_BASE_URL = 'http://www.ruilaizipj.com';
var subDomain = 'tz';
var request = function request(url, needSubDomain, method, data) {
var _url = API_BASE_URL + (needSubDomain ? '/' + subDomain : '') + url;
var _url = API_BASE_URL + (needSubDomain ? '/' + subDomain : '') + url;
// var _url = API_BASE_URL + (needSubDomain ? '' + subDomain : '') + url;
return new Promise(function (resolve, reject) {
wx.request({
url: _url,
@@ -263,41 +265,21 @@ module.exports = {
alipay: function alipay(data) {
return request('/pay/alipay/semiAutomatic/payurl', true, 'post', data);
},
login_wx: function login_wx(code) {
return request('/user/wxapp/login', true, 'post', {
login_wx: function login_wx(code,nickName,avatarUrl,gender,province,city,country) {
return request('/wxlogin/login', true, 'post', {
code: code,
type: 2
nickName: nickName,
avatarUrl: avatarUrl,
gender: gender,
province: province,
city: city,
country: country,
});
},
login_username: function login_username(data) {
return request('/user/username/login', true, 'post', data);
},
bindUsername: function bindUsername(token, username) {
var pwd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
return request('/user/username/bindUsername', true, 'post', {
token: token, username: username, pwd: pwd
});
},
login_mobile: function login_mobile(mobile, pwd) {
var deviceId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var deviceName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return request('/user/m/login', true, 'post', {
mobile: mobile, pwd: pwd, deviceId: deviceId, deviceName: deviceName
});
},
resetPwdUseMobileCode: function resetPwdUseMobileCode(mobile, pwd, code) {
return request('/user/m/reset-pwd', true, 'post', {
mobile: mobile, pwd: pwd, code: code
});
},
resetPwdUseEmailCode: function resetPwdUseEmailCode(email, pwd, code) {
return request('/user/email/reset-pwd', true, 'post', {
email: email, pwd: pwd, code: code
});
},
register_complex: function register_complex(data) {
// login_wx: function login_wx(data) {
// return request('/wxlogin/login', true, 'post', data);
// },
register_complex: function register_complex(data) {
return request('/user/wxapp/register/complex', true, 'post', data);
},
register_simple: function register_simple(data) {
@@ -480,6 +462,9 @@ module.exports = {
friendUserDetail: function friendUserDetail(token, uid) {
return request('/user/friend/detail', true, 'get', { token: token, uid: uid });
},
// friendUserDetail: function friendUserDetail(token, uid) {
// return request('/wxlogin/login', true, 'get', { token: token, uid: uid });
// },
videoDetail: function videoDetail(videoId) {
return request('/media/video/detail', true, 'get', {
videoId: videoId