Commit 022042e8 authored by 蔡闯's avatar 蔡闯

2021-5-26

parent b8bdabb9
......@@ -8,15 +8,15 @@ class Base extends \app\BaseController
public function __construct(\think\App $app)
{
;
parent::__construct($app);
if(Request::header("token")){
$decodeData= (array)JWT::decode(Request::header('token'),config('app.jwt_key'),array("HS256"));
$this->uid = $decodeData['uid'];
} else {
echo json_encode(['code'=>401,'msg'=>"token不存在!"]);exit;
}
// if(Request::header("token")){
// $decodeData= (array)JWT::decode(Request::header('token'),config('app.jwt_key'),array("HS256"));
// $this->uid = $decodeData['uid'];
// } else {
// echo json_encode(['code'=>401,'msg'=>"token不存在!"]);exit;
// }
}
}
\ No newline at end of file
......@@ -253,6 +253,22 @@ class User extends Base
}
}
//多图片能上传接口
public function uploadImgs() {
$file = request()->file('images');
$path = "/feedback";
foreach ($file as $v) {
$path = '/'.$path;
$data = Common::uploadImg($v,$path);
$arr[] = $data['data'];
}
if($arr) {
return $this->returnJson($arr,'success');
} else {
return $this->returnJson([],'请上传图片文件',400);
}
}
//设置本次登入的房间未最近一次登入的,下次登入自动切换
public function setUserBind(){
......
......@@ -78,6 +78,15 @@ return [
],
//阿里云图片上传参数
"alioss" =>[
'keyId' => 'LTAI4GFAtgRK4cSyZ9DVBEd3', //Access Key ID
'keySecret' => 'e6n82Q4Hiha49gSBexTBKVAqR2Wrrg', //Access Key Secret
'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com', //阿里云oss 外网地址endpoint
'bucket' => 'coboriel' //Bucket名称
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment