mirror of
https://github.com/openvk/openvk
synced 2025-02-09 08:19:34 +03:00
parent
1317059bab
commit
7d0dbb26ed
1 changed files with 16 additions and 2 deletions
|
@ -42,8 +42,22 @@ window.OVKAPI = new class {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = `/method/${method}?auth_mechanism=roaming&${new URLSearchParams(params).toString()}&v=5.200`
|
const form_data = new FormData
|
||||||
const res = await fetch(url)
|
Object.entries(params).forEach(fd => {
|
||||||
|
form_data.append(fd[0], fd[1])
|
||||||
|
})
|
||||||
|
|
||||||
|
const __url_params = new URLSearchParams
|
||||||
|
__url_params.append("v", "5.200")
|
||||||
|
if(window.openvk.current_id != 0) {
|
||||||
|
__url_params.append("auth_mechanism", "roaming")
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = `/method/${method}?${__url_params.toString()}`
|
||||||
|
const res = await fetch(url, {
|
||||||
|
method: "POST",
|
||||||
|
body: form_data,
|
||||||
|
})
|
||||||
const json_response = await res.json()
|
const json_response = await res.json()
|
||||||
|
|
||||||
if(json_response.response) {
|
if(json_response.response) {
|
||||||
|
|
Loading…
Reference in a new issue