mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #2278] استخراج لینک سابسکریپشن از طریق API #1555
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#1555
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @D-7J on GitHub (May 22, 2024).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/2278
سلام کمک میخواستم برای استخراج لینک سابسکریپشن از طریق api
یک قسمت از xui-api که تعریف شده این هست
elseif ($_GET['action'] == 'get_config_link') { $response = $xui->getCliConfig($_GET['email']); if (json_decode($response, true)['success']) { echo json_encode(['success' => true, 'config' => $xui->getCliConfig($_GET['email'])], 448); } else { echo $response; } }اول این فایل php دو تا فایل هم include شده که بخش های لازمه رو میذارم اینجا
include_once 'xui.php'; include_once '../config.php';حالا توی این دو تا فایل قسمت مهم که هست برای استخراج اطلاعات کاربر اینه که توی فایل xui.php هست
public function getCliConfig($email) { $http = new HTTPRequest(); $response = $http->Url('http://' . $this->domain . ':' . self::getSettings()['subPort'] . self::getSettings()['subPath'] . self::getCliStatusV2($email)['subId'])->Method('GET')->Send(); $config = explode('#', base64_decode($response))[0] . '#' . $email; return $config; }و این هم قسمت کدی که لینک رو برای کاربر میفرسته و اطلاعات رو توی دیتا بیس ذخیره میکنه
` $service_config = (is_null($getPanel['domain']) or $getPanel['domain'] == '/blank') ? $response['config'] : str_replace(parse_url($getPanel['address'])['host'], $getPanel['domain'], $response['config']);
اولا توی order table ردیفی برای ذخیره سابسکریپشن لینک وجود نداره ثانیا اشکال کار رو نمیتونم پیدا کنم که بغل لینک مستقیم لینک سابسکریپشن هم برای کاربر بفرسته
اگه کسی میتونه کمک کنه لطفا به آیدی تلگرامم پیام بده.