51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
class MailController extends BaseAuthedController {
|
|
|
|
public function getAttachment()
|
|
{
|
|
$mailIds = getReqVal('mail_ids', '');
|
|
|
|
$response = '';
|
|
{
|
|
$params = array(
|
|
'c' => 'Mail',
|
|
'a' => 'getAttachment',
|
|
'account_id' => myself()->_getAccountId(),
|
|
'session_id' => myself()->_getSessionId(),
|
|
'mail_ids' => $mailIds
|
|
);
|
|
|
|
$url = self::getMailServerUrl();
|
|
if (!phpcommon\HttpClient::get
|
|
($url,
|
|
$params,
|
|
$response)) {
|
|
myself()->_rspErr(500, 'server internal error 3, url:' . $url);
|
|
die();
|
|
return;
|
|
}
|
|
}
|
|
$rspObj = json_decode($response, true);
|
|
if ($rspObj && $rspObj['errcode'] == 0) {
|
|
$this->procAttachments($rspObj['attachments']);
|
|
}
|
|
echo $response;
|
|
}
|
|
|
|
private function procAttachments($attachments)
|
|
{
|
|
|
|
}
|
|
|
|
private static function getMailServerUrl()
|
|
{
|
|
if (SERVER_ENV != _ONLINE) {
|
|
return "https://gamemail-test.kingsome.cn/webapp/index.php";
|
|
} else {
|
|
return "https://gamemail-test.cebggame.com/webapp/index.php";
|
|
}
|
|
}
|
|
|
|
}
|