public function saveSetting()
{
$type = $_POST['mail_type'];
$mailType = 'MAIL_' . $type;
$mailer = self::createMailObject($type);
if (!$mailer->isAvailable()) {
$config = Option::get($mailType);
}
if (!$config) {
$config = Option::get($mailType);
}
$config = json_decode($config, true);
$_config = [];
foreach ($config as $key => $val) {
$k = $key;
$v = $val;
if (strpos($k, 'mailer') === false) {
$_config[] = ['key' => $k, 'value' => $v];
}
}
return array('error' => 0, 'message' => '请设置邮件参数', 'configs' => $_config, 'mailer' => $type);
}