Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ruer_cms
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蔡闯
ruer_cms
Commits
022042e8
Commit
022042e8
authored
May 26, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2021-5-26
parent
b8bdabb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
app/api/controller/Base.php
app/api/controller/Base.php
+7
-7
app/api/controller/User.php
app/api/controller/User.php
+16
-0
config/app.php
config/app.php
+9
-0
No files found.
app/api/controller/Base.php
View file @
022042e8
...
@@ -8,15 +8,15 @@ class Base extends \app\BaseController
...
@@ -8,15 +8,15 @@ class Base extends \app\BaseController
public
function
__construct
(
\think\App
$app
)
public
function
__construct
(
\think\App
$app
)
{
{
;
parent
::
__construct
(
$app
);
parent
::
__construct
(
$app
);
if
(
Request
::
header
(
"token"
)){
//
if(Request::header("token")){
$decodeData
=
(
array
)
JWT
::
decode
(
Request
::
header
(
'token'
),
config
(
'app.jwt_key'
),
array
(
"HS256"
));
//
$decodeData= (array)JWT::decode(Request::header('token'),config('app.jwt_key'),array("HS256"));
$this
->
uid
=
$decodeData
[
'uid'
];
//
$this->uid = $decodeData['uid'];
}
else
{
//
} else {
echo
json_encode
([
'code'
=>
401
,
'msg'
=>
"token不存在!"
]);
exit
;
//
echo json_encode(['code'=>401,'msg'=>"token不存在!"]);exit;
}
//
}
}
}
}
}
\ No newline at end of file
app/api/controller/User.php
View file @
022042e8
...
@@ -253,6 +253,22 @@ class User extends Base
...
@@ -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
(){
public
function
setUserBind
(){
...
...
config/app.php
View file @
022042e8
...
@@ -78,6 +78,15 @@ return [
...
@@ -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名称
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment