fix: share token

This commit is contained in:
zzc
2026-02-09 23:42:06 +08:00
parent 85bbf9d8ac
commit 88138c3300
5 changed files with 63 additions and 21 deletions

View File

@@ -74,21 +74,26 @@
</view>
</scroll-view>
<LoginPopup ref="loginPopupRef" @logind="handleLogind" />
<LoginPopup
ref="loginPopupRef"
@logind="handleLogind"
:share-token="shareToken"
/>
</view>
</template>
<script setup>
import { ref, onMounted, computed } from "vue";
import { ref, computed } from "vue";
import { getWallpaperList, getWallpaperCategoryList } from "@/api/wallpaper.js";
import {
saveRemoteImageToLocal,
saveRecordRequest,
getShareToken,
} from "@/utils/common.js";
import { onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
import { onShareAppMessage, onShareTimeline, onLoad } from "@dcloudio/uni-app";
import { getShareReward, abilityCheck } from "@/api/system.js";
import { useUserStore } from "@/stores/user";
import { saveViewRequest } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue";
const userStore = useUserStore();
@@ -102,6 +107,7 @@ const page = ref(1);
const loading = ref(false);
const hasMore = ref(true);
const isRefreshing = ref(false);
const shareToken = ref("");
onShareAppMessage(async (options) => {
if (!isLoggedIn.value) {
@@ -144,8 +150,12 @@ onShareTimeline(async () => {
};
});
onMounted(async () => {
await fetchCategories();
onLoad((options) => {
fetchCategories();
if (options.shareToken) {
shareToken.value = options.shareToken;
saveViewRequest(options.shareToken, "wallpaper_download");
}
});
const getThumbUrl = (url) => {