mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
added request-body for play saper
This commit is contained in:
@@ -54,3 +54,39 @@ export async function GetUserData(AUTHTOKEN, SearchToken) {
|
||||
console.log('Fetch error')
|
||||
}
|
||||
}
|
||||
|
||||
export async function ClickCirclePlay(InfoUser, ClickedCell) {
|
||||
const data = {
|
||||
PuttedMoney: InfoUser.PuttedMoney,
|
||||
MinesCount: InfoUser.MinesCount,
|
||||
UserCredentials: {
|
||||
SearchToken: InfoUser.SearchToken,
|
||||
AUTHTOKEN: InfoUser.AUTHTOKEN
|
||||
},
|
||||
ClickedCell: {
|
||||
X: ClickedCell.X,
|
||||
y: ClickedCell.Y
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BackendApiUrl}/GameMines/Play`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
redirect: 'follow'
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
console.log('Fetch error:', response.status)
|
||||
}
|
||||
|
||||
console.log(response.json())
|
||||
return await response.json()
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Fetch error')
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,8 @@
|
||||
import ChatComponent from "@/components/ChatComponent.vue";
|
||||
import AsideBarElement from "@/components/AsidebarComponent.vue";
|
||||
import HeaderElementPage from "@/components/HeaderComponent.vue";
|
||||
import { GetPercentageSteps, GetUserData } from "@/assets/js/games/saper/SaperAPI";
|
||||
import { GetPercentageSteps, GetUserData, ClickCirclePlay } from "@/assets/js/games/saper/SaperAPI";
|
||||
import { GetCurrentMoney } from "@/assets/js/rest/RestMethods";
|
||||
import { GetCookie } from "@/assets/js/storage/CookieStorage";
|
||||
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue';
|
||||
@@ -148,7 +149,6 @@ SwiperCore.use([Navigation]);
|
||||
|
||||
import '@/assets/css/PagesStyles/games-pages/saper.css'
|
||||
import SaperNumbers from "@/mocks/SaperNumbers";
|
||||
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
|
||||
|
||||
export default {
|
||||
components: {ChatComponent, HeaderElementPage, AsideBarElement, Swiper, SwiperSlide },
|
||||
|
||||
Reference in New Issue
Block a user