fix: point exp

This commit is contained in:
zzc
2026-02-24 22:49:56 +08:00
parent 90e7f000c8
commit e5a8f3ca3f
4 changed files with 42 additions and 15 deletions

25
App.vue
View File

@@ -1,13 +1,26 @@
<script> <script>
import { useUserStore } from './stores/user' import { useUserStore } from "./stores/user";
import { userOpenApp } from "./api/auth";
export default { const openApp = async () => {
const res = await userOpenApp();
if (res?.points && res.points > 0) {
uni.showToast({
title: `每日登录 +${res.points} 积分`,
icon: "none",
});
}
};
export default {
onLaunch() { onLaunch() {
const userStore = useUserStore() const userStore = useUserStore();
userStore.loadFromStorage() userStore.loadFromStorage();
if (userStore.userInfo.id) {
openApp();
} }
} },
};
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -23,6 +23,20 @@ export const updateUserInfo = async (body) => {
}); });
}; };
export const userOpenApp = async () => {
return request({
url: "/api/user/open-app",
method: "POST",
});
};
export const getUserAsset = async () => {
return request({
url: "/api/user/asset",
method: "GET",
});
};
export const reportPrivacy = async () => { export const reportPrivacy = async () => {
// return request({ // return request({
// url: "/api/common/privacy/report", // url: "/api/common/privacy/report",

View File

@@ -9,7 +9,7 @@ export const getAvatarSystemList = async (page = 1) => {
export const getAvatarSystemCategoryList = async () => { export const getAvatarSystemCategoryList = async () => {
return request({ return request({
url: `/api/blessing/avatar/system/category/list`, url: `/api/blessing/avatar/category/list`,
method: "GET", method: "GET",
}); });
}; };

View File

@@ -181,7 +181,7 @@ onLoad((options) => {
shareToken.value = options.shareToken; shareToken.value = options.shareToken;
saveViewRequest(options.shareToken, "avatar_download"); saveViewRequest(options.shareToken, "avatar_download");
} }
loadAvatars(true); fetchCategories();
trackRecord({ trackRecord({
eventName: "avatar_download_page_visit", eventName: "avatar_download_page_visit",
eventType: `visit`, eventType: `visit`,