acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/api/member/social.js

96 lines
2.3 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
2024-10-01 09:15:35 +08:00
const modules_mall_sheep_request_index = require("../../request/index.js");
2024-09-19 07:20:14 +08:00
const SocialApi = {
// 获得社交用户
getSocialUser: (type) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/member/social-user/get",
method: "GET",
params: {
type
},
custom: {
showLoading: false
}
});
},
// 社交绑定
socialBind: (type, code, state) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/member/social-user/bind",
method: "POST",
data: {
type,
code,
state
},
custom: {
custom: {
showSuccess: true,
loadingMsg: "绑定中",
successMsg: "绑定成功"
}
}
});
},
// 社交绑定
socialUnbind: (type, openid) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/member/social-user/unbind",
method: "DELETE",
data: {
type,
openid
},
custom: {
showLoading: false,
loadingMsg: "解除绑定",
successMsg: "解绑成功"
}
});
},
// 获取订阅消息模板列表
2024-10-01 09:15:35 +08:00
getSubscribeTemplateList: () => modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/member/social-user/get-subscribe-template-list",
method: "GET",
custom: {
showError: false,
showLoading: false
}
}),
// 获取微信小程序码
getWxaQrcode: (path, query) => __async(exports, null, function* () {
2024-10-01 09:15:35 +08:00
return yield modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/member/social-user/wxa-qrcode",
method: "POST",
data: {
scene: query,
path,
checkPath: false
// TODO 开发环境暂不检查 path 是否存在
}
});
})
};
exports.SocialApi = SocialApi;