From 009a77e77a5b1a1f85f0f0145a7a7dea380adac5 Mon Sep 17 00:00:00 2001
From: Kubbo <390378816@qq.com>
Date: Sun, 22 Dec 2024 13:25:04 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E5=90=8D=E5=A4=A7=E5=B0=8F=E5=86=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api.php | 997 ++++++++++++++++++++++++++++++++++++++++++++++++++++
linuxdo.php | 148 +++-----
2 files changed, 1050 insertions(+), 95 deletions(-)
create mode 100644 api.php
diff --git a/api.php b/api.php
new file mode 100644
index 0000000..3d912af
--- /dev/null
+++ b/api.php
@@ -0,0 +1,997 @@
+ '登录', 1 => '注册', 2 => '找回密码'];
+
+$act = input('act');
+$do = input('do');
+
+switch ($act) {
+ case 'reg':
+ $fromMicroClient = 'microClient' == $do;
+
+ $type = intval(input('type'));
+ $account = input('account');
+ $password = input('password');
+ $serverId = 0;
+ $email = '';
+ $agent_id = 0;
+
+ if (!in_array($type, [0, 1, 2]))
+ returnJson(['code' => 1, 'msg' => '参数错误!请刷新页面重试~'], $fromMicroClient);
+
+ if (!$account)
+ returnJson(['code' => 1, 'msg' => '请输入' . $_CONFIG['account_name'] . $_CONFIG['account_name_suffix']], $fromMicroClient);
+ if (6 > strlen($account) && !in_array($account, array_unique(explode(',', trim($_CONFIG['admin_account'])))) || 16 < strlen($account))
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '长度为6-16个字符'], $fromMicroClient);
+
+ if (!$password)
+ returnJson(['code' => 1, 'msg' => '请输入' . $_CONFIG['account_name'] . $_CONFIG['password_name_suffix']], $fromMicroClient);
+ if (6 > strlen($password) || 16 < strlen($password))
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '长度为6-16个字符'], $fromMicroClient);
+
+ $ip = get_ip();
+
+ // 检查IP是否被封
+ if ($_CONFIG['deny_ip']) {
+ $deny_ip = array_unique(explode(',', trim($_CONFIG['deny_ip'])));
+ if (!empty($deny_ip) && in_array($ip, $deny_ip)) {
+ returnJson(['code' => 1, 'msg' => '当前未开放访问!'], $fromMicroClient); // 当前IP已禁用
+ }
+ }
+
+ $md5Pwd = md5($password . PASSWORD_KEY);
+ $time = time();
+
+ // 做一下从微端登录/注册的兼容 start --------------------------------------------------
+ if ($fromMicroClient) {
+ // 关闭验证码
+ $_CONFIG['code_open'] = 0;
+ // 连接数据库
+ $mySQLi = new mysqli($_CONFIG_DB['db_host'], $_CONFIG_DB['db_user'], $_CONFIG_DB['db_password'], $_CONFIG_DB['db_name'], $_CONFIG_DB['db_port']);
+ if ($mySQLi->connect_errno)
+ returnJson(['code' => 1, 'msg' => $mySQLi->connect_error], $fromMicroClient);
+ $mySQLi->set_charset($_CONFIG_DB['db_charset']);
+ // 先查询账号是否存在
+ $stmt = $mySQLi->prepare('select password from player where username=?');
+ $stmt->bind_param('s', $account);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ // 如果帐号存在但密码错误表示登录模式
+ if (!empty($row)) {
+ if ($md5Pwd != $row['password']) {
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '或' . $_CONFIG['password_name_suffix'] . '不正确!'], $fromMicroClient);
+ }
+ $type = 0;
+ } else { // 否则表示注册模式
+ $type = 1;
+ $_CONFIG['reg_code_open'] = 0;
+ }
+ }
+ // 做一下从微端登录/注册的兼容 end --------------------------------------------------
+
+ // 提前检查条件
+ switch ($type) {
+ case 1: // 注册
+ // 是否开放注册
+ if (!$_CONFIG['reg_open']) {
+ returnJson(['code' => 1, 'msg' => '内部测试中,未开放注册,如需体验请联系客服。'], $fromMicroClient);
+ }
+ // 检查保留帐号
+ if ($_CONFIG['retain_account']) {
+ $retain_account = array_unique(explode(',', trim($_CONFIG['retain_account'])));
+ if (!empty($retain_account) && in_array($account, $retain_account)) {
+ returnJson(['code' => 1, 'msg' => '抱歉!此' . $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '已被占用,请更换。'], $fromMicroClient);
+ }
+ }
+
+ $password2 = input('password2');
+ $serverId = intval(input('serverId'));
+ $email = input('email');
+ if ($_CONFIG['code_open'] && $_CONFIG['reg_code_open']) {
+ $code = input('code');
+ }
+
+ if (!$fromMicroClient) {
+ if (!$password2)
+ returnJson(['code' => 1, 'msg' => '请再次输入' . $_CONFIG['account_name'] . $_CONFIG['password_name_suffix']], $fromMicroClient);
+ if (6 > strlen($password2) || 16 < strlen($password2))
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '长度为6-16个字符'], $fromMicroClient);
+ if ($password2 != $password)
+ returnJson(['code' => 1, 'msg' => '两次输入的' . $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '不一致!'], $fromMicroClient);
+ }
+ if (!$serverId)
+ returnJson(['code' => 1, 'msg' => '请选择区服!'], $fromMicroClient);
+ if ($_CONFIG['code_open']) {
+ if ($_CONFIG['reg_code_open'] && !$email)
+ returnJson(['code' => 1, 'msg' => '请输入邮箱地址!'], $fromMicroClient);
+ if ($email && !filter_var($email, FILTER_VALIDATE_EMAIL))
+ returnJson(['code' => 1, 'msg' => '邮箱地址格式错误!'], $fromMicroClient);
+
+ if ($_CONFIG['reg_code_open']) {
+ if (!$code)
+ returnJson(['code' => 1, 'msg' => '请输入邮箱验证码!'], $fromMicroClient);
+ if (strlen($code) != $_CONFIG['code_length'])
+ returnJson(['code' => 1, 'msg' => '验证码长度为6位数字!'], $fromMicroClient);
+ }
+ }
+
+ $agent_id = intval(input('agent_id'));
+ break;
+ case 0: // 登录
+ // 是否开放登录
+ if (!$_CONFIG['login_open'] && !in_array($account, array_unique(explode(',', trim($_CONFIG['admin_account']))))) {
+ returnJson(['code' => 1, 'msg' => '内部测试中,未开放登录,如需体验请联系客服。'], $fromMicroClient);
+ }
+ break;
+ case 2: // 找回密码
+ if (!$_CONFIG['code_open']) {
+ returnJson(['code' => 1, 'msg' => '验证码系统尚未开启!']);
+ }
+
+ $password2 = input('password2');
+ $email = input('email');
+ $code = input('code');
+
+ if (!$password2)
+ returnJson(['code' => 1, 'msg' => '请输入' . $_CONFIG['account_name'] . $_CONFIG['password_name_suffix']]);
+ if (6 > strlen($password2) || 16 < strlen($password2))
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '长度为6-16个字符']);
+ if ($password2 != $password)
+ returnJson(['code' => 1, 'msg' => '两次输入的' . $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '不一致!']);
+
+ if (!$email)
+ returnJson(['code' => 1, 'msg' => '请输入邮箱地址!']);
+ if (!filter_var($email, FILTER_VALIDATE_EMAIL))
+ returnJson(['code' => 1, 'msg' => '邮箱地址格式错误!']);
+
+ if (!$code)
+ returnJson(['code' => 1, 'msg' => '请输入邮箱验证码!']);
+ if (strlen($code) != $_CONFIG['code_length'])
+ returnJson(['code' => 1, 'msg' => '验证码长度为6位数字!']);
+ break;
+ }
+
+ if (!isset($mySQLi)) {
+ $mySQLi = new mysqli($_CONFIG_DB['db_host'], $_CONFIG_DB['db_user'], $_CONFIG_DB['db_password'], $_CONFIG_DB['db_name'], $_CONFIG_DB['db_port']);
+ if ($mySQLi->connect_errno)
+ returnJson(['code' => 1, 'msg' => $mySQLi->connect_error], $fromMicroClient);
+ $mySQLi->set_charset($_CONFIG_DB['db_charset']);
+ }
+
+ // 限制每日注册数量上限
+ if (1 == $type && $_CONFIG['day_max_reg']) {
+ $stmt2 = $mySQLi->prepare("SELECT id FROM player WHERE reg_ip = ? AND FROM_UNIXTIME(reg_time, '%Y-%m-%d') = CURDATE()");
+ $stmt2->bind_param('s', $ip);
+ $stmt2->execute();
+ $result2 = $stmt2->get_result();
+ $row2 = $result2->fetch_array();
+ $regNum = $result2->num_rows;
+ $result2->free_result();
+ $stmt2->close();
+ if ($regNum >= $_CONFIG['day_max_reg']) {
+ $mySQLi->close();
+ returnJson(['code' => 10, 'msg' => '您今日注册量已达上限,请明日再试~'], $fromMicroClient);
+ }
+ }
+
+ if (2 != $type) {
+ $field = ['id'];
+ if (0 == $type) {
+ $field[] = 'password';
+ }
+ $stmt = $mySQLi->prepare('select ' . implode(', ', $field) . ' from player where username=?');
+ $stmt->bind_param('s', $account);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ }
+
+ // 创建账号
+ if (1 == $type) {
+ if (!empty($row)) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '此' . $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '已被其他勇士占用!请更换。'], $fromMicroClient);
+ }
+
+ // test
+ //returnJson(['code' => 1, 'msg' => 'test register: '.$email], $fromMicroClient);
+
+ if ($email) {
+ // 检查邮箱地址是否被占用
+ $stmt = $mySQLi->prepare('select id from player where email=?');
+ $stmt->bind_param('s', $email);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (!empty($row)) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '此邮箱地址已被其他勇士占用!请更换。', $fromMicroClient]);
+ }
+
+ // 获取验证码记录
+ if ($_CONFIG['code_open'] && $_CONFIG['reg_code_open']) {
+ $stmt = $mySQLi->prepare('select id, code from verify where account=? and email=? and type=?');
+ $stmt->bind_param('ssi', $account, $email, $type);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (empty($row) || $code != $row['code']) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '验证码无效!'], $fromMicroClient);
+ }
+ }
+ }
+
+ $device = isMobile() ? 1 : 0;
+ $os = getOS();
+ $browse = getBrowse();
+
+ //echo $account.', '.$md5Pwd.', '.$email.', '.$device.', '.getOS().', '.getBrowse().', '.$time.', '.$ip;exit;
+
+ $stmt1 = $mySQLi->prepare('insert into `player` (username, password, server_id, email, agent_id, device, os, browse, reg_time, reg_ip) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
+ $stmt1->bind_param('ssisiissis', $account, $md5Pwd, $serverId, $email, $agent_id, $device, $os, $browse, $time, $ip);
+ $stmt1->execute();
+ $rowNum = $stmt1->affected_rows;
+ $stmt1->close();
+ if (0 < $rowNum) {
+ // 删除验证码
+ if ($_CONFIG['code_open'] && $_CONFIG['reg_code_open']) {
+ $stmt = $mySQLi->prepare('DELETE FROM verify WHERE id = ? and type=?');
+ $stmt->bind_param('ii', $row['id'], $type);
+ $stmt->execute();
+ $stmt->close();
+ }
+
+ // 代理人
+ if (0 < $agent_id) {
+ // 检查代理人是否存在
+ $stmt = $mySQLi->prepare('select id from `agent` where id = ?');
+ $stmt->bind_param('i', $agent_id);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ // 如果代理人存在
+ if (!empty($row)) {
+ // 更新代理人邀请统计
+ $stmt = $mySQLi->prepare('UPDATE `agent` SET invite_count = invite_count + 1 WHERE id = ?');
+ $stmt->bind_param('i', $agent_id);
+ $stmt->execute();
+ $stmt->close();
+ }
+ }
+
+ $mySQLi->close();
+
+ setcookie('account', $account, $_CONFIG['session_time']);
+ setcookie('password', $password, $_CONFIG['session_time']);
+ setcookie('token', $md5Pwd, $_CONFIG['session_time']);
+ $_SESSION['account'] = $account;
+ $_SESSION['password'] = $password;
+ $_SESSION['token'] = $md5Pwd;
+
+ $msgLast = '
';
+ $msgLast .= $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . ':' . $account;
+ $msgLast .= '
';
+ $msgLast .= $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . ':' . $password;
+ $msgLast .= '
';
+ $msgLast .= '邮箱地址:' . $email;
+
+ $msg = '恭喜勇士!获得玛法' . $_CONFIG['account_name'] . ',请牢记' . $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '!准备开启玛法之旅..' . (!$fromMicroClient ? $msgLast : '');
+ $resData = [
+ 'code' => 0,
+ 'msg' => $msg,
+ 'token' => $md5Pwd
+ ];
+ if ($fromMicroClient) {
+ $resData['url'] = '/play?account=' . $account . '&token=' . $md5Pwd;
+ }
+ returnJson($resData, $fromMicroClient);
+ } else {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . '获取失败,请重试~'], $fromMicroClient);
+ }
+ } elseif (0 == $type) { // 登录
+ $mySQLi->close();
+ if (empty($row) || $md5Pwd !== $row['password']) {
+ returnJson(['code' => 1, 'msg' => '传送员无法匹配此' . $_CONFIG['account_name'] . ',请检查!'], $fromMicroClient);
+ } else {
+ setcookie('account', $account, $_CONFIG['session_time']);
+ setcookie('password', $password, $_CONFIG['session_time']);
+ setcookie('token', $md5Pwd, $_CONFIG['session_time']);
+ $_SESSION['account'] = $account;
+ $_SESSION['password'] = $password;
+ $_SESSION['token'] = $md5Pwd;
+
+ $resData = ['code' => 0, 'msg' => '欢迎来到清渊传奇,正在传送…', 'token' => $md5Pwd];
+ if ($fromMicroClient) {
+ $resData['url'] = '/play?account=' . $account . '&token=' . $md5Pwd;
+ }
+ returnJson($resData, $fromMicroClient);
+ }
+ } elseif (2 == $type) { // 重置密码
+ if (!$_CONFIG['code_open']) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '验证码系统尚未开启!']);
+ }
+
+ // 检查邮箱地址是否存在
+ $stmt = $mySQLi->prepare('select email from player where username=? and email=?');
+ $stmt->bind_param('ss', $account, $email);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (empty($row)) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '传送员无法匹配此' . $_CONFIG['account_name'] . ',请检查!']);
+ }
+
+ // 检查验证码
+ $stmt = $mySQLi->prepare('select id, code from verify where email=? and type=?');
+ $stmt->bind_param('si', $email, $type);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (empty($row) || $code != $row['code']) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '验证码不正确!']);
+ }
+
+ // 修改密码
+ $stmt = $mySQLi->prepare('UPDATE `player` SET password = ? WHERE username=? and email=?');
+ $stmt->bind_param('sss', $md5Pwd, $account, $email);
+ $stmt->execute();
+ $stmt->close();
+
+ // 删除验证码
+ $stmt = $mySQLi->prepare('DELETE FROM verify WHERE id = ? and type= ?');
+ $stmt->bind_param('ii', $row['id'], $type);
+ $stmt->execute();
+ $stmt->close();
+
+ $mySQLi->close();
+ returnJson(['code' => 0, 'msg' => $_CONFIG['account_name'] . $_CONFIG['password_name_suffix'] . '修改成功!']);
+ }
+ break;
+ case 'getCode': // 发送验证码到邮箱
+ if (!$_CONFIG['code_open']) {
+ returnJson(['code' => 1, 'msg' => '验证码系统尚未开启!']);
+ }
+
+ $type = intval(input('type'));
+ $account = input('account');
+ $email = input('email');
+
+ if (!in_array($type, [1, 2]))
+ returnJson(['code' => 1, 'msg' => '参数错误!请刷新页面重试~']);
+
+ if (!$account)
+ returnJson(['code' => 1, 'msg' => '请输入' . $_CONFIG['account_name'] . $_CONFIG['account_name_suffix']]);
+ if (6 > strlen($account) && !in_array($account, array_unique(explode(',', trim($_CONFIG['admin_account'])))) || 16 < strlen($account))
+ returnJson(['code' => 1, 'msg' => $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '长度为6-16个字符']);
+
+ if (!$email)
+ returnJson(['code' => 1, 'msg' => '请输入邮箱地址!']);
+ if (!filter_var($email, FILTER_VALIDATE_EMAIL))
+ returnJson(['code' => 1, 'msg' => '邮箱地址格式错误!']);
+
+ $ip = get_ip();
+
+ // 检查IP是否被封
+ if ($_CONFIG['deny_ip']) {
+ $deny_ip = array_unique(explode(',', trim($_CONFIG['deny_ip'])));
+ if (!empty($deny_ip) && in_array($ip, $deny_ip)) {
+ returnJson(['code' => 1, 'msg' => '当前未开放访问!']); // 当前IP已禁用
+ }
+ }
+
+ if (1 == $type) {
+ // 是否开放注册
+ if (!$_CONFIG['reg_open']) {
+ returnJson(['code' => 1, 'msg' => '内部测试中,未开放注册,如需体验请联系客服。']);
+ }
+ // 检查保留帐号
+ if ($_CONFIG['retain_account']) {
+ $retain_account = array_unique(explode(',', trim($_CONFIG['retain_account'])));
+ if (!empty($retain_account) && in_array($account, $retain_account)) {
+ returnJson(['code' => 1, 'msg' => '抱歉!此' . $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '已被占用,请更换。']);
+ }
+ }
+ }
+
+ $mySQLi = new mysqli($_CONFIG_DB['db_host'], $_CONFIG_DB['db_user'], $_CONFIG_DB['db_password'], $_CONFIG_DB['db_name'], $_CONFIG_DB['db_port']);
+ if ($mySQLi->connect_errno)
+ returnJson(['code' => 1, 'msg' => $mySQLi->connect_error]);
+ $mySQLi->set_charset($_CONFIG_DB['db_charset']);
+
+ if (1 == $type) {
+ // 限制每日注册数量上限
+ if ($_CONFIG['day_max_reg']) {
+ $stmt2 = $mySQLi->prepare("SELECT id FROM player WHERE reg_ip = ? AND FROM_UNIXTIME(reg_time, '%Y-%m-%d') = CURDATE()");
+ $stmt2->bind_param('s', $ip);
+ $stmt2->execute();
+ $result2 = $stmt2->get_result();
+ $row2 = $result2->fetch_array();
+ $regNum = $result2->num_rows;
+ $result2->free_result();
+ $stmt2->close();
+ if ($regNum >= $_CONFIG['day_max_reg']) {
+ $mySQLi->close();
+ returnJson(['code' => 10, 'msg' => '您今日注册量已达上限,请明日再试~']);
+ }
+ }
+ }
+
+ if (1 == $type) { // 注册时
+ // 检查帐号是否被占用
+ $stmt = $mySQLi->prepare('select id from player where username=?');
+ $stmt->bind_param('s', $account);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (!empty($row)) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '此' . $_CONFIG['account_name'] . $_CONFIG['account_name_suffix'] . '已被其他勇士占用!请更换。']);
+ }
+ // 检查邮箱地址是否被占用
+ $stmt = $mySQLi->prepare('select id from player where email=?');
+ $stmt->bind_param('s', $email);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (!empty($row)) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '此邮箱地址已被其他勇士占用!请更换。']);
+ }
+ } else if (2 == $type) { // 找回密码时:检查帐号和邮箱地址是否存在
+ $stmt = $mySQLi->prepare('select id from player where username=? and email=?');
+ $stmt->bind_param('ss', $account, $email);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+ if (empty($row)) {
+ $mySQLi->close();
+ returnJson(['code' => 1, 'msg' => '传送员无法匹配此' . $_CONFIG['account_name'] . ',请检查!']);
+ }
+ }
+
+ // 获取验证码记录
+ $stmt = $mySQLi->prepare('select id, time from verify where account=? and email=? and type=?');
+ $stmt->bind_param('ssi', $account, $email, $type);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ $row = $result->fetch_array();
+ $result->free_result();
+ $stmt->close();
+
+ $sendInterval = $_CONFIG['code_send_interval'];
+ $nowTime = time();
+ $leftTime = ($sendInterval - ($nowTime - $row['time']));
+
+ // 检查发送时间间隔
+ if (!empty($row) && $nowTime - $row['time'] < $sendInterval) {
+ $mySQLi->close();
+ returnJson([
+ 'code' => 1,
+ 'msg' => '操作频繁!请' . $leftTime . '秒后发送~',
+ 'time' => $leftTime
+ ]);
+ }
+
+ $code = getRandomString($_CONFIG['code_length'], $_CONFIG['code_data_type']);
+
+ if ('email' == $_CONFIG['code_type']) {
+ // 邮件主题
+ $subject = '【' . $_CONFIG['game_name'] . '】' . $typeNames[$type];
+ // 邮件正文
+ $message = '