fix
This commit is contained in:
@@ -129,15 +129,16 @@ const openHaibao = async (e) => {
|
|||||||
url.searchParams.append('my_only', '1');
|
url.searchParams.append('my_only', '1');
|
||||||
url.searchParams.append('page', '1');
|
url.searchParams.append('page', '1');
|
||||||
url.searchParams.append('per_page', '100');
|
url.searchParams.append('per_page', '100');
|
||||||
if (!globalStore.result_url) {
|
if (!globalStore.result_url && !mergeId) {
|
||||||
fetch(url.toString(), {
|
fetch(url.toString(), {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${Storage.get("userinfos").api_token}`
|
'Authorization': `Bearer ${Storage.get("userinfos").api_token}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(async response => {
|
||||||
.then(data => {
|
const data = await response.json()
|
||||||
|
if (response.status == 200 || response.status == 201) {
|
||||||
const foundItem = data.data.find(item => item.is_public === true);
|
const foundItem = data.data.find(item => item.is_public === true);
|
||||||
if (foundItem) {
|
if (foundItem) {
|
||||||
globalStore.result_url = foundItem.result_url;
|
globalStore.result_url = foundItem.result_url;
|
||||||
@@ -153,9 +154,11 @@ const openHaibao = async (e) => {
|
|||||||
return weui.alert("请先参与活动合成图片并打榜!")
|
return weui.alert("请先参与活动合成图片并打榜!")
|
||||||
}
|
}
|
||||||
return { success: true, data };
|
return { success: true, data };
|
||||||
|
} else {
|
||||||
|
ElMessage.error(data.message);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
|
||||||
return { success: false, error };
|
return { success: false, error };
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user