...
|
...
|
@@ -3,7 +3,8 @@ |
|
|
namespace Controller;
|
|
|
|
|
|
use Lib\Mail\Mail;
|
|
|
use Model\email;
|
|
|
use Model\emailSql;
|
|
|
use Model\listsSql;
|
|
|
|
|
|
/**
|
|
|
* @author:dc
|
...
|
...
|
@@ -44,7 +45,7 @@ class Home { |
|
|
Mail::login($formData['email'],$formData['password'],$formData['imap']);
|
|
|
|
|
|
// 是否存在
|
|
|
$id = db()->value(email::hasEmail($formData['email']));
|
|
|
$id = db()->value(emailSql::hasEmail($formData['email']));
|
|
|
|
|
|
$data = [
|
|
|
'password' => base64_encode($formData['password']),
|
...
|
...
|
@@ -58,10 +59,10 @@ class Home { |
|
|
|
|
|
if($id){
|
|
|
// 修改
|
|
|
$ret = db()->update(email::$table,$data,dbWhere(['id'=>$id]));
|
|
|
$ret = db()->update(emailSql::$table,$data,dbWhere(['id'=>$id]));
|
|
|
}else{
|
|
|
// 新增
|
|
|
$ret = db()->insert(email::$table,$data);
|
|
|
$ret = db()->insert(emailSql::$table,$data);
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -76,4 +77,50 @@ class Home { |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 邮件列表
|
|
|
* @author:dc
|
|
|
* @time 2023/2/17 14:12
|
|
|
*/
|
|
|
public function lists(){
|
|
|
$email = db()->first(emailSql::firstByToken(token()));
|
|
|
if(!$email){
|
|
|
app()->e('token_verify_notfound');
|
|
|
}
|
|
|
|
|
|
// 分页 页数
|
|
|
$page = app()->request('page',1,'intval');
|
|
|
$page = $page ? $page : 1;
|
|
|
|
|
|
$lists = db()->all(listsSql::lists($email['id'],$page));
|
|
|
|
|
|
app()->_json(listsPage($lists,100,1,30));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|