Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
45e8ada9
authored
Dec 01, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取二维码
parent
b567b75b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
app/Api/Controllers/PatientController.php
+15
-0
config/app.php
+1
-0
routes/api.php
+1
-0
No files found.
app/Api/Controllers/PatientController.php
View file @
45e8ada9
...
...
@@ -9,6 +9,7 @@
use
App\Models\User
;
use
Illuminate\Http\Request
;
use
Jxlwqq\IdValidator\IdValidator
;
use
Milon\Barcode\DNS2D
;
// 问诊人控制器
class
PatientController
extends
BaseApiController
...
...
@@ -186,4 +187,18 @@ public function getDefault(Request $request)
return
$this
->
failed
(
'暂无默认问诊人'
);
}
}
// 获取二维码
public
function
getQrCode
(
Request
$request
)
{
$scene
=
$request
->
input
(
'scene'
);
if
(
!
$scene
)
{
return
$this
->
failed
(
'请传入参数scene~'
);
}
$dns2d
=
new
DNS2D
();
$base64Img
=
'data:image/jpg;base64,'
.
$dns2d
->
getBarcodePNG
(
$scene
,
'QRCODE'
,
200
,
200
);
// return "<img src={$base64Img} >";
return
$this
->
success
(
$base64Img
);
}
}
config/app.php
View file @
45e8ada9
...
...
@@ -170,6 +170,7 @@
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider
::
class
,
App\Providers\RouteServiceProvider
::
class
,
Milon\Barcode\BarcodeServiceProvider
::
class
,
])
->
toArray
(),
/*
...
...
routes/api.php
View file @
45e8ada9
...
...
@@ -21,6 +21,7 @@
// 不需要登录的组
// 小程序静默登录
Route
::
post
(
'login'
,
'App\Api\Controllers\UserController@login'
);
Route
::
get
(
'qrcode'
,
'App\Api\Controllers\PatientController@getQrCode'
);
Route
::
get
(
'test'
,
'App\Api\Controllers\DrugController@test'
);
...
...
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