fix: share token
This commit is contained in:
@@ -117,7 +117,7 @@
|
||||
import { ref } from "vue";
|
||||
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||
import { getPageDetail } from "@/api/system.js";
|
||||
import { saveViewRequest } from "@/utils/common.js";
|
||||
import { getShareToken, saveViewRequest } from "@/utils/common.js";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
|
||||
const cardId = ref("");
|
||||
@@ -132,20 +132,22 @@ onLoad(async (options) => {
|
||||
}
|
||||
});
|
||||
|
||||
onShareAppMessage(() => {
|
||||
onShareAppMessage(async () => {
|
||||
const token = await getShareToken("card_detail", cardDetail.value?.id);
|
||||
return {
|
||||
title: "送你一张精美的新春祝福卡片 🎊",
|
||||
path: `/pages/detail/index?shareToken=${cardDetail.value?.shareToken || ""}`,
|
||||
path: `/pages/detail/index?shareToken=${token || ""}`,
|
||||
imageUrl:
|
||||
cardDetail.value?.imageUrl ||
|
||||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
|
||||
};
|
||||
});
|
||||
|
||||
onShareTimeline(() => {
|
||||
onShareTimeline(async () => {
|
||||
const token = await getShareToken("card_timeline", cardDetail.value?.id);
|
||||
return {
|
||||
title: "送你一张精美的新春祝福卡片 🎊",
|
||||
query: `shareToken=${cardDetail.value?.shareToken || ""}`,
|
||||
query: `shareToken=${token}`,
|
||||
imageUrl:
|
||||
cardDetail.value?.imageUrl ||
|
||||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
|
||||
|
||||
Reference in New Issue
Block a user