diff --git a/.gitignore b/.gitignore
index a89b5b49c..bb5546f89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
-/app/cms
/app/mocms
/app/curd
/app/test
/app/demo
+/app/wechat
/.idea
/.vscode
/.DS_Store
@@ -16,3 +16,5 @@
/public/static/mocms
/public/static/curd
/public/static/storage
+/.trae
+/.cursor
diff --git a/README.md b/README.md
index f6c456669..ac000cda5 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
@@ -15,10 +53,10 @@ funadmin前端和webman开发的后台管理系统
-
+
-
+
@@ -54,7 +92,7 @@ funadmin前端和webman开发的后台管理系统
## 项目介绍
-FunAdmin 基于thinkphp8.X +Layui2.9.*+requirejs开发权限(RBAC)管理框架,框架中集成了权限管理、模块管理、插件管理、后台支持多主题切换、配置管理、会员管理等常用功能模块,以方便开发者快速构建自己的应用。框架专注于为中小企业提供最佳的行业基础后台框架解决方案,执行效率、扩展性、稳定性值得信赖,操作体验流畅,使用非常优化,欢迎大家使用及进行二次开发。
+FunAdmin 基于thinkphp8.X +Layui2.11.*+requirejs开发权限(RBAC)管理框架,框架中集成了权限管理、模块管理、插件管理、后台支持多主题切换、配置管理、会员管理等常用功能模块,以方便开发者快速构建自己的应用。框架专注于为中小企业提供最佳的行业基础后台框架解决方案,执行效率、扩展性、稳定性值得信赖,操作体验流畅,使用非常优化,欢迎大家使用及进行二次开发。
+ 支持ThinkPHP 持续升级框架底层;跟随官网脚步
+ 这是一个有趣的后台管理系统,这是可以让你节约时间的系统
@@ -67,7 +105,7 @@ FunAdmin 基于thinkphp8.X +Layui2.9.*+requirejs开发权限(RBAC)管理框架
+ 内置 `CURD` 命令行模式,帮助助您快速开发系统
+ 模块化:全新的架构和模块化的开发机制,便于灵活扩展和二次开发。
+ 强大的表单管理,只需要使用函数即可成就表单
-+ layui采用最新layui2.9.X 框架
++ layui采用最新layui2.11.X 框架
+ 适用范围:可以开发OA、ERP、BPM、CRM、WMS、TMS、MIS、BI、电商平台后台、物流管理系统、快递管理系统、教务管理系统等各类管理软件。
+ require.js 模块化开发 一个命令即可打包js,css ; node r.js -o min-backend.js
+ restful api 接口,接口使用jwt接口验证等
@@ -76,7 +114,7 @@ FunAdmin 基于thinkphp8.X +Layui2.9.*+requirejs开发权限(RBAC)管理框架
## 环境要求:
* 开启静态重写 (必须)
-* PHP >= 8.0
+* PHP >= 8.1
* PDO PHP Extension
* MBstring PHP Extension
* CURL PHP Extension
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 000000000..7415724df
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1,3 @@
+/.idea
+/.vscode
+/.DS_Store
\ No newline at end of file
diff --git a/app/BaseController.php b/app/BaseController.php
index f61b4244f..6dd80cbf9 100644
--- a/app/BaseController.php
+++ b/app/BaseController.php
@@ -23,6 +23,10 @@
*/
abstract class BaseController
{
+
+ protected array $noNeedLogin = [];
+
+ protected array $onlyNeedLogin = [];
/**
* Request实例
* @var \think\Request
@@ -73,7 +77,7 @@ protected function initialize()
* 验证数据
* @access protected
* @param array $data 数据
- * @param string|array $validate 验证器名或者验证规则数组
+ * @param mixed $validate 验证器名或者验证规则数组
* @param array $message 提示信息
* @param bool $batch 是否批量验证
* @return array|string|true
diff --git a/app/api/.DS_Store b/app/api/.DS_Store
new file mode 100644
index 000000000..4c8ab94e1
Binary files /dev/null and b/app/api/.DS_Store differ
diff --git a/app/api/controller/v1/ApiTest.php b/app/api/controller/v1/ApiTest.php
deleted file mode 100644
index 0ee886d4a..000000000
--- a/app/api/controller/v1/ApiTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-success('ok');
-
- }
-
-}
diff --git a/app/api/controller/v1/Member.php b/app/api/controller/v1/Member.php
deleted file mode 100644
index 50cd9aa44..000000000
--- a/app/api/controller/v1/Member.php
+++ /dev/null
@@ -1,102 +0,0 @@
-success('ok',['member_id'=>$this->member_id]);
- //通用参数验证
- }
-
- /**
- * 显示创建资源表单页.
- *
- * @return \think\Response
- */
- public function create()
- {
- echo "create";
- }
-
- /**
- * 保存新建的资源
- *
- * @param \think\Request $request
- * @return \think\Response
- */
- public function save(Request $request)
- {
- echo "save";
- }
-
- /**
- * 显示指定的资源
- *
- * @param int $id
- * @return \think\Response
- */
- public function read($id)
- {
- echo "read";
- }
-
- /**
- * 显示编辑资源表单页.
- *
- * @param int $id
- * @return \think\Response
- */
- public function edit($id)
- {
- echo "edit";
- }
-
- /**
- * 保存更新的资源
- *
- * @param \think\Request $request
- * @param int $id
- * @return \think\Response
- */
- public function update(Request $request, $id)
- {
- echo "update";
- }
-
- /**
- * 删除指定资源
- *
- * @param int $id
- * @return \think\Response
- */
- public function delete($id)
- {
- echo "delete";
- }
-
-
- public function address($id)
- {
- echo "address-";
- }
-}
diff --git a/app/api/controller/v1/Token.php b/app/api/controller/v1/Token.php
deleted file mode 100644
index c334fd5e7..000000000
--- a/app/api/controller/v1/Token.php
+++ /dev/null
@@ -1,42 +0,0 @@
-type).'Token');
- $token = $class::instance();
- $token->build();
-
- }
- public function refresh(Request $request)
- {
- $class = ucwords('\\fun\\auth\\'.ucfirst($this->type).'Token');
- $token = $class::instance();
- $token->refresh();
-
- }
-
-}
diff --git a/app/api/controller/v2/Member.php b/app/api/controller/v2/Member.php
new file mode 100644
index 000000000..233192b6b
--- /dev/null
+++ b/app/api/controller/v2/Member.php
@@ -0,0 +1,36 @@
+success('ok',['user'=>$request->member]);
+ }
+
+
+ public function userinfo(Request $request)
+ {
+ $this->success('ok',['user'=>$request->member]);
+ }
+ public function verify(Request $request)
+ {
+ $this->success('成功');
+
+ }
+}
\ No newline at end of file
diff --git a/app/api/controller/v2/Token.php b/app/api/controller/v2/Token.php
new file mode 100644
index 000000000..698789921
--- /dev/null
+++ b/app/api/controller/v2/Token.php
@@ -0,0 +1,103 @@
+tokenService = TokenService::instance();
+ //跨域
+ header('Access-Control-Allow-Origin:*');
+ header('Access-Control-Allow-Headers:Accept,Referer,Host,Keep-Alive,User-Agent,X-Requested-With,Cache-Control,Content-Type,Cookie,token');
+ header('Access-Control-Allow-Credentials:true');
+ header('Access-Control-Allow-Methods:GET, POST, PATCH, PUT, DELETE,OPTIONS');
+ if(!$app->request->isPost()){
+ $this->error(__('Page not find'),[],404);
+ }
+ }
+
+ /**
+ * 获取token
+ * @param Request $request
+ * @return void
+ * @throws \think\db\exception\DataNotFoundException
+ * @throws \think\db\exception\DbException
+ * @throws \think\db\exception\ModelNotFoundException
+ */
+ public function build(Request $request)
+ {
+ $username = $request->post('username');
+ $password = $request->post('password');
+ // 这里应该有用户验证逻辑,例如查询数据库验证用户名和密码
+ // 为了示例,假设验证通过
+ $member = \app\common\model\Member::where('status', 1)
+ ->where('username', $username)
+ ->whereOr('mobile', $username)
+ ->whereOr('email', $username)
+ ->field('id ,nickname,username,password')
+ ->limit(1)
+ ->find();
+ if ($member) {
+ $member = $member->toArray();
+ if (password_verify($password, $member['password'])) {
+ unset($member['password']);
+ $accessToken = $this->tokenService->build($member);
+ $refreshToken = $this->tokenService->build($member, 'refresh');
+ $this->success(__('Tokens generated successfully'), [
+ 'access_token' => $accessToken,
+ 'refresh_token' => $refreshToken,
+ 'expires_in' => config('api.access_token_ttl'),
+ ]);
+ } else {
+ $this->error(lang('Password is not right'), [], 401);
+ }
+ } else {
+ $this->error(lang('Account is not exist'), [], 401);
+ }
+ }
+
+
+
+ /**
+ * @param Request $request
+ * @return \think\response\Json
+ */
+ public function refresh(Request $request){
+ // 获取 Authorization 头
+ if(input('access_token')){
+ $refreshToken = input('access_token');
+ }else{
+ $authHeader = $request->header('Authorization');
+ if (!$authHeader || !preg_match('/Bearer\s(\S+)/', $authHeader, $matches)) {
+ $this->error(__('Unauthorized'), [], 401);
+ }
+ $refreshToken = $matches[1];
+ }
+ // 验证 refresh_token
+ $userData = $this->tokenService->validateToken($refreshToken, 'refresh');
+ if (!$userData) {
+ $this->error(__('Invalid refresh token'), [], 401);
+ }
+ // 生成新的 access_token
+ $newAccessToken = $this->tokenService->build($userData, config('api.access_token_ttl', 3600*2));
+ $this->success(__('Access token refreshed successfully'), [
+ 'access_token' => $newAccessToken,
+ ]);
+ }
+
+}
diff --git a/app/api/middleware.php b/app/api/middleware.php
index dfbb96293..a331b565e 100644
--- a/app/api/middleware.php
+++ b/app/api/middleware.php
@@ -13,9 +13,9 @@
return [
- \think\middleware\LoadLangPack::class,
+ \think\middleware\LoadLangPack::class,
- \think\middleware\SessionInit::class,
+ \think\middleware\SessionInit::class,
//访问频率
// \think\middleware\Throttle::class,
//跨域
diff --git a/app/api/route/api.php b/app/api/route/api.php
index 0c5dab1dc..c43fe5d78 100644
--- a/app/api/route/api.php
+++ b/app/api/route/api.php
@@ -13,6 +13,7 @@
use think\facade\Route;
////一般路由规则,访问的url为:v1/member/1,对应的文件为member类下的index方法
Route::get(':version/member/index','api/:version.member/index');
+Route::get(':version/member/userinfo','api/:version.member/userinfo');
//
////资源路由,详情查看tp手册资源路由
//Route::resource(':version/member','api/:version.member');
diff --git a/app/backend/.DS_Store b/app/backend/.DS_Store
new file mode 100644
index 000000000..65104179d
Binary files /dev/null and b/app/backend/.DS_Store differ
diff --git a/app/backend/controller/Addon.php b/app/backend/controller/Addon.php
index 2d74446e9..f834d1c75 100644
--- a/app/backend/controller/Addon.php
+++ b/app/backend/controller/Addon.php
@@ -13,9 +13,6 @@
namespace app\backend\controller;
-use app\backend\middleware\CheckRole;
-use app\backend\middleware\SystemLog;
-use app\backend\middleware\ViewNode;
use app\backend\service\AddonService;
use app\common\controller\Backend;
use app\common\service\AuthCloudService;
@@ -30,7 +27,6 @@
use app\common\annotation\NodeAnnotation;
use think\facade\Console;
use think\facade\Cookie;
-
/**
* @ControllerAnnotation(title="插件管理")
* Class Addon
@@ -39,26 +35,26 @@
class Addon extends Backend
{
- protected $middleware = [
- CheckRole::class =>['except'=>['enlang','verify','logout']],
- ViewNode::class,
- SystemLog::class
- ];
- protected $addonService;
- protected $authCloudService;
- protected $app_version;
+ protected array $noNeedLogin = ['enlang','verify','logout'];
+ /**
+ * @var AddonService
+ */
+ protected AddonService $addonService;
+ /**
+ * @var AuthCloudService
+ */
+ protected AuthCloudService $authCloudService;
+ protected mixed $app_version;
public function __construct(App $app)
{
parent::__construct($app);
$this->modelClass = new AddonModel();
- $this->addonService = new AddonService();
- $this->authCloudService = AuthCloudService::instance();
+ $this->addonService = app(AddonService::class);
+ $this->authCloudService = app(AuthCloudService::class);
$this->app_version = config('funadmin.version');
}
-
-
/**
* @NodeAnnotation(title="列表")
* @return mixed|\think\response\Json|\think\response\View
@@ -66,24 +62,23 @@ public function __construct(App $app)
public function index()
{
if ($this->request->isAjax()) {
+
if($this->request->isPost()){
- //登录请求
- $data = $this->request->post();
- $this->authCloudService->setUserParams($data);
- $result = $this->authCloudService->setApiUrl('')->setMethod('post')
- ->setParams($this->authCloudService->getUserParams())
- ->run();
- if ($result['code'] == 200) {
- $this->authCloudService->setAuth($result['data']);
- $member = $this->authCloudService->setApiUrl('api/v1.member/get')->setMethod('get')
- ->setParams([])->setHeader([$this->authCloudService->authorization=>$result['data']['access_token']])->run();
- $this->authCloudService->setMember($member['data']);
- $this->success(lang('login successful'),'',$member['data']);
- } else {
- $this->error(lang('Login failed:' . $result['msg']));
+ try {
+ $data = $this->request->post();
+ // 获取访问令牌
+ $tokenResult = $this->authCloudService->getAccessToken($data);
+ // 获取用户信息
+ $member = $this->authCloudService->getMemberInfo($tokenResult['access_token']);
+ // 设置用户信息并返回成功
+ $this->authCloudService->setMember($member);
+ } catch (Exception $e) {
+ $this->error(lang('Login failed:' . $e->getMessage()));
}
+ $this->success( lang( 'login successful'),'',$member);
+
}else{
- $param = $this->request->param();
+ $param = input();
list($this->page, $this->pageSize,$sort,$where) = $this->buildParames();
if($where){foreach($where as $k=>$v){$map[$v[0]] = trim($v[2],'%');}}
if(empty($param['cateid'])){
@@ -95,25 +90,23 @@ public function index()
$map['page'] = $param['page'];
$map['limit'] = $param['limit'];
unset($map['status']);
- $auth = $this->authCloudService->setApiUrl('api/v1.plugins/getList')->setMethod('GET')
- ->setParams($map);
- if($this->authCloudService->getAuth()){
- $res = $auth->setHeader()->run();
- }else{
- $res = $auth->run();
- }
+ $res = $this->authCloudService
+ ->setApiUrl('/api/v2.plugins/getList')
+ ->setParams($map)
+ ->setHeader()
+ ->run();
$list = [];
$addonNameArr = [];
$addonNameArrAll = [];
$count = 1;
- if($res['code']==200){
+ if (isset($res['code']) && $res['code'] == 200) {
$list = $res['data']['list'];
$allList = $res['data']['allList'];
$addonNameArr = $res['data']['searchNameList'];
$addonNameArrAll = $res['data']['nameList'];
$count = count($addonNameArr);
- }else if($res['code']==401){
- Cookie::set('auth_account','');
+ }else if(isset($res['code']) && $res['code']==401){
+ $this->authCloudService->setToken()->setMember();
}
list($localAddons,$localNameArr) = $this->getLocalAddons();
try {
@@ -180,18 +173,18 @@ public function index()
unset($value);
$result = ['code' => 0, 'msg' => lang('Get Data Success'),
'data' => $addons, 'count' => $count];
- }catch (\Exception $e){
+ }catch (Exception $e){
$this->error($e->getMessage());
}
return json($result);
}
}
- $res = $this->authCloudService->setApiUrl('api/v1.plugins/cateList')->setMethod('GET')
+ $res = $this->authCloudService
+ ->setApiUrl('/api/v2.plugins/cateList')
->setParams([])->run();
$cateList = $res['data']??[];
$account = $this->authCloudService->getMember();
- return view('',[
- 'auth'=>$account?1:0, 'account'=>$account,'cateList'=>$cateList]);
+ return view('',['auth'=>$account?1:0, 'account'=>$account,'cateList'=>$cateList]);
}
/**
@@ -202,7 +195,7 @@ public function add(){
if($this->request->isAjax()){
$post = $this->request->post();
$arr = [];
- if(is_numeric($post['name'])) $this->error(lang('The plugin name cannot be a number'));
+ if(is_numeric($post['app'])) $this->error(lang('The plugin name cannot be a number'));
foreach ($post as $k => $v) {
if ($k == '__token__') continue;
@@ -235,10 +228,10 @@ public function add(){
public function install(string $name='',string $type='')
{
set_time_limit(0);
- $name = $this->request->param("name")??$name;
- $plugins_id = $this->request->param("plugins_id");
- $version_id = $this->request->param("version_id");
- $type = $this->request->param("type")??$type;
+ $name = input("name")??$name;
+ $plugins_id = input("plugins_id",0);
+ $version_id = input("version_id",0);
+ $type = input("type")??$type;
// 插件名是否为空
if (!$name) {
$this->error(lang('addon %s can not be empty', [$name]));
@@ -269,7 +262,7 @@ public function localinstall()
if($file && file_exists('.'.$file)){
try {
$res = ZipHelper::unzip('.'.$file,'../addons');
- }catch (\Exception $e){
+ }catch (Exception $e){
$this->error($e->getMessage());
}
if($res){
@@ -283,93 +276,38 @@ public function localinstall()
}
/**
* @NodeAnnotation(title="卸载")
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
+ * @throws \think\dbException\DataNotFoundException
+ * @throws \think\dbException\DbException
+ * @throws \think\dbException\ModelNotFoundException
*/
public function uninstall()
{
set_time_limit(0);
- $name = $this->request->param("name");
- if (!$name) {
- $this->error(lang(' addon name can not be empty'));
- }
- //插件名匹配
- if (!preg_match("/^[a-zA-Z0-9]+$/", $name)) {
- $this->error(lang('addon name is not right'));
- }
- //获取插件信息
- $info = $this->modelClass->withTrashed()->where('name', $name)->find();
- if (empty($info)) {
- $this->error(lang('addon is not exist'));
- }
- if($info->status==1){
- $this->error(lang('Please disable addons %s first',[$name]));
- }
- if (!$info->delete(true)) {
- $this->error(lang('addon uninstall fail'));
- }
- //卸载插件
- $class = get_addons_instance($name);
- $class->uninstall();
- //删除菜单
- $menu_config=get_addons_menu($name);
+ $name = input("name");
try {
- if(!empty($menu_config)){
- list($menu,$pid) = $this->getMenu($menu_config);
- $this->addonService->delAddonMenu($menu,$name);
- }
- //卸载sql;
- uninstallsql($name);
+ $this->addonService->uninstallAddon($name);
}catch (Exception $e){
$this->error($e->getMessage());
}
- //还原文件
- Service::removeApp($name,$delete= true);
- Service::updateAddonsInfo($name,1,0);
- try {
- //刷洗addon文件和配置
- refreshaddons();
- }catch (\Exception $e){
- $this->error($e->getMessage());
- }
$this->success(lang('Uninstall successful'));
}
/**
* @NodeAnnotation (title="禁用启用")
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
+ * @throws \think\dbException\DataNotFoundException
+ * @throws \think\dbException\DbException
+ * @throws \think\dbException\ModelNotFoundException
*/
public function modify()
{
- $name = $this->request->param("name");
+ $name = input("name");
if (!preg_match("/^[a-zA-Z0-9]+$/", $name)) {
$this->error(lang('addon name is not right'));
}
- $info = $this->modelClass->where('name',$name)->find();
- $addoninfo = get_addons_info($name);
- $addoninfo['status'] = $addoninfo['status']?0:1;
try {
- $info->status =$addoninfo['status'];
- Service::updateAddonsInfo($name,$addoninfo['status']);
- // 安装菜单
- $class = get_addons_instance($name);
- $menu_config = get_addons_menu($name);
- if(!empty($menu_config)){
- list($menu,$pid) = $this->getMenu($menu_config);
- if( $addoninfo['status']){
- $this->addonService->addAddonMenu($menu,$pid,$name);
- }else{
- $this->addonService->delAddonMenu($menu,$name);
- }
- }
- refreshaddons();
- $info->save();
- $addoninfo['status']==1 ?$class->enabled():$class->disabled();
- }catch (\Exception $e){
- $this->error(lang($e->getMessage()));
+ $this->addonService->modifyAddon($name);
+ } catch (\Exception $e) {
+ $this->error($e->getMessage());
}
$this->success(lang('operation success'));
}
@@ -378,9 +316,9 @@ public function modify()
* @NodeAnnotation (title="插件配置")
* @return \think\response\View
* @throws Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
+ * @throws \think\dbException\DataNotFoundException
+ * @throws \think\dbException\DbException
+ * @throws \think\dbException\ModelNotFoundException
*/
public function config()
{
@@ -389,7 +327,7 @@ public function config()
$one = $this->modelClass->find($id);
$config = get_addons_config($name);
if ($this->request->isAjax()) {
- $params = $this->request->param('params/a',[],'trim');
+ $params = input('params/a',[],'trim');
if ($params) {
foreach ($config as $k => &$v) {
if (isset($params[$k])) {
@@ -425,6 +363,9 @@ public function config()
$class->config();
}
set_addons_config($name,$config);
+ if(!empty($config['app_rewrite']['content'])) {
+ set_app_route($name, $config['app_rewrite']['content']);
+ }
refreshaddons();
$this->success(lang('operation success'));
}else{
@@ -443,7 +384,7 @@ public function config()
$this->error(lang('addon config is not found'));
}
//模板引擎初始化
- $view = ['formData'=>$config,'title'=>$one->name];
+ $view = ['formData'=>$config,'title'=>$one['name']];
$configFile = app()->getRootPath() . 'addons' . DS . $name . DS . 'config.html';
$viewFile = file_exists($configFile) ? $configFile : '';
//重新加载引擎
@@ -451,22 +392,7 @@ public function config()
return view($viewFile,$view);
}
- /**
- * @NodeAnnotation (title="是否安装")
- * @param $name
- * @return array|false|\think\Model|null
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function isInstall($name)
- {
- if (empty($name)) {
- return false;
- }
- $addons = $this->modelClass->withTrashed()->where('name', $name)->find();
- return $addons;
- }
+
/**
* 获取插件列表
@@ -486,13 +412,13 @@ protected function getLocalAddons(){
* @param string $type
* @return true
* @throws Exception
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
+ * @throws \think\dbException\DataNotFoundException
+ * @throws \think\dbException\DbException
+ * @throws \think\dbException\ModelNotFoundException
*/
protected function doInstall(string $name,int $plugins_id=0,int $version_id=0,string $type=''){
//检查插件是否安装
- $list = $this->isInstall($name);
+ $list = $this->addonService->isInstall($name);
if ($list && $list->status==1) {
$this->error(lang('addons %s is already installed', [$name]));
}
@@ -500,65 +426,26 @@ protected function doInstall(string $name,int $plugins_id=0,int $version_id=0,st
//本地存在空和更新则请求后端
if(empty($type) || $type=='upgrade'){
//不存在或者
- $postData = $this->getCloundData($name,$plugins_id,$version_id);
+ $postData = $this->getCloudData($name,$plugins_id,$version_id);
if(!$localNameArr || !in_array($name,$localNameArr) || !isset($addons[$name])
){
- $this->getCloundAddons($postData);
+ try {
+ $this->getCloudAddons($postData);
+ } catch (Exception $e) {
+ $this->error($e->getMessage());
+ }
}
if($type =='upgrade'){
- $this->getCloundAddons($postData);
- }
- }
- $class = get_addons_instance($name);
- if (empty($class)) {
- $this->error(lang('addons %s is not ready', [$name]));
- }
- $addon_info = get_addons_info($name);
- if(!empty($addon_info['depend'])){
- $depend = explode(',',$addon_info['depend']);
- foreach ($depend as $v) {
- $dependAddon = get_addons_info($v);
- if(empty($dependAddon)){
- $this->error('Please install the dependent plugin first: '.$addon_info['depend']);
+ try {
+ $this->getCloudAddons($postData);
+ } catch (Exception $e) {
+ $this->error($e->getMessage());
}
}
}
- //添加数据库
- try{
- if($type!='upgrade'){
- importsql($name);
- }
- } catch (Exception $e){
- $this->error($e->getMessage());
- }
-
- // 安装菜单
- $menu_config=get_addons_menu($name);
- if(!empty($menu_config)){
- list($menu,$pid) = $this->getMenu($menu_config);
- $this->addonService->addAddonMenu($menu,$pid,$name);
- }
-
- //安装插件
- $class->install();
- $addon_info['status'] = 1;
- if($list){
- if($list->delete_time > 0){
- $this->modelClass->restore(['id'=>$list->id]);
- }
- $res = $this->modelClass->update(['status'=>1],['id'=>$list->id]);
- }else{
- $res = $this->modelClass->save($addon_info);
- }
- if (!$res) {
- $this->error(lang('addon install fail'));
- }
- Service::copyApp($name,$delete = true);
try {
- Service::updateAddonsInfo($name);
- //刷新addon文件
- refreshaddons();
- }catch (\Exception $e){
+ $this->addonService->installAddon($name,$type);
+ } catch (Exception $e) {
$this->error($e->getMessage());
}
Cache::clear();
@@ -567,14 +454,14 @@ protected function doInstall(string $name,int $plugins_id=0,int $version_id=0,st
/**
* 更新 先卸载插件
* @return bool
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
+ * @throws \think\dbException\DataNotFoundException
+ * @throws \think\dbException\DbException
+ * @throws \think\dbException\ModelNotFoundException
*/
protected function doUpgrade(string $name='')
{
set_time_limit(0);
- $name = $name?:$this->request->param("name");
+ $name = $name?:input("name");
//获取插件信息
$info = $this->modelClass->withTrashed()->where('name', $name)->find();
if($info && $info->status==1){
@@ -590,7 +477,7 @@ protected function doUpgrade(string $name='')
$menu_config=get_addons_menu($name);
try {
if(!empty($menu_config)){
- list($menu,$pid) = $this->getMenu($menu_config);
+ list($menu,$pid) = $this->addonService->getMenu($menu_config);
$this->addonService->delAddonMenu($menu,$name);
}
//为了防止文件误删,这里先不卸载sql
@@ -602,30 +489,40 @@ protected function doUpgrade(string $name='')
if(file_exists($sql)){
importSqlData($sql);
}
+ $sql = root_path().'addons/'.$name.'/'.'update.sql';
+ if(file_exists($sql)){
+ importSqlData($sql);
+ }
Service::updateAddonsInfo($name,1,0);
try {
//刷新addon文件和配置
refreshaddons();
- }catch (\Exception $e){
+ }catch (Exception $e){
$this->error($e->getMessage());
}
return true;
}
/**
- * 获取远程安装包
- * @param $params
+ * @param array $params
* @return void
- * @throws \Exception
+ * @throws Exception
*/
- protected function getCloundAddons(array $params=[]){
- $res = $this->authCloudService->setApiUrl('api/v1.plugins/down')->setMethod('GET')
- ->setParams($params)->setHeader()->setOptions()->run();
- if($res['code'] == 401){
- Cookie::delete('auth_account');
- $this->error(lang('please login aigin'));
- }
- if($res['code']!=200){
+ protected function getCloudAddons(array $params=[]): void
+ {
+ $res = $this->authCloudService
+ ->setApiUrl('/api/v2.plugins/down')
+ ->setParams($params)
+ ->setHeader()
+ ->run();
+ if(empty($res)){
+ $this->error(lang('Api request error'));
+ }
+ if(isset($res['code']) && $res['code'] == 401){
+ $this->authCloudService->setToken()->setMember();
+ $this->error(lang('please login again'));
+ }
+ if(isset($res['code']) && $res['code']!=200){
$url = '';
if(!empty($res['data']['url'])) {
$url = $res['data']['url'];
@@ -658,7 +555,8 @@ protected function getCloundAddons(array $params=[]){
* @param $version_id
* @return array
*/
- protected function getCloundData(string $name,int $plugins_id=0,int $version_id=0){
+ protected function getCloudData(string $name,int $plugins_id=0,int $version_id=0): array
+ {
return [
'plugins_id'=>$plugins_id,
'name'=>$name,
@@ -667,6 +565,7 @@ protected function getCloundData(string $name,int $plugins_id=0,int $version_id
'app_version'=>$this->app_version,
"ip" => request()->ip(),
"domain" => request()->domain(),
+ "access_token" => $this->authCloudService->getToken(),
];
}
/**
@@ -674,47 +573,8 @@ protected function getCloundData(string $name,int $plugins_id=0,int $version_id
* @return void
*/
public function logout(){
- Cookie::delete('auth_account');
- Cookie::delete('clound_account');
+ $this->authCloudService->setToken()->setMember();
$this->success(lang('logout success'));
}
-
- /**
- * 获取菜单
- * @param $menu
- * @return void
- */
- protected function getMenu($config = [])
- {
- $is_nav = $config['is_nav']??1;
- $menuArr = $config['menu'];
- $menu = [];
- if(!empty($menuArr[0]) && is_array($menuArr[0])){
- foreach ($menuArr as $value) {
- if($is_nav==-1){
- $menu = array_merge($menu,$value['menulist']);
- $pid = 0;
- }elseif($is_nav==0){
- $menu[] = $value;
- $pid = $this->addonService->addAddonManager()->id;
- }else{
- $menu[] = $value;
- $pid = 0;
- }
- }
- }else{
- if($is_nav==-1){
- $menu = array_merge($menu,$menuArr['menulist']);
- $pid = 0;
- }elseif($is_nav==0){
- $menu[] = $menuArr;
- $pid = $this->addonService->addAddonManager()->id;
- }else{
- $menu[] = $menuArr;
- $pid = 0;
- }
- }
- return [$menu,$pid];
- }
}
diff --git a/app/backend/controller/Ajax.php b/app/backend/controller/Ajax.php
index 1fd3146d1..ac39e695b 100644
--- a/app/backend/controller/Ajax.php
+++ b/app/backend/controller/Ajax.php
@@ -13,7 +13,6 @@
namespace app\backend\controller;
-use app\backend\middleware\CheckRole;
use app\backend\middleware\SystemLog;
use app\backend\middleware\ViewNode;
use app\backend\model\AuthRule;
@@ -29,21 +28,16 @@
class Ajax extends Backend
{
- protected $middleware = [
- CheckRole::class=>['only'=>[]],
- ViewNode::class,
- SystemLog::class
- ];
+
+ protected array $onlyNeedLogin = ['uploads'];
public function __construct(App $app)
{
$this->modelClass = new AttachModel();
parent::__construct($app);
}
+
/**
* @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
* 文件上传总入口 集成qiniu ali tenxunoss
*/
public function uploads()
@@ -52,7 +46,7 @@ public function uploads()
$upload = UploadService::instance();
$result = $upload->uploads(0,session('admin.id'));
return json($result);
- } catch (Exception $e) {
+ } catch (\Exception $e) {
$this->error($e->getMessage());
}
}
@@ -69,8 +63,8 @@ public function refreshmenu()
->where('type',1)
->order('sort asc')
->select()->toArray();
- $menulsit = AuthService::instance()->menuhtml($cate);
- $this->success('ok','',$menulsit);
+ $menuList = AuthService::instance()->menuhtml($cate);
+ $this->success('ok','',$menuList);
}
/**
* @return \think\response\Jsonp
diff --git a/app/backend/controller/Index.php b/app/backend/controller/Index.php
index 86487a63e..6479cf459 100644
--- a/app/backend/controller/Index.php
+++ b/app/backend/controller/Index.php
@@ -13,7 +13,6 @@
namespace app\backend\controller;
-use app\backend\middleware\CheckRole;
use app\backend\middleware\SystemLog;
use app\backend\middleware\ViewNode;
use app\backend\model\AuthRule;
@@ -29,11 +28,9 @@
class Index extends Backend
{
- protected $middleware = [
- CheckRole::class=>['except'=>['console','logout']],
- ViewNode::class,
- SystemLog::class
- ];
+
+ protected array $noNeedLogin = ['console','logout'];
+
protected $layout = '';
/**
* @return string
diff --git a/app/backend/controller/Login.php b/app/backend/controller/Login.php
index 9fc175465..576887b11 100644
--- a/app/backend/controller/Login.php
+++ b/app/backend/controller/Login.php
@@ -11,35 +11,36 @@
* Date: 2017/8/2
*/
namespace app\backend\controller;
-use app\backend\middleware\CheckRole;
use app\backend\middleware\SystemLog;
use app\backend\middleware\ViewNode;
use app\backend\service\AuthService;
use app\common\controller\Backend;
use Exception;
use fun\helper\SignHelper;
+use http\Header;
use think\App;
class Login extends Backend {
+
+
+ protected array $noNeedLogin = ['index','verify'];
+
protected $layout='';
- protected $middleware = [
- CheckRole::class=>['except'=>['index','verify']],
- ViewNode::class,
- SystemLog::class
- ];
- public function __construct(App $app) {
+ public function __construct(App $app) {
parent::__construct($app);
+ if(config('funadmin.standalone') && request()->baseFile()=='/index.php'){
+ header("Location: /");
+ exit();
+ }
}
public function index(){
if (!$this->request->isPost()) {
$admin= session('admin');
- $admin_sign= session('admin.token') == SignHelper::authSign($admin) ? $admin['id'] : 0;
- // 签名验证是否存在
- if ($admin && $admin_sign) {
+ if ($admin) {
$this->redirect(__u('index/index'));
}
- $bg = hook('bgHook')?hook('bgHook'):'/static/backend/images/admin-bg.jpg';
+ $bg = hook_one('bgHook')?hook_one('bgHook'):'/static/backend/images/admin-bg.jpg';
$view = ['bg'=>$bg];
return view('',$view);
} else {
@@ -62,7 +63,7 @@ public function index(){
} catch (Exception $e) {
$this->error(lang('Login Failed').":{$e->getMessage()}");
}
- $this->success(lang('Login Success').'...',__u('index/index'));
+ $this->success(lang('Login Success').'...',__u('/index/index'));
}
}
public function verify()
diff --git a/app/backend/controller/auth/Admin.php b/app/backend/controller/auth/Admin.php
index c3902a0f5..ac6e1a437 100644
--- a/app/backend/controller/auth/Admin.php
+++ b/app/backend/controller/auth/Admin.php
@@ -164,8 +164,8 @@ public function upme()
$this->error(lang('operation failed'));
}
}
- $list = $this->modelClass->find($id);
- $list->password = '';
+ $list = $this->modelClass->find($id)->toArray();
+ $list['password'] = '';
$auth_group = AuthGroupModel::where('status', 1)->select();
if($list['group_id']) $list['group_id'] = explode(',',$list['group_id']);
$view = [
@@ -190,7 +190,7 @@ public function edit()
$id = $this->request->param('id');
if ($this->request->isPost()) {
$post = $this->request->post();
- $rule = ['group_id'=>'require'];
+ $rule = ['group_id'=>'require','username'=>'require','realname'=>'require'];
$this->validate($post, $rule);
if(session('admin.id'))
if($post['password']){
@@ -206,9 +206,9 @@ public function edit()
$this->error(lang('operation failed'));
}
}
- $list = $this->modelClass->find($id);
+ $list = $this->modelClass->find($id)->toArray();
if($list['group_id']) $list['group_id'] = explode(',',$list['group_id']);
- $list->password = '';
+ $list['password'] = '';
$authGroup = $this->getAuthGroup();
$view = [
'formData' =>$list,
diff --git a/app/backend/controller/auth/AuthGroup.php b/app/backend/controller/auth/AuthGroup.php
index 1125d4be0..af065ba16 100644
--- a/app/backend/controller/auth/AuthGroup.php
+++ b/app/backend/controller/auth/AuthGroup.php
@@ -131,6 +131,9 @@ public function edit()
if($id==1){
$this->error(lang('SupperAdmin cannot edit'));
}
+ if($post['pid']==$id){
+ $this->error(lang('Superiors can not be for themselves'));
+ }
$res = $list->save($post);
if($res){
$this->success(lang('operation success'));
@@ -142,10 +145,11 @@ public function edit()
$id = $this->request->param('id');
$list = $this->modelClass->find(['id' => $id]);
$where = [];
- if(session('admin.id')!==1){
- $where[] = ['id','in',session('admin.group_id')];
- }
- $authGroup = $this->modelClass->where('status',1)->where($where)->select()->toArray();
+// if(session('admin.id')!=1){
+// $where[] = ['id','in',session('admin.group_id')];
+// }
+ $authGroup = $this->modelClass->where('status',1)->where($where)
+ ->where('id','<>',$id)->select()->toArray();
foreach ($authGroup as $key=>$item) {
$parent = $this->modelClass->where($where)->where('id',$item['pid'])->find();
if(empty($parent)){
diff --git a/app/backend/controller/member/Member.php b/app/backend/controller/member/Member.php
index 91d06f7b2..a53f69db6 100644
--- a/app/backend/controller/member/Member.php
+++ b/app/backend/controller/member/Member.php
@@ -39,8 +39,16 @@ public function __construct(App $app)
public function getcitys(){
if($this->request->isAjax()) {}{
$pid = $this->request->param('pid',0);
- $citys = Provinces::where('pid',$pid)->order('id desc')->field('id,name,pid')
- ->cache('provinces.'.$pid,3600*24)->select()->toArray();
+ $pid = $this->request->param('province_id',0);
+ $city_id = $this->request->param('city_id');
+ if($city_id){
+ $citys = Provinces::where('pid',$city_id)->order('id desc')->field('id,name,pid')
+ ->cache('provinces.'.$city_id,3600*24)->select()->toArray();
+ }else{
+ $citys = Provinces::where('pid',$pid)->order('id desc')->field('id,name,pid')
+ ->cache('provinces.'.$pid,3600*24)->select()->toArray();
+ }
+
$this->success('','',$citys);
}
}
@@ -59,7 +67,7 @@ public function index()
}
list($this->page, $this->pageSize, $sort, $where) = $this->buildParames();
$list = $this->modelClass
- ->withJoin(['memberGroup','memberLevel'])
+ ->withJoin(['group','level'])
->where($where)
->order($sort)
->paginate([
@@ -227,11 +235,11 @@ public function recycle()
if ($this->request->isAjax()) {
list($this->page, $this->pageSize, $sort, $where) = $this->buildParames();
$count = $this->modelClass->onlyTrashed()
- ->withJoin(['memberGroup','memberLevel'])
+ ->withJoin(['group','level'])
->where($where)
->count();
$list = $this->modelClass->onlyTrashed()
- ->withJoin(['memberGroup','memberLevel'])
+ ->withJoin(['group','level'])
->where($where)
->order($sort)
->page($this->page, $this->pageSize)
diff --git a/app/backend/controller/sys/Upgrade.php b/app/backend/controller/sys/Upgrade.php
index 89f9eeec5..b0a7e5ed6 100644
--- a/app/backend/controller/sys/Upgrade.php
+++ b/app/backend/controller/sys/Upgrade.php
@@ -55,17 +55,18 @@ public function __construct(App $app)
public function index()
{
if ($this->request->isPost()) {
- $data = $this->request->post();
- $this->authCloudService->setUserParams($data);
- $result = $this->authCloudService->setApiUrl('')->setMethod('post')
- ->setParams($this->authCloudService->getUserParams())
- ->run();
- if ($result['code'] == 200) {
- $this->authCloudService->setAuth($result['data']);
- $this->success(lang('login successful'));
- } else {
- $this->error(lang('Login failed:' . $result['msg']));
+ try {
+ $data = $this->request->post();
+ // 获取访问令牌
+ $tokenResult = $this->authCloudService->getAccessToken($data);
+ // 获取用户信息
+ $member = $this->authCloudService->getMemberInfo($tokenResult['access_token']);
+ // 设置用户信息并返回成功
+ $this->authCloudService->setMember($member);
+ } catch (Exception $e) {
+ $this->error(lang('Login failed:' . $e->getMessage()));
}
+ $this->success( lang( 'login successful'),'',$member);
}
$data['now_version'] = $this->now_version;
$version = Db::query('SELECT VERSION() AS ver');
@@ -80,7 +81,7 @@ public function index()
'server_file' => $_SERVER['SCRIPT_FILENAME'],
'php_version' => PHP_VERSION,
'mysql_version' => $version[0]['ver'],
- 'auth' => $this->authCloudService->getAuth() ? 1 : 0,
+ 'auth' => $this->authCloudService->getMember() ? 1 : 0,
];
$view = array_merge($data, $view);
return view('', $view);
@@ -93,7 +94,7 @@ public function index()
*/
public function check()
{
- if (!$this->authCloudService->getAuth()) {
+ if (!$this->authCloudService->getMember()) {
$this->error(lang('请先登录FunAdmin系统'));
}
$params = [
@@ -101,7 +102,7 @@ public function check()
"domain" => request()->domain(),
"version" => $this->now_version,
];
- $result = $this->authCloudService->setApiUrl('api/v1.version/getVersion')
+ $result = $this->authCloudService->setApiUrl('api/v2.version/getVersion')
->setParams($params)->setHeader()->run();
if ($result['code'] == 200) {
session('upgradeInfo', $result['data']);
@@ -118,7 +119,7 @@ public function check()
public function backup()
{
if ($this->request->isPost()) {
- if (!$this->authCloudService->getAuth()) {
+ if (!$this->authCloudService->getMember()) {
$this->error(lang('请先登录FunAdmin系统'));
}
if (!is_dir($this->backup_dir)) {
@@ -141,7 +142,7 @@ public function backup()
public function install()
{
if ($this->request->isPost()) {
- if (!$this->authCloudService->getAuth()) {
+ if (!$this->authCloudService->getMember()) {
$this->error(lang('请先登录FunAdmin系统'));
}
if(!file_exists($this->lockFile)){
diff --git a/app/backend/lang/zh-cn.php b/app/backend/lang/zh-cn.php
index 5d79fb921..721b03be4 100644
--- a/app/backend/lang/zh-cn.php
+++ b/app/backend/lang/zh-cn.php
@@ -13,253 +13,245 @@
*/
return [
- 'Home' => '主页',
- 'UserName or Email' => '用户名或邮箱',
- 'password' => '密码',
- 'Login In' => '登入',
- 'Login' => '登入',
- 'Register' => '注册',
- 'Lang' => '语言',
- 'language' => '语言',
- 'Input' => '输入',
- 'Top' => "顶级",
- 'Pid' => '上级id',
- 'Oprate' => '操作',
- 'Edit' => '编辑',
- 'Status' => '状态',
- 'Del' => '销毁',
- 'delete' => '删除',
- 'destroy' => '伪删除',
- 'Destory' => '伪删除',
- 'Restore' => '还原',
- 'recycle' => '回收站',
- 'Import' => '导入',
- 'Export' => '导出',
- 'Add' => '添加',
- 'Update' => '更新',
- 'Operat' => '操作',
- 'List' => '列表',
- 'Modify' => '操作',
- 'Copy' => '复制',
- 'Submit' => '提交',
- 'Access' => '分配',
- 'AddChild' => '添加子类',
- 'Back' => '返回',
- 'Confirm' => '确定',
- 'Cancel' => '取消',
- 'Remark' => '备注',
- 'Reset' => '重置',
- 'Open' => '开启',
- 'Close' => '关闭',
- 'Email' => '邮箱',
- 'Ip' => 'ip地址',
- 'Yes' => '是',
- 'No' => '否',
- 'All' => '全部',
- 'MOVE' => '移动',
- 'SelectFiles' =>'选择文件',
- 'Mobile' => '手机号',
- 'PleaseEnter' => '请输入',
- 'Username' => '用户名',
- 'Password' => '密码',
- 'Admin' => '管理员',
- 'Admin Id' => '管理员id',
- 'Search' => '搜索',
- 'User' => '用户',
- 'Sex' => '性别',
- 'Level' => '等级',
- 'Please choose data' => '请选择数据',
- 'Defaults' => '默认',
- 'Default' => '默认',
- 'Cropper' =>'裁剪',
- 'IMAGE SIZE LIMITED 300x300px,MAXSIZE 2M'=>'文件大小限制在300X300 2M内',
- 'Choose' =>'选择',
- 'upgrade' =>'更新',
- 'check' =>'检测',
- 'backup' =>'备份',
- 'Wechat' => '微信',
- 'Message' => '消息',
- 'Material' => '素材',
- 'Tag' => '标签',
- 'Tags' => '标签',
- 'Fans' => '粉丝',
- 'Reply' => '回复',
- 'Supperman' => '超级管理',
- 'Theme Color' =>'主题颜色',
- 'Sort' => '排序',
- 'Field' => '字段',
- 'Name' => '名字',
- 'Value' => '值',
- 'Config' => '配置',
- 'Plugins' => '插件',
- "File" => "文件",
- "debug" => '调试模式',
- "version" => '版本',
- "other" => '其他',
- 'Upload' => "上传",
- 'Refresh Success' => '刷新成功',
- 'Refresh' => '刷新页面',
- 'Description' => "描述",
- 'Set Password To Lock Screen' => '输入密码锁屏',
- 'Lock now' => '立即锁屏',
- 'Input Password' => '输入密码',
- 'Unlock Now' => '立即解锁',
- 'Unlock Success' => '解锁成功',
-
- 'Delete checked' => '批量删除',
- 'operation success' => '操作成功',
- 'operation failed' => '操作失败',
- 'Update Success' => '更新成功',
- 'Empty Success' => '清除成功',
- 'Update Failed' => '更新失败',
- 'Delete all Failed' => '全部删除失败',
- 'Asny Failed' => '同步失败',
- 'Empty Failed' => '清除失败',
- 'enabled' =>'启用',
- 'disabled' =>'禁用',
-
- 'Test Data Cannot Edit' => '测试数据不能修改',
- 'Test Data Cannot Delete' => '测试数据不能删除',
- 'Please Choose Rule' => '请选择权限',
-
- 'Not exist' => '不存在',
- 'Data Not Exist' => '数据不存在',
- 'Cannot Null' => '不能为空',
- 'Invalid Data' => '数据不正确',
- 'Invalid Options' => '非法操作',
-
- 'Logout Success' => '退出成功',
- 'QrcodeName' => "二维码名字",
- 'Select Attach' => '选择附件',
- 'CreateTime' => '创建时间',
- 'UpdateTime' => '更新时间',
- 'Verify' => '验证码',
- 'Please check data' => '请检查数据',
- 'Are you sure' => '确定操作吗?',
- 'Are you sure you want to delete it' => '确定删除此项?',
- 'Are you sure to delete' => '确定删除此项?',
- 'Are you sure to Destroy' => '确定删除此项?',
- 'Are you sure to restore' => '确定还原吗?',
+ 'Home' => '主页',
+ 'UserName or Email' => '用户名或邮箱',
+ 'password' => '密码',
+ 'Login In' => '登入',
+ 'Login' => '登入',
+ 'Register' => '注册',
+ 'Lang' => '语言',
+ 'language' => '语言',
+ 'Input' => '输入',
+ 'Top' => "顶级",
+ 'Pid' => '上级id',
+ 'Oprate' => '操作',
+ 'Edit' => '编辑',
+ 'Status' => '状态',
+ 'Del' => '销毁',
+ 'delete' => '删除',
+ 'destroy' => '伪删除',
+ 'Destory' => '伪删除',
+ 'Restore' => '还原',
+ 'recycle' => '回收站',
+ 'Import' => '导入',
+ 'Export' => '导出',
+ 'Add' => '添加',
+ 'Update' => '更新',
+ 'Operat' => '操作',
+ 'List' => '列表',
+ 'Modify' => '操作',
+ 'Copy' => '复制',
+ 'Submit' => '提交',
+ 'Access' => '分配',
+ 'AddChild' => '添加子类',
+ 'Back' => '返回',
+ 'Confirm' => '确定',
+ 'Cancel' => '取消',
+ 'Remark' => '备注',
+ 'Reset' => '重置',
+ 'Open' => '开启',
+ 'Close' => '关闭',
+ 'Email' => '邮箱',
+ 'Ip' => 'ip地址',
+ 'Yes' => '是',
+ 'No' => '否',
+ 'All' => '全部',
+ 'MOVE' => '移动',
+ 'SelectFiles' => '选择文件',
+ 'Mobile' => '手机号',
+ 'PleaseEnter' => '请输入',
+ 'Username' => '用户名',
+ 'Password' => '密码',
+ 'Admin' => '管理员',
+ 'Admin Id' => '管理员id',
+ 'Search' => '搜索',
+ 'User' => '用户',
+ 'Sex' => '性别',
+ 'Level' => '等级',
+ 'Please choose data' => '请选择数据',
+ 'Defaults' => '默认',
+ 'Default' => '默认',
+ 'Cropper' => '裁剪',
+ 'IMAGE SIZE LIMITED 300x300px,MAXSIZE 2M' => '文件大小限制在300X300 2M内',
+ 'Choose' => '选择',
+ 'upgrade' => '更新',
+ 'check' => '检测',
+ 'backup' => '备份',
+ 'Wechat' => '微信',
+ 'Message' => '消息',
+ 'Material' => '素材',
+ 'Tag' => '标签',
+ 'Tags' => '标签',
+ 'Fans' => '粉丝',
+ 'Reply' => '回复',
+ 'Supperman' => '超级管理',
+ 'Theme Color' => '主题颜色',
+ 'Sort' => '排序',
+ 'Field' => '字段',
+ 'Name' => '名字',
+ 'Value' => '值',
+ 'Config' => '配置',
+ 'Plugins' => '插件',
+ "File" => "文件",
+ "debug" => '调试模式',
+ "version" => '版本',
+ "other" => '其他',
+ 'Upload' => "上传",
+ 'Refresh Success' => '刷新成功',
+ 'Refresh' => '刷新页面',
+ 'Description' => "描述",
+ 'Set Password To Lock Screen' => '输入密码锁屏',
+ 'Lock now' => '立即锁屏',
+ 'Input Password' => '输入密码',
+ 'Unlock Now' => '立即解锁',
+ 'Unlock Success' => '解锁成功',
+ 'Delete checked' => '批量删除',
+ 'operation success' => '操作成功',
+ 'operation failed' => '操作失败',
+ 'Update Success' => '更新成功',
+ 'Empty Success' => '清除成功',
+ 'Update Failed' => '更新失败',
+ 'Delete all Failed' => '全部删除失败',
+ 'Asny Failed' => '同步失败',
+ 'Empty Failed' => '清除失败',
+ 'enabled' => '启用',
+ 'disabled' => '禁用',
+ 'Test Data Cannot Edit' => '测试数据不能修改',
+ 'Test Data Cannot Delete' => '测试数据不能删除',
+ 'Please Choose Rule' => '请选择权限',
+ 'Not exist' => '不存在',
+ 'Data Not Exist' => '数据不存在',
+ 'Cannot Null' => '不能为空',
+ 'Invalid Data' => '数据不正确',
+ 'Invalid Options' => '非法操作',
+ 'Logout Success' => '退出成功',
+ 'QrcodeName' => "二维码名字",
+ 'Select Attach' => '选择附件',
+ 'CreateTime' => '创建时间',
+ 'UpdateTime' => '更新时间',
+ 'Verify' => '验证码',
+ 'Please check data' => '请检查数据',
+ 'Are you sure' => '确定操作吗?',
+ 'Are you sure you want to delete it' => '确定删除此项?',
+ 'Are you sure to delete' => '确定删除此项?',
+ 'Are you sure to Destroy' => '确定删除此项?',
+ 'Are you sure to restore' => '确定还原吗?',
'Are you sure you want to delete the %s selected item?' => '确定删除选中的 %s 项?',
- 'Are you sure you want to delete or empty?' => '确定删除或清空?',
- 'Are you sure you want to empty?' => '确定清空?',
+ 'Are you sure you want to delete or empty?' => '确定删除或清空?',
+ 'Are you sure you want to empty?' => '确定清空?',
'English characters Canot duplicate the current existing' => '英文字符,不能重复',
- 'Please install the upload plugin first'=>'请先安装上传插件',
-
+ 'Please install the upload plugin first' => '请先安装上传插件',
//菜单
- 'FileList' =>'文件列表',
- 'groupadd' =>'分组添加',
- 'groupedit' =>'分组编辑',
- 'groupdelete' =>'分组删除',
- 'Fullscreen' => "全屏",
- 'Lock' => "锁屏",
- 'zh-cn' => "中文",
- 'en-us' => "英文",
- 'Theme' => "主题",
- 'Sys' => "系统",
- 'System' => "系统",
- 'Log' => "日志",
- 'LogDel' => "日志删除",
- 'Uploads' => "上传",
- 'Group' => "组别",
- 'ConfigGroup' => "配置组",
- 'ConfigGroupAdd' => "配置组添加",
- 'ConfigGroupEdit' => "配置组编辑",
- 'ConfigGroupDel' => "配置组删除",
- 'ConfigGroupModify' => "配置组修改",
- 'ConfigEdit' => "配置修改",
- 'ConfigAdd' => "配置添加",
- 'ConfigDel' => "配置删除",
- 'ConfigModify' => "配置编辑",
- 'ConfigSet' => "配置设置",
- 'Blacklist' => "黑名单",
- 'AuthBoard' => "权限",
- 'Auth' => "菜单",
- 'AuthGroup' => "角色组",
- 'AuthGroupAdd' => "角色组添加",
- 'AuthGroupEdit' => "角色组编辑",
- 'AuthGroupModify' => "角色组修改",
- 'AuthGroupDel' => "角色组删除",
- 'AuthGroupAccess' => "角色组配置",
- 'Rule' => "规则",
- 'RuleAdd' => "添加规则",
- 'RuleDel' => "删除规则",
- 'RuleEdit' => "编辑规则",
- 'RuleModify' => "修改规则",
- 'Add ChildRule' => "添加子规则",
- 'AttachGroup' => "附件分组",
- 'attachGroup' => "附件分组",
- 'Attach' => "附件",
- 'AttachAdd' => "附件",
- 'AttachDelete' => "附件",
- 'Ucenter' => '会员中心',
- 'UserLevel' => '用户等级',
- 'Member' => "会员 ",
- 'MemberAdd' => "会员添加",
- 'MemberEdit' => "会员编辑",
- 'MemberDel' => "会员删除",
- 'MemberModify' => "会员修改",
- 'MemberLevel' => "会员等级",
- 'MemberLevelAdd' => "会员等级添加",
- 'MemberLevelEdit' => "会员等级编辑",
- 'MemberLevelDel' => "会员等级删除",
- 'MemberLevelModify' => "会员等级修改",
- 'MemberGroup' => "会员组",
- 'MemberGroupADD' => "会员组添加",
- 'MemberGroupEdit' => "会员组编辑",
- 'MemberGroupDel' => "会员组删除",
- 'MemberGroupModify' => "会员组修改",
- 'AdminAdd' => "管理员添加",
- 'AdminEdit' => "管理员编辑",
- 'AdminModify' => "管理员修改",
- 'AdminDel' => "管理员删除",
- 'Child' => '下级',
- 'Attachment' => '附件',
- 'Addons' => '插件',
- 'Addon' => '插件',
- 'AddonName' => '插件名',
- 'Uninstall' => '卸载',
- 'Install' => '安装',
- 'Languages' => '语言',
- 'Sysset' => '设置',
- 'clear all' =>"清除全部缓存",
- 'clear frontend' =>"清除前台缓存",
- 'clear backend' =>"清除后台缓存",
- 'Please Login First' => '请先登录',
- 'Login successful' => '登录成功',
- 'Are you sure todo this' =>'确定吗?',
-
- "Demo is not allow to change data"=>"演示站点不允许修改数据",
- 'safe' =>'安全设置',
- 'info' =>'基本信息',
- 'Logout' =>'退出',
- 'Try again later' =>'稍后再试',
- 'Upload Success' =>'上传成功',
- 'Upload Failed' =>'上传失败',
- 'uploading' =>'上传中',
- 'File nums is limited' =>'文件数量有限',
- 'Are you sure?' =>'确定吗?',
- 'Request url can not empty' =>'请求网址不能为空',
- 'Choose Success' =>'选择成功',
- 'Return data is not right' =>'返回数据不正确',
- 'File type is limited' =>"不支持上传文件类型,请配置",
-
- 'OriginalName' =>'原名',
- 'Path' =>'路径',
- 'MimeType' =>'Mime类型',
- 'Permission Denied' =>'没有权限',
- 'Between 4 and 25 characters'=>'4-25个字符',
-
-
- "save success"=>'保存成功',
- "add success"=>'保存成功',
- "add failed"=>'保存失败',
- "operate success"=>'操作成功',
- "operate failed"=>'操作失败',
- "save failed"=>'保存失败',
- "modify success"=>'修改成功',
- "modify failed"=>'修改失败',
- 'are you sure you want to close this window'=>"确定关闭窗口吗?",
- 'key'=>'键',
- 'Query'=>'参数'
+ 'FileList' => '文件列表',
+ 'groupadd' => '分组添加',
+ 'groupedit' => '分组编辑',
+ 'groupdelete' => '分组删除',
+ 'Fullscreen' => "全屏",
+ 'Lock' => "锁屏",
+ 'zh-cn' => "中文",
+ 'en-us' => "英文",
+ 'Theme' => "主题",
+ 'Sys' => "系统",
+ 'System' => "系统",
+ 'Log' => "日志",
+ 'LogDel' => "日志删除",
+ 'Uploads' => "上传",
+ 'Group' => "组别",
+ 'ConfigGroup' => "配置组",
+ 'ConfigGroupAdd' => "配置组添加",
+ 'ConfigGroupEdit' => "配置组编辑",
+ 'ConfigGroupDel' => "配置组删除",
+ 'ConfigGroupModify' => "配置组修改",
+ 'ConfigEdit' => "配置修改",
+ 'ConfigAdd' => "配置添加",
+ 'ConfigDel' => "配置删除",
+ 'ConfigModify' => "配置编辑",
+ 'ConfigSet' => "配置设置",
+ 'Blacklist' => "黑名单",
+ 'AuthBoard' => "权限",
+ 'Auth' => "菜单",
+ 'AuthGroup' => "角色组",
+ 'AuthGroupAdd' => "角色组添加",
+ 'AuthGroupEdit' => "角色组编辑",
+ 'AuthGroupModify' => "角色组修改",
+ 'AuthGroupDel' => "角色组删除",
+ 'AuthGroupAccess' => "角色组配置",
+ 'Rule' => "规则",
+ 'RuleAdd' => "添加规则",
+ 'RuleDel' => "删除规则",
+ 'RuleEdit' => "编辑规则",
+ 'RuleModify' => "修改规则",
+ 'Add ChildRule' => "添加子规则",
+ 'AttachGroup' => "附件分组",
+ 'attachGroup' => "附件分组",
+ 'Attach' => "附件",
+ 'AttachAdd' => "附件",
+ 'AttachDelete' => "附件",
+ 'Ucenter' => '会员中心',
+ 'UserLevel' => '用户等级',
+ 'Member' => "会员 ",
+ 'MemberAdd' => "会员添加",
+ 'MemberEdit' => "会员编辑",
+ 'MemberDel' => "会员删除",
+ 'MemberModify' => "会员修改",
+ 'MemberLevel' => "会员等级",
+ 'MemberLevelAdd' => "会员等级添加",
+ 'MemberLevelEdit' => "会员等级编辑",
+ 'MemberLevelDel' => "会员等级删除",
+ 'MemberLevelModify' => "会员等级修改",
+ 'MemberGroup' => "会员组",
+ 'MemberGroupADD' => "会员组添加",
+ 'MemberGroupEdit' => "会员组编辑",
+ 'MemberGroupDel' => "会员组删除",
+ 'MemberGroupModify' => "会员组修改",
+ 'AdminAdd' => "管理员添加",
+ 'AdminEdit' => "管理员编辑",
+ 'AdminModify' => "管理员修改",
+ 'AdminDel' => "管理员删除",
+ 'Child' => '下级',
+ 'Attachment' => '附件',
+ 'Addons' => '插件',
+ 'Addon' => '插件',
+ 'AddonName' => '插件名',
+ 'Uninstall' => '卸载',
+ 'Install' => '安装',
+ 'Languages' => '语言',
+ 'Sysset' => '设置',
+ 'clear all' => "清除全部缓存",
+ 'clear frontend' => "清除前台缓存",
+ 'clear backend' => "清除后台缓存",
+ 'Please Login First' => '请先登录',
+ 'Login successful' => '登录成功',
+ 'Are you sure todo this' => '确定吗?',
+ "Demo is not allow to change data" => "演示站点不允许修改数据",
+ 'safe' => '安全设置',
+ 'info' => '基本信息',
+ 'Logout' => '退出',
+ 'Try again later' => '稍后再试',
+ 'Upload Success' => '上传成功',
+ 'Upload Failed' => '上传失败',
+ 'uploading' => '上传中',
+ 'File nums is limited' => '文件数量有限',
+ 'Are you sure?' => '确定吗?',
+ 'Request url can not empty' => '请求网址不能为空',
+ 'Choose Success' => '选择成功',
+ 'Return data is not right' => '返回数据不正确',
+ 'File type is limited' => "不支持上传文件类型,请配置",
+ 'OriginalName' => '原名',
+ 'Path' => '路径',
+ 'MimeType' => 'Mime类型',
+ 'Permission Denied' => '没有权限',
+ 'Between 4 and 25 characters' => '4-25个字符',
+ "save success" => '保存成功',
+ "add success" => '保存成功',
+ "add failed" => '保存失败',
+ "operate success" => '操作成功',
+ "operate failed" => '操作失败',
+ "save failed" => '保存失败',
+ "modify success" => '修改成功',
+ "modify failed" => '修改失败',
+ 'are you sure you want to close this window'=> "确定关闭窗口吗?",
+ 'key' => '键',
+ 'Query' => '参数',
+ 'The drop-down selection field is incorrect'=> '下拉选择字段错误',
];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/addon.php b/app/backend/lang/zh-cn/addon.php
index 737d68a93..0dc93783a 100644
--- a/app/backend/lang/zh-cn/addon.php
+++ b/app/backend/lang/zh-cn/addon.php
@@ -1,48 +1,48 @@
'插件名字不正确',
- 'addon can not be empty'=>'插件不能为空',
- 'addon %s can not be empty'=>'插件 %s 不能为空',
- 'addon config is not found'=>'找不到插件配置',
- 'addons %s is already installed'=>'插件%s已安装',
- 'addons %s is not ready'=>'插件%s还没有准备好',
- 'Please disable addons %s first'=>'请先禁用插件%s',
- 'addon uninstall fail'=>'插件卸载失败',
- 'Uninstall successful'=>'插件卸载成功',
- 'LOGO'=>'Logo',
- 'Create'=>'创建',
- 'title'=>'标题',
- 'Account'=>'云账号',
- 'Addon version'=>'版本',
- 'Addon Config'=>'插件配置',
- 'Addon require'=>'需求版本',
- 'author'=>'作者',
- 'publishtime'=>'发布时间',
- 'localinstall'=>'离线安装',
- 'local install'=>'离线安装',
- 'price'=>'价格',
- 'download'=>'下载量',
- 'Logo'=>'图标',
- 'ADDONAME'=>'插件名',
- 'config'=>'配置',
- 'install'=>'安装',
- 'Ver'=>'版本',
- 'Force'=>'强制',
- 'Requires'=>'需求版本',
- 'uninstall'=>'卸载',
- 'disabled'=>'已禁用',
- 'disable'=>'禁用',
- 'Enabled'=>'已启用',
- 'enable'=>'启用',
- 'Install' => '安装',
- 'Uninstall' => '卸载',
- 'Select' => '选择',
- 'Address' => '地址',
- 'Login Tips' => '登录提示:此处为FunAdmin官方账号',
- 'Your Password' => '您的密码',
- 'UserName Or Email' => '账号或密码',
- 'Please backup your data before upgrading!!!'=>'升级前请备份数据!!!',
- "Are you sure you want to install it"=>"确定安装吗?",
- "Are you sure you want to uninstall it"=>"确定卸载吗?",
- 'Are you sure you want to change it'=>'确定修改吗?'
+ 'addon name is not right' => '插件名字不正确',
+ 'addon can not be empty' => '插件不能为空',
+ 'addon %s can not be empty' => '插件 %s 不能为空',
+ 'addon config is not found' => '找不到插件配置',
+ 'addons %s is already installed' => '插件%s已安装',
+ 'addons %s is not ready' => '插件%s还没有准备好',
+ 'Please disable addons %s first' => '请先禁用插件%s',
+ 'addon uninstall fail' => '插件卸载失败',
+ 'Uninstall successful' => '插件卸载成功',
+ 'LOGO' => 'Logo',
+ 'Create' => '创建',
+ 'title' => '标题',
+ 'Account' => '云账号',
+ 'Addon version' => '版本',
+ 'Addon Config' => '插件配置',
+ 'Addon require' => '需求版本',
+ 'author' => '作者',
+ 'publishtime' => '发布时间',
+ 'localinstall' => '离线安装',
+ 'local install' => '离线安装',
+ 'price' => '价格',
+ 'download' => '下载量',
+ 'Logo' => '图标',
+ 'ADDONAME' => '插件名',
+ 'config' => '配置',
+ 'install' => '安装',
+ 'Ver' => '版本',
+ 'Force' => '强制',
+ 'Requires' => '需求版本',
+ 'uninstall' => '卸载',
+ 'disabled' => '已禁用',
+ 'disable' => '禁用',
+ 'Enabled' => '已启用',
+ 'enable' => '启用',
+ 'Install' => '安装',
+ 'Uninstall' => '卸载',
+ 'Select' => '选择',
+ 'Address' => '地址',
+ 'Login Tips' => '登录提示:此处为FunAdmin官方账号',
+ 'Your Password' => '您的密码',
+ 'UserName Or Email' => '账号或密码',
+ 'Please backup your data before upgrading!!!' => '升级前请备份数据!!!',
+ "Are you sure you want to install it" => "确定安装吗?",
+ "Are you sure you want to uninstall it" => "确定卸载吗?",
+ 'Are you sure you want to change it' => '确定修改吗?'
];
diff --git a/app/backend/lang/zh-cn/auth/admin.php b/app/backend/lang/zh-cn/auth/admin.php
index 8ff357fc6..16159f435 100644
--- a/app/backend/lang/zh-cn/auth/admin.php
+++ b/app/backend/lang/zh-cn/auth/admin.php
@@ -1,17 +1,17 @@
'角色组',
- 'oldpassword' => '旧密码',
- 'NewPasswd' => '新密码',
- 'Renewpasswd' => '重复新密码',
- 'Group_Id' => '角色组',
- 'Supper man cannot delete' => '超级管理员不能删除',
- 'Supper man cannot edit' => '超级管理员不能修改',
- 'Supper man cannot edit state' => '超级管理员不能修改状态',
- 'Origin Password Error' => '原密码错误',
- 'Username is between 4 and 25 characters'=>'用户名在4-25个字符',
- 'Password must be greater than 6 characters and less than 15 characters'=>'密码在6-15个字符',
- 'realname' => '姓名',
- 'For password retrieval please fill in carefully'=>'找回密码请认真填写',
-];
+ return [
+ 'AuthGroup' => '角色组',
+ 'oldpassword' => '旧密码',
+ 'NewPasswd' => '新密码',
+ 'Renewpasswd' => '重复新密码',
+ 'Group_Id' => '角色组',
+ 'Supper man cannot delete' => '超级管理员不能删除',
+ 'Supper man cannot edit' => '超级管理员不能修改',
+ 'Supper man cannot edit state' => '超级管理员不能修改状态',
+ 'Origin Password Error' => '原密码错误',
+ 'Username is between 4 and 25 characters' => '用户名在4-25个字符',
+ 'Password must be greater than 6 characters and less than 15 characters' => '密码在6-15个字符',
+ 'realname' => '姓名',
+ 'For password retrieval please fill in carefully'=> '找回密码请认真填写',
+ ];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/auth/auth.php b/app/backend/lang/zh-cn/auth/auth.php
index c2e0ab9c7..80aebc4c9 100644
--- a/app/backend/lang/zh-cn/auth/auth.php
+++ b/app/backend/lang/zh-cn/auth/auth.php
@@ -1,28 +1,37 @@
'图标',
- 'Auth Name' =>'权限名',
- 'AuthName' =>'权限名',
- 'Auth Verify' =>'权限验证',
- 'Menu Status' =>'菜单状态',
- 'Controller/Action' =>'控制器/方法',
- 'Module/Controller/Action' =>'模块/控制器/方法',
- 'Add Child' =>'添加下级',
- 'Menu Target'=>'窗口目标',
- 'MenuStatus'=>'菜单状态',
- 'Menu_Status'=>'菜单状态',
- 'Target'=>'窗口',
- 'href'=>'路由',
- '_self'=>'当前',
- '_blank'=>'空窗口',
- '_parent'=>'上级',
- '_top'=>'顶级',
- 'IsMenu'=>'是否菜单',
- 'title'=>'菜单名',
- 'Module'=>'模块',
- 'Parent menu cannot be modified to submenu'=>'父菜单不能修改到子菜单',
- 'The superior cannot be set as himself'=>'父级不能为自己',
- 'setValue'=>'设置值',
- 'upme' =>'更新信息',
- 'Are you sure you want to delete menu and children menu!!!'=>'确定要删除菜单和子菜单吗!!!'
-];
\ No newline at end of file
+ 'icon' => '图标',
+ 'Auth Name' => '权限名',
+ 'AuthName' => '权限名',
+ 'Auth Verify' => '权限验证',
+ 'Menu Status' => '菜单状态',
+ 'Controller/Action' => '控制器/方法',
+ 'Module/Controller/Action' => '模块/控制器/方法',
+ 'Add Child' => '添加下级',
+ 'Menu Target' => '窗口目标',
+ 'MenuStatus' => '菜单状态',
+ 'Menu_Status' => '菜单状态',
+ 'Target' => '窗口',
+ 'href' => '路由',
+ '_self' => '当前',
+ '_blank' => '空窗口',
+ '_parent' => '上级',
+ '_top' => '顶级',
+ 'IsMenu' => '是否菜单',
+ 'title' => '菜单名',
+ 'Module' => '模块',
+ 'Parent menu cannot be modified to submenu' => '父菜单不能修改到子菜单',
+ 'The superior cannot be set as himself' => '父级不能为自己',
+ 'setValue' => '设置值',
+ 'upme' => '更新信息',
+ 'Are you sure you want to delete menu and children menu!!!' => '确定要删除菜单和子菜单吗!!!'
+];
diff --git a/app/backend/lang/zh-cn/auth/authgroup.php b/app/backend/lang/zh-cn/auth/authgroup.php
index 1b67b385a..7404d0922 100644
--- a/app/backend/lang/zh-cn/auth/authgroup.php
+++ b/app/backend/lang/zh-cn/auth/authgroup.php
@@ -1,10 +1,9 @@
'分配角色',
- 'GroupName'=>'组名',
- 'AuthGroupPid'=>'角色组ID',
- 'Module'=>'模块',
- "SupperAdmin cannot edit"=>'超管组不能被编辑',
-
+ 'access group' => '分配角色',
+ 'GroupName' => '组名',
+ 'AuthGroupPid' => '角色组ID',
+ 'Module' => '模块',
+ "SupperAdmin cannot edit" => '超管组不能被编辑',
];
diff --git a/app/backend/lang/zh-cn/login.php b/app/backend/lang/zh-cn/login.php
index 99f90fafe..3ec2b74e5 100644
--- a/app/backend/lang/zh-cn/login.php
+++ b/app/backend/lang/zh-cn/login.php
@@ -3,11 +3,11 @@
return [
// 登录
- 'Keep Login'=>"保持登录",
- 'Captcha error' => '验证码错误',
- 'Login Success' => '登录成功',
- 'Login Failed' => '登录失败',
- 'Account is disabled' => '账号禁用',
- 'Account is not accessed' => '账号未成功接入',
+ 'Keep Login' => "保持登录",
+ 'Captcha error' => '验证码错误',
+ 'Login Success' => '登录成功',
+ 'Login Failed' => '登录失败',
+ 'Account is disabled' => '账号禁用',
+ 'Account is not accessed' => '账号未成功接入',
'Please check username or password' => '请检查用户名或密码',
];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/member/member.php b/app/backend/lang/zh-cn/member/member.php
index f7c3cb3a6..a8e76879a 100644
--- a/app/backend/lang/zh-cn/member/member.php
+++ b/app/backend/lang/zh-cn/member/member.php
@@ -1,40 +1,38 @@
"会员",
- 'GroupName' =>"会员组",
- 'Memberadd' =>"会员添加",
- 'Memberdel' =>"会员删除",
- 'Memberedit' =>"会员编辑",
- 'MemberLevel' =>"会员等级",
- 'Level' =>"等级",
- 'Membername' =>"名称 ",
- 'Nickname' => '昵称',
- 'Password' => '密码',
- 'Salt' => '密码盐',
- 'Email' => '电子邮箱',
- 'Mobile' => '手机号',
- 'Avatar' => '头像',
- 'Sex' => '性别',
- 'Male' => '男',
- 'FeMale' => '女',
- 'Secret' => '保密',
- 'Birthday' => '生日',
- 'Score' => '积分',
- 'Registertime' =>'注册时间',
- 'Lastlogintime' => '上次登录时间',
- 'Logintime' => '登录时间',
- 'Loginip' => '登录IP',
- 'Loginfailure' => '失败次数',
- 'Registerip' => '加入IP',
- 'Token' => 'Token',
- 'Status' => '状态',
- 'level_id' => '会员id',
- 'group_id' => '会员组id',
- 'Man' => '男性',
- 'Female' => '女性',
- 'Secrecy' => '保密',
- 'Between 4 and 25 characters' =>'4-25个字符',
- '100 not discounted 90% off' =>'100 不打折,90% 折扣'
-
-
- ];
\ No newline at end of file
+ 'Member' => "会员",
+ 'GroupName' => "会员组",
+ 'Memberadd' => "会员添加",
+ 'Memberdel' => "会员删除",
+ 'Memberedit' => "会员编辑",
+ 'MemberLevel' => "会员等级",
+ 'Level' => "等级",
+ 'Membername' => "名称 ",
+ 'Nickname' => '昵称',
+ 'Password' => '密码',
+ 'Salt' => '密码盐',
+ 'Email' => '电子邮箱',
+ 'Mobile' => '手机号',
+ 'Avatar' => '头像',
+ 'Sex' => '性别',
+ 'Male' => '男',
+ 'FeMale' => '女',
+ 'Secret' => '保密',
+ 'Birthday' => '生日',
+ 'Score' => '积分',
+ 'Registertime' => '注册时间',
+ 'Lastlogintime' => '上次登录时间',
+ 'Logintime' => '登录时间',
+ 'Loginip' => '登录IP',
+ 'Loginfailure' => '失败次数',
+ 'Registerip' => '加入IP',
+ 'Token' => 'Token',
+ 'Status' => '状态',
+ 'level_id' => '会员id',
+ 'group_id' => '会员组id',
+ 'Man' => '男性',
+ 'Female' => '女性',
+ 'Secrecy' => '保密',
+ 'Between 4 and 25 characters' => '4-25个字符',
+ '100 not discounted 90% off' => '100 不打折,90% 折扣'
+];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/member/membergroup.php b/app/backend/lang/zh-cn/member/membergroup.php
index 5210f56be..ca9c2f83f 100644
--- a/app/backend/lang/zh-cn/member/membergroup.php
+++ b/app/backend/lang/zh-cn/member/membergroup.php
@@ -1,13 +1,11 @@
"会员 ",
- 'GroupName' =>"分组名",
- 'GroupAdd' =>"分组名添加",
- 'GroupEdit' =>"分组名编辑",
- 'GroupDel' =>"分组名删除",
- 'GroupModify' =>"分组名修改",
- 'Status' => '状态',
- 'Rules' => '规则',
-
-
+ 'Member' => "会员",
+ 'GroupName' => "分组名",
+ 'GroupAdd' => "分组名添加",
+ 'GroupEdit' => "分组名编辑",
+ 'GroupDel' => "分组名删除",
+ 'GroupModify' => "分组名修改",
+ 'Status' => '状态',
+ 'Rules' => '规则',
];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/member/memberlevel.php b/app/backend/lang/zh-cn/member/memberlevel.php
index 29dc12817..783f495f1 100644
--- a/app/backend/lang/zh-cn/member/memberlevel.php
+++ b/app/backend/lang/zh-cn/member/memberlevel.php
@@ -1,16 +1,16 @@
"等级",
- 'Leveladd' =>"等级添加",
- 'Leveldel' =>"等级删除",
- 'Leveledit' =>"等级编辑",
- 'Leveldesc' =>"等级描述",
- 'LevelName' =>"等级名字",
- 'Levelmoney' =>"等级金额",
- 'Leveldiscount' =>"等级折扣 ",
- 'Amount' =>"金额 ",
- 'Discount' =>"折扣",
- 'Thumb' =>"缩略图",
- 'Between 4 and 25 characters' =>'4-25个字符',
- '100 not discounted 90% off' =>'100 不打折,90% 折扣'
+ 'Level' => "等级",
+ 'Leveladd' => "等级添加",
+ 'Leveldel' => "等级删除",
+ 'Leveledit' => "等级编辑",
+ 'Leveldesc' => "等级描述",
+ 'LevelName' => "等级名字",
+ 'Levelmoney' => "等级金额",
+ 'Leveldiscount' => "等级折扣",
+ 'Amount' => "金额",
+ 'Discount' => "折扣",
+ 'Thumb' => "缩略图",
+ 'Between 4 and 25 characters' => "4-25个字符",
+ '100 not discounted 90% off' => "100 不打折,90% 折扣"
];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/sys/adminlog.php b/app/backend/lang/zh-cn/sys/adminlog.php
index 1122eb34e..82fc32b28 100644
--- a/app/backend/lang/zh-cn/sys/adminlog.php
+++ b/app/backend/lang/zh-cn/sys/adminlog.php
@@ -1,11 +1,11 @@
'管理员名',
- 'Method'=>'方式',
- 'Log Addr'=>'日志地址',
- 'Log Content'=>'日志内容',
- 'Log Title'=>'日志标题',
- 'Log Agent'=>'代理',
- 'Ip'=>'ip地址',
+ 'Admin Username' => '管理员名',
+ 'Method' => '方式',
+ 'Log Addr' => '日志地址',
+ 'Log Content' => '日志内容',
+ 'Log Title' => '日志标题',
+ 'Log Agent' => '代理',
+ 'Ip' => 'ip地址',
];
\ No newline at end of file
diff --git a/app/backend/lang/zh-cn/sys/attach.php b/app/backend/lang/zh-cn/sys/attach.php
index 27e082b94..43788e903 100644
--- a/app/backend/lang/zh-cn/sys/attach.php
+++ b/app/backend/lang/zh-cn/sys/attach.php
@@ -1,27 +1,26 @@
'附件',
- 'zip'=>'压缩件',
- 'text'=>'文本',
- 'file'=>'文件',
- 'image'=>'图片',
- 'video'=>'视频',
- 'audio'=>'音频',
- 'OriginalName'=>'原名',
- 'name'=>'名字',
- 'thumb'=>'缩略图',
- 'FileType'=>'文件类型',
- 'Ext'=>'后缀',
- 'url'=>'路径',
- 'Path'=>'路径',
- 'Size'=>'大小',
- 'Driver'=>'驱动',
- 'Mime'=>'mime类型',
- 'Userid'=>'用户id',
- 'Width'=>'宽',
- 'Height'=>'高',
- 'Group List'=>'分组',
- 'ALL OR DEFAULT CAN NOT DELETE'=>"默认或全部不能删除",
-
+ 'Attach' => '附件',
+ 'zip' => '压缩件',
+ 'text' => '文本',
+ 'file' => '文件',
+ 'image' => '图片',
+ 'video' => '视频',
+ 'audio' => '音频',
+ 'OriginalName' => '原名',
+ 'name' => '名字',
+ 'thumb' => '缩略图',
+ 'FileType' => '文件类型',
+ 'Ext' => '后缀',
+ 'url' => '路径',
+ 'Path' => '路径',
+ 'Size' => '大小',
+ 'Driver' => '驱动',
+ 'Mime' => 'mime类型',
+ 'Userid' => '用户id',
+ 'Width' => '宽',
+ 'Height' => '高',
+ 'Group List' => '分组',
+ 'ALL OR DEFAULT CAN NOT DELETE' => '默认或全部不能删除',
];
diff --git a/app/backend/lang/zh-cn/sys/attachgroup.php b/app/backend/lang/zh-cn/sys/attachgroup.php
index 1f1692c6d..06544be4c 100644
--- a/app/backend/lang/zh-cn/sys/attachgroup.php
+++ b/app/backend/lang/zh-cn/sys/attachgroup.php
@@ -1,28 +1,28 @@
'组名',
- 'Attach'=>'附件',
- 'zip'=>'压缩件',
- 'text'=>'文本',
- 'file'=>'文件',
- 'Thumb'=>'图片',
- 'video'=>'视频',
- 'audio'=>'音频',
- 'OriginalName'=>'原名',
- 'name'=>'名字',
- 'thumb'=>'缩略图',
- 'FileType'=>'文件类型',
- 'Ext'=>'后缀',
- 'url'=>'路径',
- 'Path'=>'路径',
- 'Size'=>'大小',
- 'Driver'=>'驱动',
- 'Mime'=>'mime类型',
- 'Userid'=>'用户id',
- 'Width'=>'宽',
- 'Height'=>'高',
- 'Group List'=>'分组',
- 'ALL OR DEFAULT CAN NOT DELETE'=>"默认或全部不能删除",
+ 'title' => '组名',
+ 'Attach' => '附件',
+ 'zip' => '压缩件',
+ 'text' => '文本',
+ 'file' => '文件',
+ 'Thumb' => '图片',
+ 'video' => '视频',
+ 'audio' => '音频',
+ 'OriginalName' => '原名',
+ 'name' => '名字',
+ 'thumb' => '缩略图',
+ 'FileType' => '文件类型',
+ 'Ext' => '后缀',
+ 'url' => '路径',
+ 'Path' => '路径',
+ 'Size' => '大小',
+ 'Driver' => '驱动',
+ 'Mime' => 'mime类型',
+ 'Userid' => '用户id',
+ 'Width' => '宽',
+ 'Height' => '高',
+ 'Group List' => '分组',
+ 'ALL OR DEFAULT CAN NOT DELETE'=> '默认或全部不能删除',
];
diff --git a/app/backend/lang/zh-cn/sys/config.php b/app/backend/lang/zh-cn/sys/config.php
index b3036972b..fa97a7541 100644
--- a/app/backend/lang/zh-cn/sys/config.php
+++ b/app/backend/lang/zh-cn/sys/config.php
@@ -3,71 +3,71 @@
return [
// 配置组
- 'Field already exist' => '字段已经存在',
- 'Config Code'=>'配置键',
- 'Config Value'=>'配置值',
- 'Config Default Value'=>'配置默认值',
- 'Config Extra Value'=>'配置附加值',
- 'Config Group' => '配置分组',
- 'Config Remark' => '配置备注',
- 'Group name' => '分组名',
- 'Group title' => '分组标题',
- 'Group has config' => '分组下有配置',
- 'Site Setting' => '网站设置',
- 'Email Setting' => '邮箱设置',
- 'Email Address' => '邮箱地址',
- 'Sms setting' => '短信设置',
- 'Upload setting' => '上传设置',
- 'Remark' =>"备注",
- 'Default_value' =>"默认值",
- 'Extra' =>"附加",
- 'Verify' =>"验证",
- 'value' =>"值",
- 'Default Value'=>'默认值',
- 'Type'=>'类型',
- 'Identifier' => '识别码',
- 'Code' => '识别码',
- 'Remarks'=>'备注',
- 'English characters Canot duplicate the current existing'=>'英文字符,不能重复',
- 'default'=>'默认',
- 'Sms appid' => '短信APPID',
- 'Sms appsecret' => '短密钥',
- 'Sms product name' => '短信产品名',
- 'Sms template id' => '短信模板id',
+ 'Field already exist' => '字段已经存在',
+ 'Config Code' => '配置键',
+ 'Config Value' => '配置值',
+ 'Config Default Value' => '配置默认值',
+ 'Config Extra Value' => '配置附加值',
+ 'Config Group' => '配置分组',
+ 'Config Remark' => '配置备注',
+ 'Group name' => '分组名',
+ 'Group title' => '分组标题',
+ 'Group has config' => '分组下有配置',
+ 'Site Setting' => '网站设置',
+ 'Email Setting' => '邮箱设置',
+ 'Email Address' => '邮箱地址',
+ 'Sms setting' => '短信设置',
+ 'Upload setting' => '上传设置',
+ 'Remark' => '备注',
+ 'Default_value' => '默认值',
+ 'Extra' => '附加',
+ 'Verify' => '验证',
+ 'value' => '值',
+ 'Default Value' => '默认值',
+ 'Type' => '类型',
+ 'Identifier' => '识别码',
+ 'Code' => '识别码',
+ 'Remarks' => '备注',
+ 'English characters Canot duplicate the current existing' => '英文字符,不能重复',
+ 'default' => '默认',
+ 'Sms appid' => '短信APPID',
+ 'Sms appsecret' => '短密钥',
+ 'Sms product name' => '短信产品名',
+ 'Sms template id' => '短信模板id',
- 'Upload Driver'=>"上传驱动",
- 'local'=>'本地',
- 'Alioss'=>'阿里oss',
- 'Qiniuoss'=>'七牛oss',
- 'Tencos'=>'腾讯oss',
- 'Email server' => '邮箱服务器',
- 'Email address' => '邮箱地址',
- 'Email port' => '邮箱端口',
- 'Server mailbox protocol' => '邮箱协议',
- 'Email password' => '邮箱授权密码',
- 'Send email person' => '发送者邮箱',
+ 'Upload Driver' => '上传驱动',
+ 'local' => '本地',
+ 'Alioss' => '阿里oss',
+ 'Qiniuoss' => '七牛oss',
+ 'Tencos' => '腾讯oss',
+ 'Email server' => '邮箱服务器',
+ 'Email address' => '邮箱地址',
+ 'Email port' => '邮箱端口',
+ 'Server mailbox protocol' => '邮箱协议',
+ 'Email password' => '邮箱授权密码',
+ 'Send email person' => '发送者邮箱',
- 'All right' => '所有权',
- 'Site name' => '网站名',
- 'Site title' => '网站标题',
- 'Site_logo' => '网站logo',
- 'Site email' => '网站邮箱',
- 'Site domain' => '网站域名',
- 'Meta keywords' => '网站关键字',
- 'Meta description' => '网站描述',
- 'Qrcode' => "二维码",
- 'Tips' => "提示",
- 'Maxfilesize' => "最大文件大小",
- 'Size' => "文件大小",
- 'File type' => "文件类型",
- 'Wateralpha'=>'水印深度',
- 'Water'=>'开启水印',
- 'WaterPosition'=>'水印位置',
- 'Watersize'=>'水印大小',
- 'watercolor'=>'水印颜色',
- 'Image/Text'=>'图片或文字',
- 'water setting'=>'水印设置',
- 'set'=>'配置',
- 'Editor'=>"编辑器"
+ 'All right' => '所有权',
+ 'Site name' => '网站名',
+ 'Site title' => '网站标题',
+ 'Site_logo' => '网站logo',
+ 'Site email' => '网站邮箱',
+ 'Site domain' => '网站域名',
+ 'Meta keywords' => '网站关键字',
+ 'Meta description' => '网站描述',
+ 'Qrcode' => '二维码',
+ 'Tips' => '提示',
+ 'Maxfilesize' => '最大文件大小',
+ 'Size' => '文件大小',
+ 'File type' => '文件类型',
+ 'Wateralpha' => '水印深度',
+ 'Water' => '开启水印',
+ 'WaterPosition' => '水印位置',
+ 'Watersize' => '水印大小',
+ 'watercolor' => '水印颜色',
+ 'Image/Text' => '图片或文字',
+ 'water setting' => '水印设置',
+ 'set' => '配置',
+ 'Editor' => '编辑器'
];
diff --git a/app/backend/lang/zh-cn/sys/configgroup.php b/app/backend/lang/zh-cn/sys/configgroup.php
index 0e867564d..232f24ad6 100644
--- a/app/backend/lang/zh-cn/sys/configgroup.php
+++ b/app/backend/lang/zh-cn/sys/configgroup.php
@@ -1,9 +1,9 @@
'配置分组',
- 'Group name' => '分组名',
- 'Group title' => '分组标题',
- 'Group has config' => '分组下有配置',
+ 'Config Group' => '配置分组',
+ 'Group name' => '分组名',
+ 'Group title' => '分组标题',
+ 'Group has config' => '分组下有配置',
];
\ No newline at end of file
diff --git a/app/backend/middleware/CheckRole.php b/app/backend/middleware/CheckRole.php
index ad742e21c..4d4a4859a 100644
--- a/app/backend/middleware/CheckRole.php
+++ b/app/backend/middleware/CheckRole.php
@@ -20,11 +20,14 @@ class CheckRole
public function handle($request, \Closure $next)
{
if(!Session::has('admin')) {
-
- $this->redirect(__u('backend/login/index'));
+ if($request->baseFile()!='/index.php' && str_contains($request->baseFile(), '.php')) {
+ $this->error('Please login first',url('login/index'));
+ }else{
+ $this->error('Please login first');
+ }
}
$auth = AuthService::instance();
- $auth->checkNode();
+ $auth->roleAccess();
//中间件handle方法的返回值必须是一个Response对象。
return $next($request);
}
diff --git a/app/backend/middleware/ViewNode.php b/app/backend/middleware/ViewNode.php
index 88a9cc5da..ffa2c29ed 100644
--- a/app/backend/middleware/ViewNode.php
+++ b/app/backend/middleware/ViewNode.php
@@ -4,7 +4,6 @@
use app\backend\service\AuthService;
use think\App;
-use think\facade\Config;
use think\facade\Lang;
use think\facade\Request;
use think\facade\View;
@@ -13,14 +12,13 @@ class ViewNode
{
public function handle($request, \Closure $next)
{
- [$appname, $controllername, $actionname] = [app('http')->getName(), $request->controller(), Request::action()];
+ [$appname, $controllername, $actionname] = [app('http')->getName(), $request->controller(true), Request::action()];
$controllers = explode('.', $controllername);
$jsname = '';
foreach ($controllers as $vo) {
- empty($jsname) ? $jsname = strtolower(Str::camel(parse_name($vo))) : $jsname .= '/' . strtolower(Str::camel(parse_name($vo)));
+ empty($jsname) ? $jsname = $vo : $jsname .= '/' . $vo;
}
- $controllername = strtolower(Str::camel(parse_name($controllername)));
- $actionname = strtolower(Str::camel(parse_name($actionname)));
+ $actionname = strtolower($actionname);
$requesturl = "{$appname}/{$controllername}/{$actionname}";
$autojs = file_exists(app()->getRootPath()."public".DS."static".DS."{$appname}".DS."js".DS."{$jsname}.js") ? true : false;
$jspath ="{$appname}/js/{$jsname}.js";
@@ -37,9 +35,12 @@ public function handle($request, \Closure $next)
'lang' => strip_tags(Lang::getLangset()),
'site' => syscfg('site'),
'upload' => syscfg('upload'),
- 'publicAjaxUrl' =>config('funadmin.publicAjaxUrl'),
+ 'editor' => syscfg('editor'),
+ 'public_ajax_url' =>config('funadmin.public_ajax_url'),
+ 'api_domain' =>config('funadmin.api_domain'),
+ 'api_login_url' =>config('funadmin.api_login_url'),
];
- View::assign('config',$config);
+ View::assign('CONFIG',$config);
$request->appname =$appname;
return $next($request);
}
diff --git a/app/backend/model/Admin.php b/app/backend/model/Admin.php
index 0fcba8101..c7fa42cfe 100644
--- a/app/backend/model/Admin.php
+++ b/app/backend/model/Admin.php
@@ -24,8 +24,7 @@ class Admin extends BackendModel {
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
diff --git a/app/backend/model/AdminLog.php b/app/backend/model/AdminLog.php
index 5c2345558..1d65a1e70 100644
--- a/app/backend/model/AdminLog.php
+++ b/app/backend/model/AdminLog.php
@@ -23,8 +23,7 @@ class AdminLog extends BackendModel
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
{
diff --git a/app/backend/model/AttachGroup.php b/app/backend/model/AttachGroup.php
index a4a620d6a..a22c8673e 100644
--- a/app/backend/model/AttachGroup.php
+++ b/app/backend/model/AttachGroup.php
@@ -26,9 +26,6 @@ class AttachGroup extends BackendModel
use SoftDelete;
-
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
public function __construct(array $data = [])
{
diff --git a/app/backend/model/AuthGroup.php b/app/backend/model/AuthGroup.php
index e7afce6a8..aaaed940a 100644
--- a/app/backend/model/AuthGroup.php
+++ b/app/backend/model/AuthGroup.php
@@ -27,8 +27,7 @@ class AuthGroup extends BackendModel
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
{
diff --git a/app/backend/model/AuthRule.php b/app/backend/model/AuthRule.php
index 4ed5899b7..6c93699a7 100644
--- a/app/backend/model/AuthRule.php
+++ b/app/backend/model/AuthRule.php
@@ -24,8 +24,7 @@ class AuthRule extends BackendModel
use SoftDelete;
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
{
diff --git a/app/backend/model/Member.php b/app/backend/model/Member.php
index 284d25129..67cc90664 100644
--- a/app/backend/model/Member.php
+++ b/app/backend/model/Member.php
@@ -26,17 +26,16 @@ class Member extends BackendModel {
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
{
parent::__construct($data);
}
- public function memberGroup(){
+ public function group(){
return $this->belongsTo('MemberGroup','group_id','id');
}
- public function memberLevel()
+ public function level()
{
return $this->belongsTo('MemberLevel', 'level_id', 'id', [], 'LEFT');
}
diff --git a/app/backend/model/MemberGroup.php b/app/backend/model/MemberGroup.php
index abc5a077d..a8857ca40 100644
--- a/app/backend/model/MemberGroup.php
+++ b/app/backend/model/MemberGroup.php
@@ -25,8 +25,7 @@ class MemberGroup extends BackendModel {
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
{
diff --git a/app/backend/model/MemberLevel.php b/app/backend/model/MemberLevel.php
index 6abbcfbd4..13671aac6 100644
--- a/app/backend/model/MemberLevel.php
+++ b/app/backend/model/MemberLevel.php
@@ -25,8 +25,7 @@ class MemberLevel extends BackendModel
- protected $deleteTime = 'delete_time';
- protected $defaultSoftDelete = 0;
+
public function __construct(array $data = [])
{
diff --git a/app/backend/service/AddonService.php b/app/backend/service/AddonService.php
index 7b0602e61..581534732 100644
--- a/app/backend/service/AddonService.php
+++ b/app/backend/service/AddonService.php
@@ -15,6 +15,7 @@
namespace app\backend\service;
use app\backend\model\AuthRule;
+use app\common\model\Addon;
use app\common\service\AbstractService;
use app\common\traits\Jump;
use fun\helper\SignHelper;
@@ -22,11 +23,11 @@
use think\db\exception\PDOException;
use think\Exception;
use think\facade\Cache;
-use think\facade\Config;
use think\facade\Cookie;
use think\facade\Db;
use think\facade\Request;
use think\facade\Session;
+use fun\addons\Service;
class AddonService extends AbstractService
{
@@ -35,6 +36,7 @@ class AddonService extends AbstractService
protected $myaddon = 'myaddon';
public function __construct()
{
+ parent::__construct();
}
//添加菜单
@@ -123,8 +125,199 @@ public function delMenuCache(){
Cache::delete('adminMenus_' . session('admin.id'));
}
-
-
+ /**
+ * 安装插件
+ * @param string $name
+ * @param string $type
+ * @return bool
+ */
+ public function installAddon(string $name,string $type=''){
+ $class = get_addons_instance($name);
+ if (empty($class)) {
+ throw new Exception(lang('addons %s is not ready', [$name]));
+ }
+ $addon_info = get_addons_info($name);
+ if(!empty($addon_info['depend'])){
+ $depend = explode(',',$addon_info['depend']);
+ foreach ($depend as $v) {
+ $dependAddon = get_addons_info($v);
+ if(empty($dependAddon)){
+ throw new Exception('Please install the dependent plugin first: '.$addon_info['depend']);
+ }
+ }
+ }
+ //添加数据库
+ try{
+ if($type!='upgrade'){
+ importsql($name);
+ }else{
+ $sqlFile = root_path().'addons/'.$name.'/'.'upgrade.sql';
+ if(!file_exists($sqlFile)){
+ $sqlFile = root_path().'addons/'.$name.'/'.'update.sql';
+ }
+ if(file_exists($sqlFile)){
+ importsql($name,$sqlFile);
+ }
+ }
+ } catch (Exception $e){
+ throw new Exception($e->getMessage());
+ }
+ // 安装菜单
+ $menu_config = get_addons_menu($name);
+ if(!empty($menu_config)){
+ list($menu,$pid) = $this->getMenu($menu_config);
+ $this->addAddonMenu($menu,$pid,$name);
+ }
+ $model = new Addon();
+ //安装插件
+ $class->install();
+ $addon_info['status'] = 1;
+ $list = $this->isInstall($name);
+ if($list){
+ if($list->delete_time > 0){
+ $model->restore(['id'=>$list->id]);
+ }
+ $res = $model->update(['status'=>1],['id'=>$list->id]);
+ }else{
+ $res = $model->save($addon_info);
+ }
+ if (!$res) {
+ throw new Exception(lang('addon install fail'));
+ }
+ Service::copyApp($name,$delete = true);
+ try {
+ Service::updateAddonsInfo($name);
+ //刷新addon文件
+ refreshaddons();
+ }catch (Exception $e){
+ throw new Exception($e->getMessage());
+ }
+ return true;
+ }
+ public function uninstallAddon(string $name){
+ try {
+ if (!$name) {
+ throw new Exception(lang(' addon name can not be empty'));
+ }
+ //插件名匹配
+ if (!preg_match("/^[a-zA-Z0-9]+$/", $name)) {
+ throw new Exception(lang('addon name is not right'));
+ }
+ $model = new Addon();
+ //获取插件信息
+ $info = $model->withTrashed()->where('name', $name)->find();
+ if (empty($info)) {
+ throw new Exception(lang('addon is not exist'));
+ }
+ if($info->status==1){
+ throw new Exception(lang('Please disable addons %s first',[$name]));
+ }
+ if (!$info->force()->delete()) {
+ throw new Exception(lang('addon uninstall fail'));
+ }
+ //卸载插件
+ $class = get_addons_instance($name);
+ $class->uninstall();
+ //删除菜单
+ $menu_config=get_addons_menu($name);
+ if(!empty($menu_config)){
+ list($menu,$pid) = $this->getMenu($menu_config);
+ $this->delAddonMenu($menu,$name);
+ }
+ //卸载sql;
+ uninstallsql($name);
+ //还原文件
+ Service::removeApp($name,$delete= true);
+ Service::updateAddonsInfo($name,1,0);
+ refreshaddons();
+ } catch (Exception $e) {
+ throw new Exception($e->getMessage());
+ }
+ return true;
+ }
+ /**
+ * @NodeAnnotation (title="是否安装")
+ * @param $name
+ * @return array|false|\think\Model|null
+ * @throws \think\dbException\DataNotFoundException
+ * @throws \think\dbException\DbException
+ * @throws \think\dbException\ModelNotFoundException
+ */
+ public function isInstall($name)
+ {
+ if (empty($name)) {
+ return false;
+ }
+ $addons = Addon::withTrashed()->where('name', $name)->find();
+ return $addons;
+ }
+ /**
+ * 获取菜单
+ * @param mixed $config
+ * @return array
';
- foreach ($list as $key => $val) {
- $laythis = $key == 0 ? 'layui-this' : '';
- $html['nav'] .= '
{$formData.realname}