Merge remote-tracking branch 'origin/master'

# Conflicts:
#	manifest.json
#	sheep/platform/provider/wechat/miniProgram.js
pull/100/head
痴货 2024-08-03 21:12:39 +08:00
commit 22b62d2b22
2 changed files with 10 additions and 13 deletions

View File

@ -184,7 +184,7 @@
"versionCode": 100
},
"mp-weixin": {
"appid": "wx66186af0759f47c9",
"appid": "wx9a0a5b259d852380",
"setting": {
"urlCheck": false,
"minified": true,

View File

@ -1,3 +1,4 @@
import third from '@/sheep/api/migration/third';
import AuthUtil from '@/sheep/api/member/auth';
import SocialApi from '@/sheep/api/member/social';
import UserApi from '@/sheep/api/member/user';
@ -9,7 +10,7 @@ let subscribeEventList = [];
// 加载微信小程序
function load() {
checkUpdate();
getSubscribeTemplate();
// getSubscribeTemplate();
}
// 微信小程序静默授权登陆
@ -162,15 +163,15 @@ const checkUpdate = async (silence = true) => {
};
// 获取订阅消息模板
async function getSubscribeTemplate() {
const { code, data } = await SocialApi.getSubscribeTemplateList();
if (code === 0) {
subscribeEventList = data;
}
}
// async function getSubscribeTemplate() {
// const { code, data } = await third.wechat.getSubscribeTemplateList();
// if (code === 0) {
// subscribeEventList = data;
// }
// }
// 订阅消息
function subscribeMessage(event, callback= undefined) {
function subscribeMessage(event) {
let tmplIds = [];
if (typeof event === 'string') {
const temp = subscribeEventList.find(item => item.title.includes(event));
@ -190,10 +191,6 @@ function subscribeMessage(event, callback= undefined) {
uni.requestSubscribeMessage({
tmplIds,
success: ()=>{
// 不管是拒绝还是同意都触发
callback && callback()
},
fail: (err) => {
console.log(err);
},