This commit is contained in:
huangzhenpc
2025-02-10 14:16:06 +08:00
parent 2c9fc13f21
commit 46b14149c9

View File

@@ -36,7 +36,14 @@ class Mail extends Controller
'MAIL_SERVER' => 'https://tempmail.plus'
]
]
// ,
];
/**
* 邮箱配置列表
*/
private $mailConfigstest = [
// [
// 'name' => 'IMAP配置',
// 'config' => [
@@ -47,10 +54,26 @@ class Mail extends Controller
// 'IMAP_USER' => 'maticarmy@163.com',
// 'IMAP_PASS' => 'LQer6rsSWan6vtuz',
// 'BROWSER_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.92 Safari/537.36',
// 'MAIL_SERVER' => 'https://tempmail.plus'
//
// ]
// ]
// ],
[
'name' => 'QQ IMAP配置',
'config' => [
'DOMAIN' => 'jxyweb.site',
'TEMP_MAIL' => null,
'IMAP_SERVER' => 'imap.qq.com',
'IMAP_PORT' => 993,
'IMAP_USER' => 'unze_hunter@qq.com',
'IMAP_PASS' => 'eqsjogxlcixybjje',
'BROWSER_USER_AGENT' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.92 Safari/537.36',
]
]
];
/**
* 获取所有配置
@@ -64,6 +87,21 @@ class Mail extends Controller
]);
}
public function gettestapi()
{
// 随机获取一个配置
$config = $this->mailConfigstest[array_rand($this->mailConfigstest)];
return json([
'code' => 0,
'msg' => '获取成功',
'data' => [
'name' => $config['name'],
'env' => $config['config']
]
]);
}
/**
* 获取随机配置
*/