自定义service、module

This commit is contained in:
2025-06-23 17:39:38 +08:00
parent d12236b125
commit 975a31421b
4 changed files with 77 additions and 4 deletions

6
.gitmodules vendored
View File

@ -1,3 +1,9 @@
[submodule "plugs/think-plugs-staff"]
path = plugs/think-plugs-staff
url = ssh://git@git.jerryyan.net:29022/q792602257/think-plugs-staff.git
[submodule "plugs/think-plugs-recorder"]
path = plugs/think-plugs-recorder
url = ssh://git@git.jerryyan.net:29022/q792602257/think-plugs-recorder.git
[submodule "plugs/think-plugs-notice"]
path = plugs/think-plugs-notice
url = ssh://git@git.jerryyan.net:29022/q792602257/think-plugs-notice.git

31
app/xzgl/Service.php Normal file
View File

@ -0,0 +1,31 @@
<?php
namespace app\xzgl;
use think\admin\Plugin;
class Service extends Plugin
{
protected $appName = '行政管理';
protected $package = 'xzgl';
public static function menu(): array
{
return [
[
'name' => '行政管理',
'subs' => [
['name' => '员工档案', 'icon' => 'layui-icon layui-icon-group', 'url' => 'xzgl/user/index'],
['name' => '通知公告', 'icon' => 'layui-icon layui-icon-cols', 'url' => 'xzgl/notice/index'],
]
],
[
'name' => '证书管理',
'subs' => [
['name' => '证书管理', 'icon' => 'layui-icon layui-icon-auz', 'url' => 'xzgl/staff_cert/index'],
['name' => '证书管理', 'icon' => 'layui-icon layui-icon-auz', 'url' => 'xzgl/company_cert/index'],
]
]
];
}
}

View File

@ -20,15 +20,25 @@
"zoujingli/think-install": true
}
},
"repositories": {
"think-plug-staff": {
"repositories": [
{
"type": "path",
"url": "plugs/think-plugs-staff"
},
{
"type": "path",
"url": "plugs/think-plugs-recorder"
},
{
"type": "path",
"url": "plugs/custom-app-plug"
}
},
],
"require": {
"php": ">=8.3",
"zoujingli/think-plugs-admin": "^1.0",
"q792602257/think-plugs-staff": "dev-master"
"q792602257/custom-app-plug": "dev-master",
"q792602257/think-plugs-staff": "dev-master",
"q792602257/think-plugs-recorder": "dev-master"
}
}

View File

@ -0,0 +1,26 @@
{
"name": "q792602257/custom-app-plug",
"description": "ThinkAdmin Plugin: Add Custom Plugs Located in app",
"version": "dev-master",
"minimum-stability": "dev",
"license": "WTFPL",
"authors": [
{
"name": "Jerry Yan",
"email": "792602257@qq.com"
}
],
"extra": {
"config": {
"type": "module",
"name": "app插件",
"platforms": ["h5web"],
"description": "app目录下的插件定义"
},
"think": {
"services": [
"app\\xzgl\\Service"
]
}
}
}