gree_leran/unpackage/dist/dev/mp-weixin/apis/user.js

53 lines
1019 B
JavaScript

"use strict";
const utils_http = require("../utils/http.js");
const mark = (code) => {
return utils_http.http({
url: "/api/wxLogin",
data: {
code
},
method: "POST"
});
};
const getImageById = (userId) => {
return utils_http.http({
url: "/api/getUserInfoById",
method: "GET",
data: {
userId
}
});
};
const updateUserImage = (profilePicture) => {
return utils_http.http({
url: "/api/updateUserImage",
method: "POST",
data: {
profilePicture
}
});
};
const updateUserName = (username) => {
return utils_http.http({
url: "/api/updateUserName",
method: "POST",
data: {
username
}
});
};
const getUserNameById = (id) => {
return utils_http.http({
url: "/api/getUserNameById",
method: "GET",
data: {
id
}
});
};
exports.getImageById = getImageById;
exports.getUserNameById = getUserNameById;
exports.mark = mark;
exports.updateUserImage = updateUserImage;
exports.updateUserName = updateUserName;