信呼v2.5.1版本
This commit is contained in:
@@ -36,7 +36,7 @@ class apiAction extends ActionNot
|
||||
$this->adminname = '';
|
||||
$boss = (M == 'login|api');
|
||||
if(!$boss){
|
||||
if($this->isempt($this->token))$this->showreturn('','token invalid', 199);
|
||||
if(isempt($this->token))$this->showreturn('','token invalid', 199);
|
||||
$lodb = m('login');
|
||||
$onto = $lodb->getone("`uid`='$this->adminid' and `token`='$this->token' and `online`=1");
|
||||
if(!$onto)$this->showreturn('','登录失效,请重新登录', 199);
|
||||
|
||||
@@ -105,8 +105,10 @@ class loginClassAction extends apiAction
|
||||
public function getmaxupAction()
|
||||
{
|
||||
$maxup = c('upfile')->getmaxzhao();
|
||||
$upkey = md5('upkey'.time().$this->jm->getRandkey());
|
||||
$this->showreturn(array(
|
||||
'maxup' => $maxup
|
||||
'maxup' => $maxup,
|
||||
'upkey' => $upkey
|
||||
));
|
||||
}
|
||||
|
||||
@@ -268,4 +270,26 @@ class loginClassAction extends apiAction
|
||||
'logo' => 'images/logo.png'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第三方上传图片地址
|
||||
*/
|
||||
public function upimagepathAction()
|
||||
{
|
||||
$fileid = (int)$this->get('fileid');
|
||||
$fid = $this->get('fid');
|
||||
$adddt = date('Y-m-d H:i:s', time()-20);
|
||||
$frs = m('file')->getone("`id`='$fileid' and `adddt`>'$adddt'");
|
||||
if(!$frs)return returnerror('404');
|
||||
$path = '';
|
||||
if(!isempt($frs['thumbplat'])){
|
||||
$path = str_replace('_s.','.',$frs['thumbplat']);
|
||||
}
|
||||
$filepathout = arrvalue($frs,'filepathout');
|
||||
if($filepathout)$path = $filepathout;
|
||||
return returnsuccess(array(
|
||||
'path' => $path,
|
||||
'fid' => $fid,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class uploadClassAction extends apiAction
|
||||
$upses = $upimg->up('file');
|
||||
if(!is_array($upses))exit($upses);
|
||||
$arr = c('down')->uploadback($upses);
|
||||
$arr['autoup'] = getconfig('qcloudCos_autoup') ? 1 : 0; //是否上传其他平台
|
||||
$arr['autoup'] = (getconfig('qcloudCos_autoup') || getconfig('alioss_autoup')) ? 1 : 0; //是否上传其他平台
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
|
||||
25
webmain/task/api/uploawAction.php
Normal file
25
webmain/task/api/uploawAction.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
class uploawClassAction extends apiAction
|
||||
{
|
||||
public function initAction()
|
||||
{
|
||||
$this->display= false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
public function upfileAction()
|
||||
{
|
||||
if(!$_FILES)exit('sorry!');
|
||||
$upimg = c('upfile');
|
||||
$maxsize= (int)$this->get('maxsize', $upimg->getmaxzhao());//上传最大M
|
||||
$uptypes= 'jpg|png|docx|doc|pdf|xlsx|xls|zip|rar';
|
||||
$upimg->initupfile($uptypes, ''.UPDIR.'|'.date('Y-m').'', $maxsize);
|
||||
$upses = $upimg->up('file');
|
||||
if(!is_array($upses))exit($upses);
|
||||
$arr = c('down')->uploadback($upses);
|
||||
$arr['autoup'] = (getconfig('qcloudCos_autoup') || getconfig('alioss_autoup')) ? 1 : 0; //是否上传其他平台
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user