diff --git a/README.md b/README.md index b48540f..4bd67d8 100644 --- a/README.md +++ b/README.md @@ -1,79 +1,18 @@ -![](https://www.thinkphp.cn/uploads/images/20230630/300c856765af4d8ae758c503185f8739.png) - -ThinkPHP 8.0 -=============== +# sentos ## 特性 -* 基于PHP`8.0+`重构 -* 升级`PSR`依赖 -* 依赖`think-orm`3.0版本 -* `6.0`/`6.1`无缝升级 - - -> ThinkPHP8.0的运行环境要求PHP8.0.0+ - -现在开始,你可以使用官方提供的[ThinkChat](https://chat.topthink.com/),让你在学习ThinkPHP的旅途中享受私人AI助理服务! - -![](https://www.topthink.com/uploads/assistant/20230630/4d1a3f0ad2958b49bb8189b7ef824cb0.png) - -## 文档 - -[完全开发手册](https://doc.thinkphp.cn) - -## 服务 - -ThinkPHP生态服务由[顶想云](https://www.topthink.com)(TOPThink Cloud)提供,为生态提供专业的开发者服务和价值之选。 - -## 赞助 -全新的[赞助计划](https://www.thinkphp.cn/sponsor)可以让你通过我们的网站、手册、欢迎页及GIT仓库获得巨大曝光,同时提升企业的品牌声誉,也更好保障ThinkPHP的可持续发展。 - -[![](https://www.thinkphp.cn/uploads/images/20230630/48396092a0515886a3da6bd268131c8f.png)](http://github.crmeb.net/u/TPSY) - -[![](https://www.thinkphp.cn/uploads/images/20230630/a12bd248beee0e7491dd0f79dc4dd5e9.png)](https://www.thinkphp.cn/sponsor) - -[![](https://www.thinkphp.cn/uploads/images/20230630/e7f48d909d41dd5ebaf4a5aa982d0455.png)](https://www.thinkphp.cn/sponsor) +- 后端基于thinkphp8 开发 +- 前端基于vue + aiox + vuex + electron + element plus开发 ## 安装 -~~~ -composer create-project topthink/think tp -~~~ +- 后端安装 -启动服务 +系统根目录下执行命令,安装后端扩展 -~~~ -cd tp -php think run -~~~ +> composer install -然后就可以在浏览器中访问 +配置好数据库链接,并导入数据库文件 -~~~ -http://localhost:8000 -~~~ - -如果需要更新框架使用 -~~~ -composer update topthink/framework -~~~ - -## 命名规范 - -`ThinkPHP`遵循PSR-2命名规范和PSR-4自动加载规范。 - -## 参与开发 - -直接提交PR或者Issue即可 - -## 版权信息 - -ThinkPHP遵循Apache2开源协议发布,并提供免费使用。 - -本项目包含的第三方源码和二进制文件之版权信息另行标注。 - -版权所有Copyright © 2006-2023 by ThinkPHP (http://thinkphp.cn) All rights reserved。 - -ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。 - -更多细节参阅 [LICENSE.txt](LICENSE.txt) +- 前端安装 diff --git a/app/controller/Base.php b/app/controller/Base.php index 3dfdc69..5645f0e 100644 --- a/app/controller/Base.php +++ b/app/controller/Base.php @@ -9,8 +9,23 @@ namespace app\controller; use app\BaseController; +use think\facade\Cache; +use app\services\system\DictionaryService; class Base extends BaseController{ public $data = ['code' => 1, 'data' => '', 'message' => '']; + + public function initialize(){ + $this->cacheData($this->request); //缓存基础数据 + } + + protected function cacheData($request) { + $diction = Cache::get('diction'); + if(!$diction){ + $service = app()->make(DictionaryService::class); + $data = $service->getDictionaryAll(); + Cache::set('diction', $data); + } + } } \ No newline at end of file diff --git a/app/controller/Index.php b/app/controller/Index.php index 6dc4d6e..3183a8d 100644 --- a/app/controller/Index.php +++ b/app/controller/Index.php @@ -8,7 +8,10 @@ // +---------------------------------------------------------------------- namespace app\controller; +use think\facade\Console; use app\controller\Base; +use Dcat\EasyExcel\Excel; +use app\services\FieldService; /** * @title 首页 @@ -24,11 +27,37 @@ class Index extends Base{ if(request()->isAjax()){ return ['code' => 1, 'data' => 'SentOS']; }else{ - return `SentOS
SentOS

赣ICP备13006622号-1

技术支持:腾速科技

`; + return view(`SentOS
SentOS

赣ICP备13006622号-1

技术支持:腾速科技

`); } } public function test(){ + // $output = Console::call('worker:gateway'); + $service = app()->make(\app\services\wechat\OauthService::class); + print_r($service->getQrCode($this->request)) ; + // return $output->fetch(); + // $array = [ + // ['id' => 1, 'name' => 'Brakus', 'email' => 'treutel@eg.com', 'created_at' => '...'], + // ]; + // Excel::export($array)->download('users.xlsx'); + // $area = \think\facade\Db::name('areas')->select(); + // $save = []; + // foreach($area as $val){ + // $save[] = ['title' => $val['area'], 'code' => $val['area_id'], 'parent_id' => $val['city_id'], 'first' => '', 'create_time' => time(), 'update_time' => time()]; + // } + // \think\facade\Db::name('area')->insertAll($save); + } + + /** + * @title 导出模版 + * + * @return void + */ + public function template(FieldService $service){ + $model = $this->request->param('model'); + $array = []; + $headings = array_flip($service->getFields($model)); + return Excel::export($array)->headings($headings)->download($model . time() . '.xlsx'); } public function miss(){ diff --git a/app/controller/auth/Department.php b/app/controller/admin/auth/Department.php similarity index 95% rename from app/controller/auth/Department.php rename to app/controller/admin/auth/Department.php index ba63fdb..d4c3bc0 100644 --- a/app/controller/auth/Department.php +++ b/app/controller/admin/auth/Department.php @@ -1,124 +1,124 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\auth; - -use think\facade\Request; -use app\model\auth\Departments; -use app\services\auth\DepartmentService; -use Xin\Support\Arr; -use app\controller\Base; - -class Department extends Base { - /** - * @title 部门列表 - * - * @time 2020年01月09日 - * @param Departments $department - * @return Array - */ - public function index() { - $list = app()->make(DepartmentService::class)->getDepartmentList($this->request)->toArray(); - if(count($list) > 0){ - $root = ''; - foreach ($list as $value) { - if($root == ''){ - $root = $value['parent_id']; - }else{ - if($root > $value['parent_id']){ - $root = $value['parent_id']; - } - } - } - $tree = Arr::tree($list, null, 0, ['id'=>'id', 'parent' => 'parent_id', 'child' => 'children']); - if(empty($tree)){ - $this->data['data'] = $list; - }else{ - $this->data['data'] = $tree; - } - }else{ - $this->data['data'] = []; - } - - return $this->data; - } - /** - * @title 添加部门 - * - * @time 2020年01月09日 - * @return Array - */ - public function add() { - $data = request()->post(); - $data['creator_id'] = request()->user['uid']; - try { - $result = Departments::create($data); - $this->data['message'] = '添加成功!'; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 更新部门 - * - * @time 2020年01月09日 - * @param $id - * @param Request $request - * @return Array - */ - public function edit() { - $data = request()->post(); - $data['creator_id'] = request()->user['uid']; - try { - $result = Departments::update($data); - $this->data['message'] = '更新成功!'; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 删除部门 - * - * @time 2020年01月09日 - * @param $id - * @return Array - */ - public function delete() { - $data = request()->post('id'); - $map = []; - if(is_array($data)){ - $map[] = ['id', 'IN', $data]; - }else if(is_numeric($data)){ - $map[] = ['id', '=', $data]; - } - try { - $result = Departments::destroy(function($query) use ($map){ - $query->where($map); - }); - $this->data['message'] = '删除成功!'; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 获取班级 - * - * @return void - */ - public function studentclass(){ - $this->data['data'] = app()->make(DepartmentService::class)->getStudentClassList(); - $this->data['code'] = 1; - return $this->data; - } + +// +---------------------------------------------------------------------- +namespace app\controller\admin\auth; + +use think\facade\Request; +use app\model\auth\Departments; +use app\services\auth\DepartmentService; +use Xin\Support\Arr; +use app\controller\Base; + +class Department extends Base { + /** + * @title 部门列表 + * + * @time 2020年01月09日 + * @param Departments $department + * @return Array + */ + public function index() { + $list = app()->make(DepartmentService::class)->getDepartmentList($this->request)->toArray(); + if(count($list) > 0){ + $root = ''; + foreach ($list as $value) { + if($root == ''){ + $root = $value['parent_id']; + }else{ + if($root > $value['parent_id']){ + $root = $value['parent_id']; + } + } + } + $tree = Arr::tree($list, null, 0, ['id'=>'id', 'parent' => 'parent_id', 'child' => 'children']); + if(empty($tree)){ + $this->data['data'] = $list; + }else{ + $this->data['data'] = $tree; + } + }else{ + $this->data['data'] = []; + } + + return $this->data; + } + /** + * @title 添加部门 + * + * @time 2020年01月09日 + * @return Array + */ + public function add() { + $data = request()->post(); + $data['creator_id'] = request()->user['uid']; + try { + $result = Departments::create($data); + $this->data['message'] = '添加成功!'; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 更新部门 + * + * @time 2020年01月09日 + * @param $id + * @param Request $request + * @return Array + */ + public function edit() { + $data = request()->post(); + $data['creator_id'] = request()->user['uid']; + try { + $result = Departments::update($data); + $this->data['message'] = '更新成功!'; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 删除部门 + * + * @time 2020年01月09日 + * @param $id + * @return Array + */ + public function delete() { + $data = request()->post('id'); + $map = []; + if(is_array($data)){ + $map[] = ['id', 'IN', $data]; + }else if(is_numeric($data)){ + $map[] = ['id', '=', $data]; + } + try { + $result = Departments::destroy(function($query) use ($map){ + $query->where($map); + }); + $this->data['message'] = '删除成功!'; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 获取班级 + * + * @return void + */ + public function studentclass(){ + $this->data['data'] = app()->make(DepartmentService::class)->getStudentClassList(); + $this->data['code'] = 1; + return $this->data; + } } \ No newline at end of file diff --git a/app/controller/auth/Index.php b/app/controller/admin/auth/Index.php similarity index 96% rename from app/controller/auth/Index.php rename to app/controller/admin/auth/Index.php index 919e0ad..a7b3ab9 100644 --- a/app/controller/auth/Index.php +++ b/app/controller/admin/auth/Index.php @@ -6,7 +6,7 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- -namespace app\controller\auth; +namespace app\controller\admin\auth; use app\controller\Base; use app\services\auth\AuthService; diff --git a/app/controller/auth/Role.php b/app/controller/admin/auth/Role.php similarity index 84% rename from app/controller/auth/Role.php rename to app/controller/admin/auth/Role.php index 86ca146..d377e1c 100644 --- a/app/controller/auth/Role.php +++ b/app/controller/admin/auth/Role.php @@ -1,91 +1,109 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\auth; - -use app\controller\Base; -use app\services\auth\RoleService; - -class Role extends Base{ - - /** - * @title 角色列表 - * - * @time 2019年12月09日 - * @return string|Json - */ - public function index() { - $tree = app()->make(RoleService::class)->getRolesList($this->request, true); - - $this->data['code'] = 1; - $this->data['data'] = $tree; - return $this->data; - } - - /** - * @title 角色修改 - * @time 2019年12月11日 - * @param $id - * @param Request $request - * @return Array - */ - public function edit(RoleService $service) { - try { - $service->updateRole($this->request); - $this->data['code'] = 1; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - - /** - * @title 角色授权 - * @time 2019年12月11日 - * @param $id - * @param Request $request - * @return Array - */ - public function auth() { - $role_id = $this->request->param('role_id', ''); - $auth = $this->request->param('auth', ''); - $service = app()->make(RoleService::class); - try { - $service->updateRolePermission($role_id, $auth); - $service->updateRoleAuth($this->request); - $this->data['code'] = 1; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - - /** - * @title 删除角色 - * - * @time 2019年12月11日 - * @param $id - * @throws FailedException - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - * @return Json - */ - public function delete(){ - try { - $service = app()->make(RoleService::class)->deleteRole($this->request); - $this->data['code'] = 1; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } -} + +// +---------------------------------------------------------------------- +namespace app\controller\admin\auth; + +use app\controller\Base; +use app\services\auth\RoleService; + +class Role extends Base{ + + /** + * @title 角色列表 + * + * @time 2019年12月09日 + * @return string|Json + */ + public function index() { + $tree = app()->make(RoleService::class)->getRolesList($this->request, true); + + $this->data['code'] = 1; + $this->data['data'] = $tree; + return $this->data; + } + + /** + * @title 角色添加 + * @time 2019年12月11日 + * @param $id + * @param Request $request + * @return Array + */ + public function add(RoleService $service) { + try { + $service->createRole($this->request); + $this->data['code'] = 1; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 角色修改 + * @time 2019年12月11日 + * @param $id + * @param Request $request + * @return Array + */ + public function edit(RoleService $service) { + try { + $service->updateRole($this->request); + $this->data['code'] = 1; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 角色授权 + * @time 2019年12月11日 + * @param $id + * @param Request $request + * @return Array + */ + public function auth() { + $role_id = $this->request->param('role_id', ''); + $auth = $this->request->param('auth', ''); + $service = app()->make(RoleService::class); + try { + $service->updateRolePermission($role_id, $auth); + $service->updateRoleAuth($this->request); + $this->data['code'] = 1; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 删除角色 + * + * @time 2019年12月11日 + * @param $id + * @throws FailedException + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @return Json + */ + public function delete(){ + try { + $service = app()->make(RoleService::class)->deleteRole($this->request); + $this->data['code'] = 1; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } +} diff --git a/app/controller/auth/User.php b/app/controller/admin/auth/User.php similarity index 95% rename from app/controller/auth/User.php rename to app/controller/admin/auth/User.php index 68748ce..b66be71 100644 --- a/app/controller/auth/User.php +++ b/app/controller/admin/auth/User.php @@ -1,120 +1,120 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\auth; - -use app\services\auth\UsersService; -use app\controller\Base; - -class User extends Base{ - /** - * @title 用户列表 - * @param int $uid - * @return array - */ - public function index(UsersService $user){ - $list = $user->getUserList($this->request); - $this->data['data'] = $list; - return $this->data; - } - /** - * @title 添加用户 - * @param int $uid - * @return array - */ - public function add(){ - try { - $res = app()->make(UsersService::class)->createUsers($this->request); - $this->data['code'] = 1; - $this->data['data'] = $res; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 修改用户信息 - * @param int $uid - * @return array - */ - public function edit(){ - try { - $res = app()->make(UsersService::class)->updateUsers($this->request); - $this->data['code'] = 1; - $this->data['data'] = $res; - $this->data['message'] = "更新成功!"; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - - /** - * @title 修改密码 - * - * @return void - */ - public function passwd(){ - try { - $res = app()->make(UsersService::class)->updateUserPassword($this->request); - $this->data['code'] = 1; - $this->data['data'] = $res; - $this->data['message'] = "修改成功"; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 批量导入用户 - * @param int $uid - * @return array - */ - public function insert(){ - try { - $users = app()->make(UsersService::class)->insertAll($this->request); - $this->data['data'] = $users; - $this->data['code'] = 1; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - - /** - * @title 用户信息 - * @param int $uid - * @return array - */ - public function info(){ - $this->data['data'] = app()->make(UsersService::class)->userInfo($this->request->user['uid']); - $this->data['code'] = 1; - return $this->data; - } - - /** - * @title 用户授权 - * @return array - */ - public function auth(){ - try { - $uid = $this->request->param('uid'); - $role = $this->request->param('role'); - app()->make(UsersService::class)->updateRoles($uid, $role); - $this->data['message'] = '更新成功!'; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } + +// +---------------------------------------------------------------------- +namespace app\controller\admin\auth; + +use app\services\auth\UsersService; +use app\controller\Base; + +class User extends Base{ + /** + * @title 用户列表 + * @param int $uid + * @return array + */ + public function index(UsersService $user){ + $list = $user->getUserList($this->request); + $this->data['data'] = $list; + return $this->data; + } + /** + * @title 添加用户 + * @param int $uid + * @return array + */ + public function add(){ + try { + $res = app()->make(UsersService::class)->createUsers($this->request); + $this->data['code'] = 1; + $this->data['data'] = $res; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 修改用户信息 + * @param int $uid + * @return array + */ + public function edit(){ + try { + $res = app()->make(UsersService::class)->updateUsers($this->request); + $this->data['code'] = 1; + $this->data['data'] = $res; + $this->data['message'] = "更新成功!"; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 修改密码 + * + * @return void + */ + public function passwd(){ + try { + $res = app()->make(UsersService::class)->updateUserPassword($this->request); + $this->data['code'] = 1; + $this->data['data'] = $res; + $this->data['message'] = "修改成功"; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 批量导入用户 + * @param int $uid + * @return array + */ + public function insert(){ + try { + $users = app()->make(UsersService::class)->insertAll($this->request); + $this->data['data'] = $users; + $this->data['code'] = 1; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 用户信息 + * @param int $uid + * @return array + */ + public function info(){ + $this->data['data'] = app()->make(UsersService::class)->userInfo($this->request->user['uid']); + $this->data['code'] = 1; + return $this->data; + } + + /** + * @title 用户授权 + * @return array + */ + public function auth(){ + try { + $uid = $this->request->param('uid'); + $role = $this->request->param('role'); + app()->make(UsersService::class)->updateRoles($uid, $role); + $this->data['message'] = '更新成功!'; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } } \ No newline at end of file diff --git a/app/controller/admin/operate/Ads.php b/app/controller/admin/operate/Ads.php new file mode 100644 index 0000000..364be76 --- /dev/null +++ b/app/controller/admin/operate/Ads.php @@ -0,0 +1,81 @@ + +// +---------------------------------------------------------------------- +namespace app\controller\admin\operate; + +use app\controller\Base; +use app\services\operate\AdsService; + +class Ads extends Base{ + + + /** + * @title 广告列表 + * + * @param AdsService $service + * @return void + */ + public function index(AdsService $service){ + $this->data['data'] = $service->getDataList($this->request); + return $this->data; + } + + /** + * @title 添加广告 + * + * @param AdsService $service + * @return void + */ + public function add(AdsService $service){ + try { + $data = $service->create($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 编辑广告 + * + * @param AdsService $service + * @return void + */ + public function edit(AdsService $service){ + try { + $data = $service->update($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 删除广告 + * + * @param AdsService $service + * @return void + */ + public function delete(AdsService $service){ + try { + $data = $service->delete($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } +} \ No newline at end of file diff --git a/app/controller/admin/operate/Client.php b/app/controller/admin/operate/Client.php new file mode 100644 index 0000000..3835742 --- /dev/null +++ b/app/controller/admin/operate/Client.php @@ -0,0 +1,202 @@ + +// +---------------------------------------------------------------------- +namespace app\controller\admin\operate; + +use app\controller\Base; +use app\services\operate\ClientService; +use app\services\operate\ClientMenuService; +use app\services\operate\ClientConfigService; + +class Client extends Base{ + + /** + * @title 客户端列表 + * + * @param ClientService $service + * @return void + */ + public function index(ClientService $service){ + $this->data['data'] = $service->getDataList($this->request); + return $this->data; + } + + /** + * @title 添加客户端 + * + * @param ClientService $service + * @return void + */ + public function add(ClientService $service){ + try { + $data = $service->create($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 编辑客户端 + * + * @param ClientService $service + * @return void + */ + public function edit(ClientService $service){ + try { + $data = $service->update($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 删除客户端 + * + * @param ClientService $service + * @return void + */ + public function delete(ClientService $service){ + try { + $data = $service->delete($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + + /** + * @title 客户端菜单列表 + * + * @param ClientMenuService $service + * @return void + */ + public function menu(ClientMenuService $service){ + $this->data['data'] = $service->getDataList($this->request); + return $this->data; + } + + /** + * @title 添加客户端菜单 + * + * @param ClientMenuService $service + * @return void + */ + public function addmenu(ClientMenuService $service){ + try { + $data = $service->create($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 编辑客户端菜单 + * + * @param ClientMenuService $service + * @return void + */ + public function editmenu(ClientMenuService $service){ + try { + $data = $service->update($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 删除客户端菜单 + * + * @param ClientMenuService $service + * @return void + */ + public function delmenu(ClientMenuService $service){ + try { + $data = $service->delete($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 添加客户端配置 + * + * @param ClientConfigService $service + * @return void + */ + public function addconfig(ClientConfigService $service){ + try { + $data = $service->create($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 添加客户端配置 + * + * @param ClientConfigService $service + * @return void + */ + public function editconfig(ClientConfigService $service){ + try { + $data = $service->update($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + + /** + * @title 删除客户端配置 + * + * @param ClientConfigService $service + * @return void + */ + public function delconfig(ClientConfigService $service){ + try { + $data = $service->delete($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } +} \ No newline at end of file diff --git a/app/controller/system/Dict.php b/app/controller/admin/system/Dict.php similarity index 93% rename from app/controller/system/Dict.php rename to app/controller/admin/system/Dict.php index d0c57aa..e9700ff 100644 --- a/app/controller/system/Dict.php +++ b/app/controller/admin/system/Dict.php @@ -1,127 +1,133 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\system; - -use app\controller\Base; -use app\services\system\DictionaryService; - -/** - * @title 字典功能 - */ -class Dict extends Base{ - - /** - * @title 字典分类数据 - * - * @return void - */ - public function category(DictionaryService $dic){ - $list = $dic->getTree($this->request); - $this->data['data'] = $list; - return $this->data; - } - /** - * @title 添加字典分类 - * - * @return void - */ - public function addcate(DictionaryService $dic){ - try { - $data = $dic->addcate($this->request); - $this->data['code'] = 1; - $this->data['data'] = $data; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 修改字典分类 - * - * @return void - */ - public function editcate(DictionaryService $dic){ - try { - $data = $dic->editcate($this->request); - $this->data['code'] = 1; - $this->data['data'] = $data; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - public function delcate(DictionaryService $dic){ - $dic->deleteCategory($this->request); - return $this->data; - } - /** - * @title 字典列表 - * - * @return void - */ - public function lists(DictionaryService $dic){ - $list = $dic->getDictionary($this->request); - $this->data['data'] = $list; - return $this->data; - } - /** - * @title 添加字典 - * - * @return void - */ - public function add(DictionaryService $dic){ - try { - $data = $dic->createDic($this->request); - $this->data['code'] = 1; - $this->data['data'] = $data; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 修改字典 - * - * @return void - */ - public function edit(DictionaryService $dic){ - try { - $data = $dic->updateDic($this->request); - $this->data['code'] = 1; - $this->data['data'] = $data; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 删除字典 - * - * @param DictionaryService $dic - * @return void - */ - public function delete(DictionaryService $dic){ - $dic->deleteDic($this->request); - return $this->data; - } - /** - * @title 字典明细 - * - * @return void - */ - public function detail(DictionaryService $dic){ - $list = $dic->getDictionaryDetail($this->request); - $this->data['data'] = $list; - return $this->data; - } + +// +---------------------------------------------------------------------- +namespace app\controller\admin\system; + +use app\controller\Base; +use app\services\system\DictionaryService; + +/** + * @title 字典功能 + */ +class Dict extends Base{ + + /** + * @title 字典分类数据 + * + * @return void + */ + public function category(DictionaryService $dic){ + $list = $dic->getTree($this->request); + $this->data['data'] = $list; + return $this->data; + } + /** + * @title 添加字典分类 + * + * @return void + */ + public function addcate(DictionaryService $dic){ + try { + $data = $dic->addcate($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 修改字典分类 + * + * @return void + */ + public function editcate(DictionaryService $dic){ + try { + $data = $dic->editcate($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + public function delcate(DictionaryService $dic){ + $dic->deleteCategory($this->request); + return $this->data; + } + /** + * @title 字典列表 + * + * @return void + */ + public function lists(DictionaryService $dic){ + $list = $dic->getDictionary($this->request); + $this->data['data'] = $list; + return $this->data; + } + /** + * @title 添加字典 + * + * @return void + */ + public function add(DictionaryService $dic){ + try { + $data = $dic->createDic($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 修改字典 + * + * @return void + */ + public function edit(DictionaryService $dic){ + try { + $data = $dic->updateDic($this->request); + $this->data['code'] = 1; + $this->data['data'] = $data; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 删除字典 + * + * @param DictionaryService $dic + * @return void + */ + public function delete(DictionaryService $dic){ + $dic->deleteDic($this->request); + return $this->data; + } + /** + * @title 字典明细 + * + * @return void + */ + public function detail(DictionaryService $dic){ + $list = $dic->getDictionaryDetail($this->request); + $this->data['data'] = $list; + return $this->data; + } + + public function all(DictionaryService $dic){ + $list = $dic->getDictionaryAll($this->request); + $this->data['data'] = $list; + return $this->data; + } } \ No newline at end of file diff --git a/app/controller/system/File.php b/app/controller/admin/system/File.php similarity index 97% rename from app/controller/system/File.php rename to app/controller/admin/system/File.php index 5355350..c9c2e6a 100644 --- a/app/controller/system/File.php +++ b/app/controller/admin/system/File.php @@ -6,7 +6,7 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- -namespace app\controller\system; +namespace app\controller\admin\system; use app\controller\Base; use app\validate\File as Files; diff --git a/app/controller/system/Index.php b/app/controller/admin/system/Index.php similarity index 94% rename from app/controller/system/Index.php rename to app/controller/admin/system/Index.php index f363e19..bc117ed 100644 --- a/app/controller/system/Index.php +++ b/app/controller/admin/system/Index.php @@ -1,45 +1,45 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\system; - -use app\controller\Base; -use app\services\system\ConfigService; - -class Index extends Base{ - - /** - * @title 系统版本 - * - * @return void - */ - public function version(){ - $system_info_mysql = \think\facade\Db::query("select version() as v;"); - $this->data['data'] = [ - ['label' => '核心版本', 'values' => \think\facade\Env::get('version')], - ['label' => '服务器操作系统', 'values' => PHP_OS], - ['label' => '运行环境', 'values' => $_SERVER['SERVER_SOFTWARE']], - ['label' => 'MYSQL版本', 'values' => $system_info_mysql[0]['v']], - ['label' => '上传限制', 'values' => '10'] - ]; - return $this->data; - } - - /** - * 获取配置列表 - * - * @param ConfigService $service - * @return void - */ - public function setting(ConfigService $service){ - $list = $service->getConfigField(); - - $this->data['data'] = $list; - return $this->data; - } + +// +---------------------------------------------------------------------- +namespace app\controller\admin\system; + +use app\controller\Base; +use app\services\system\ConfigService; + +class Index extends Base{ + + /** + * @title 系统版本 + * + * @return void + */ + public function version(){ + $system_info_mysql = \think\facade\Db::query("select version() as v;"); + $this->data['data'] = [ + ['label' => '核心版本', 'values' => \think\facade\Env::get('version')], + ['label' => '服务器操作系统', 'values' => PHP_OS], + ['label' => '运行环境', 'values' => $_SERVER['SERVER_SOFTWARE']], + ['label' => 'MYSQL版本', 'values' => $system_info_mysql[0]['v']], + ['label' => '上传限制', 'values' => '10'] + ]; + return $this->data; + } + + /** + * 获取配置列表 + * + * @param ConfigService $service + * @return void + */ + public function setting(ConfigService $service){ + $list = $service->getConfigField(); + + $this->data['data'] = $list; + return $this->data; + } } \ No newline at end of file diff --git a/app/controller/system/Log.php b/app/controller/admin/system/Log.php similarity index 96% rename from app/controller/system/Log.php rename to app/controller/admin/system/Log.php index dd47963..ce0c162 100644 --- a/app/controller/system/Log.php +++ b/app/controller/admin/system/Log.php @@ -6,7 +6,7 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- -namespace app\controller\system; +namespace app\controller\admin\system; use app\controller\Base; use app\services\auth\UsersLogService; diff --git a/app/controller/system/Menu.php b/app/controller/admin/system/Menu.php similarity index 95% rename from app/controller/system/Menu.php rename to app/controller/admin/system/Menu.php index 0887ed9..7a92b11 100644 --- a/app/controller/system/Menu.php +++ b/app/controller/admin/system/Menu.php @@ -1,134 +1,134 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\system; - -use app\controller\Base; -use app\services\auth\MenuService; -use app\services\auth\AuthService; - -class Menu extends Base{ - - /** - * @title 权限列表 - * - * @time 2020年01月09日 - * @param Departments $department - * @return Array - */ - public function index() { - $data = app()->make(MenuService::class)->getSystemMenu(false); - $this->data['data'] = $data; - return $this->data; - } - /** - * @title 权限保存 - * - * @time 2020年01月09日 - * @return Array - */ - public function add() { - $data = request()->post(); - $data['creator_id'] = request()->user['uid']; - try { - $result = app()->make(MenuService::class)->createData($data); - $this->data['data'] = $result; - $this->data['message'] = '添加成功!'; - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 权限更新 - * - * @time 2020年01月09日 - * @param $id - * @param Request $request - * @return Array - */ - public function edit() { - $data = request()->post(); - try { - $result = app()->make(MenuService::class)->saveData($data); - if($result){ - $this->data['data'] = app()->make(AuthService::class)->getAuthMenu(); - } - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 权限删除 - * - * @time 2020年01月09日 - * @param $id - * @return Array - */ - public function delete() { - $ids = request()->post('ids'); - try { - $result = app()->make(MenuService::class)->deleteMenu($ids); - $this->data['data'] = app()->make(MenuService::class)->getSystemMenu(); - } catch (\Exception $e) { - $this->data['code'] = 0; - $this->data['message'] = $e->getMessage(); - } - return $this->data; - } - /** - * @title 菜单路由 - * - * @time 2020年01月09日 - * @param $id - * @return Array - */ - public function routes(Permissions $permission) { - $map = []; - $map[] = ['type', '=', 1]; - $map[] = ['hidden', '=', 1]; - $list = $permission->where($map)->field('router,name,icon,id,parent_id')->order('sort asc')->select()->toArray(); - $tree = (new Tree())->listToTree($list, 'id', 'parent_id', 'children'); - $this->data['data'] = [['router' => 'root', 'children' => $tree]]; - return $this->data; - } - /** - * @title 权限数据 - * - * @time 2020年01月09日 - * @param $id - * @return Array - */ - public function permission(Permissions $permission) { - $map = []; - $map[] = ['hidden', '=', 1]; - $list = $permission->where($map)->field('router,name,icon,id,parent_id')->order('sort asc')->select()->toArray(); - $data = []; - foreach($list as $item){ - if($item['type'] == 1){ - $data[$item['id']] = $item; - }else{ - $data[$item['parent_id']]['module'] = $item; - } - } - $this->data['data'] = $data; - return $this->data; - } - /** - * @title 我的菜单 - * @return Array - */ - public function my(AuthService $service){ - $this->data['code'] = 1; - $this->data['data'] = ['menu' => $service->getAuthMenu($this->request), 'permissions' => $service->getAuthPermissions($this->request)]; - return $this->data; - } -} + +// +---------------------------------------------------------------------- +namespace app\controller\admin\system; + +use app\controller\Base; +use app\services\auth\MenuService; +use app\services\auth\AuthService; + +class Menu extends Base{ + + /** + * @title 权限列表 + * + * @time 2020年01月09日 + * @param Departments $department + * @return Array + */ + public function index() { + $data = app()->make(MenuService::class)->getSystemMenu(false); + $this->data['data'] = $data; + return $this->data; + } + /** + * @title 权限保存 + * + * @time 2020年01月09日 + * @return Array + */ + public function add() { + $data = request()->post(); + $data['creator_id'] = request()->user['uid']; + try { + $result = app()->make(MenuService::class)->createData($data); + $this->data['data'] = $result; + $this->data['message'] = '添加成功!'; + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 权限更新 + * + * @time 2020年01月09日 + * @param $id + * @param Request $request + * @return Array + */ + public function edit() { + $data = request()->post(); + try { + $result = app()->make(MenuService::class)->saveData($data); + if($result){ + $this->data['data'] = app()->make(AuthService::class)->getAuthMenu(); + } + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 权限删除 + * + * @time 2020年01月09日 + * @param $id + * @return Array + */ + public function delete() { + $ids = request()->post('ids'); + try { + $result = app()->make(MenuService::class)->deleteMenu($ids); + $this->data['data'] = app()->make(MenuService::class)->getSystemMenu(); + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + return $this->data; + } + /** + * @title 菜单路由 + * + * @time 2020年01月09日 + * @param $id + * @return Array + */ + public function routes(Permissions $permission) { + $map = []; + $map[] = ['type', '=', 1]; + $map[] = ['hidden', '=', 1]; + $list = $permission->where($map)->field('router,name,icon,id,parent_id')->order('sort asc')->select()->toArray(); + $tree = (new Tree())->listToTree($list, 'id', 'parent_id', 'children'); + $this->data['data'] = [['router' => 'root', 'children' => $tree]]; + return $this->data; + } + /** + * @title 权限数据 + * + * @time 2020年01月09日 + * @param $id + * @return Array + */ + public function permission(Permissions $permission) { + $map = []; + $map[] = ['hidden', '=', 1]; + $list = $permission->where($map)->field('router,name,icon,id,parent_id')->order('sort asc')->select()->toArray(); + $data = []; + foreach($list as $item){ + if($item['type'] == 1){ + $data[$item['id']] = $item; + }else{ + $data[$item['parent_id']]['module'] = $item; + } + } + $this->data['data'] = $data; + return $this->data; + } + /** + * @title 我的菜单 + * @return Array + */ + public function my(AuthService $service){ + $this->data['code'] = 1; + $this->data['data'] = ['menu' => $service->getAuthMenu($this->request), 'permissions' => $service->getAuthPermissions($this->request)]; + return $this->data; + } +} diff --git a/app/controller/api/auth/Index.php b/app/controller/api/auth/Index.php new file mode 100644 index 0000000..9ed3d28 --- /dev/null +++ b/app/controller/api/auth/Index.php @@ -0,0 +1,26 @@ + +// +---------------------------------------------------------------------- +namespace app\controller\api\auth; + +use app\controller\Base; +use app\services\wechat\OauthService; + +class Index extends Base{ + + public function wxlogin(OauthService $service){ + try { + $this->data['data'] = $service->oauth($this->request); + } catch (\Exception $e) { + $this->data['code'] = 0; + $this->data['message'] = $e->getMessage(); + } + + return $this->data; + } +} \ No newline at end of file diff --git a/app/controller/api/operate/Ads.php b/app/controller/api/operate/Ads.php new file mode 100644 index 0000000..1358b0b --- /dev/null +++ b/app/controller/api/operate/Ads.php @@ -0,0 +1,26 @@ + +// +---------------------------------------------------------------------- +namespace app\controller\api\operate; + +use app\controller\Base; +use app\services\operate\AdsService; + +class Ads extends Base{ + + /** + * @title 客户端菜单 + * + * @return void + */ + public function detail(AdsService $service){ + $this->data['data'] = $service->getAdsDetail($this->request); + + return $this->data; + } +} \ No newline at end of file diff --git a/app/controller/api/operate/Client.php b/app/controller/api/operate/Client.php new file mode 100644 index 0000000..6ee7316 --- /dev/null +++ b/app/controller/api/operate/Client.php @@ -0,0 +1,26 @@ + +// +---------------------------------------------------------------------- +namespace app\controller\api\operate; + +use app\controller\Base; +use app\services\operate\ClientService; + +class Client extends Base{ + + /** + * @title 客户端菜单 + * + * @return void + */ + public function menu(ClientService $service){ + $this->data['data'] = $service->getClientMenu($this->request); + + return $this->data; + } +} \ No newline at end of file diff --git a/app/controller/customer/Company.php b/app/controller/customer/Company.php deleted file mode 100644 index 7a2c381..0000000 --- a/app/controller/customer/Company.php +++ /dev/null @@ -1,71 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace app\controller\customer; - -use app\controller\Base; -use app\services\company\CompanyService; - -/** - * @title 企业信息模型 - */ -class Company extends Base{ - - /** - * @title 企业列表 - * - * @time 2020年01月09日 - * @param CompanyService $service - * @return Array - */ - public function index(CompanyService $service) { - $data = $service->getCompanyList($this->request); - - $this->data['data'] = $data; - return $this->data; - } - - /** - * @title 企业详情 - * - * @time 2020年01月09日 - * @param CompanyService $service - * @return Array - */ - public function detail(CompanyService $service) { - $data = $service->getCompanyDetail($this->request); - - $this->data['data'] = $data; - return $this->data; - } - - /** - * @title 修改企业 - * - * @time 2020年01月09日 - * @param CompanyService $service - * @return Array - */ - public function edit(CompanyService $service) { - $data = $service->editCompany($this->request); - - $this->data['data'] = $data; - return $this->data; - } - - /** - * @title 导入企业信息 - * - * @param CompanyService $service - * @return void - */ - public function insert(CompanyService $service){ - $this->data['data'] = $service->insertCompanyData($this->request); - return $this->data; - } -} \ No newline at end of file diff --git a/app/middleware/AllowCrossDomain.php b/app/middleware/AllowCrossDomain.php index 562d7e9..e44c7ff 100644 --- a/app/middleware/AllowCrossDomain.php +++ b/app/middleware/AllowCrossDomain.php @@ -24,7 +24,7 @@ class AllowCrossDomain{ ]; public function __construct(Config $config){ - $this->header = array_merge($this->header, $config->get('cross', '')); + $this->header = array_merge($this->header, $config->get('cross', [])); } /** diff --git a/app/middleware/ApiCheck.php b/app/middleware/ApiCheck.php new file mode 100644 index 0000000..33bd4ed --- /dev/null +++ b/app/middleware/ApiCheck.php @@ -0,0 +1,47 @@ + +// +---------------------------------------------------------------------- +declare (strict_types = 1); + +namespace app\middleware; + +use think\App; +use think\Response; +use leruge\exception\JWTTokenNotFoundException; + +class ApiCheck{ + protected $app; + + public function __construct(App $app){ + $this->app = $app; + } + + /** + * @title 处理请求 + * + * @param [type] $request + * @param \Closure $next + * @param [type] $store + * @return void + */ + public function handle($request, \Closure $next, $store = null){ + try { + $verify = \leruge\facade\JWT::validate();; + if (true === $verify) { + $student = \leruge\facade\JWT::auth(); + if ($student->id) { + // 路由注入 + $request->student = $student; + } + return $next($request); + } + } catch (JWTTokenNotFoundException $e) { + return Response::create(['message' => '未登录或登录过期!', 'code' => 2000], 'json', 401); + } + } +} diff --git a/app/middleware/Validate.php b/app/middleware/Validate.php index 277f11f..166d741 100644 --- a/app/middleware/Validate.php +++ b/app/middleware/Validate.php @@ -37,7 +37,7 @@ class Validate { if (!$v->check($params)) { //校验不通过则直接返回错误信息 $data = array( - 'msg' => $v->getError(), + 'message' => $v->getError(), 'code' => 0, 'data' => '', 'time' => time(), diff --git a/app/model/BaseModel.php b/app/model/BaseModel.php index c78b54a..e69d59b 100644 --- a/app/model/BaseModel.php +++ b/app/model/BaseModel.php @@ -10,6 +10,7 @@ namespace app\model; use think\Model; use think\facade\Config; +use think\facade\Env; use think\facade\Db; class BaseModel extends Model{ @@ -18,22 +19,32 @@ class BaseModel extends Model{ $auth = request()->auth(); $uid = request()->user['uid']; $map = []; - if(!in_array($uid, Config::get('auth.admin_root'))){ + if($uid != Env::get('admin')){ $subMap = []; if($auth['data_range'] == 2){ $subMap[] = ['department_id', 'IN', getDepartmentChild($auth['department_id'])]; }elseif($auth['data_range'] == 3){ $subMap[] = ['department_id', 'IN', $auth['department_id']]; }elseif($auth['data_range'] == 4){ - $map[] = ['uid', '=', $uid]; + $map[] = ['user_id', '=', $uid]; + }else{ + $m = [['user_id', '=', $uid], ['user_id', '=', 0]]; + $query->where(function($q) use($m){ + $q->whereOr($m); + }); } if(!empty($subMap)){ $subsql = Db::name('users')->where($subMap)->field('uid')->buildSql(); $subsql = str_replace(" AS thinkphp) AS T1 )", "", $subsql); $subsql = str_replace("SELECT T1.* FROM (SELECT thinkphp.*, ROW_NUMBER() OVER ( ORDER BY rand()) AS ROW_NUMBER FROM (", "", $subsql); - $map[] = ['uid', 'IN', Db::raw($subsql)]; + $map[] = ['user_id', 'IN', Db::raw($subsql)]; } } - $query->where($where)->where($map); + if(!empty($map)){ + $query->where($map); + } + if(!empty($where)){ + $query->where($where); + } } } \ No newline at end of file diff --git a/app/model/customer/Company.php b/app/model/customer/Company.php deleted file mode 100644 index b8e3146..0000000 --- a/app/model/customer/Company.php +++ /dev/null @@ -1,67 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace app\model\customer; - -use app\model\BaseModel; -use think\model\concern\SoftDelete; -use think\facade\Cache; - -class Company extends BaseModel{ - - use SoftDelete; - protected $deleteTime = 'delete_time'; - protected $defaultSoftDelete = 0; - - - public $insertFieldAlis = [ - '企业编号' => ['name' => 'org_code', 'table' => 'company'], - '公司名称' => ['name' => 'name', 'table' => 'company'], - '网址' => ['name' => 'web_site', 'table' => 'company'], - '一级行业' => ['name' => 'industry', 'table' => 'company'], - '二级行业' => ['name' => 'industry_sub', 'table' => 'company'], - '三级行业' => ['name' => 'industry_three', 'table' => 'company'], - '省份' => ['name' => 'province', 'table' => 'company'], - '城市' => ['name' => 'city', 'table' => 'company'], - '区县' => ['name' => 'area', 'table' => 'company'], - '年营业额' => ['name' => 'turnover_text', 'table' => 'company',], - '员工人数' => ['name' => 'staff_num_text', 'table' => 'company'], - '注册资金' => ['name' => 'reg_capital', 'table' => 'company'], - '资金类型' => ['name' => 'reg_capital_type', 'table' => 'company'], - 'PC数量' => ['name' => 'pc_num_text', 'table' => 'company'], - '营收规模' => ['name' => 'turnover', 'table' => 'company'], - '社保人数' => ['name' => 'social_insurance', 'table' => 'company'], - '企业性质' => ['name' => 'company_type', 'table' => 'company'], - '是否上市' => ['name' => 'is_ipo_text', 'table' => 'company'], - '融资信息' => ['name' => 'finance_info', 'table' => 'company'], - '企业标签' => ['name' => 'tags', 'table' => 'company'], - '企业状态' => ['name' => 'status', 'table' => 'company'], - '成立时间' => ['name' => 'reg_date', 'table' => 'company'], - '注册地址' => ['name' => 'reg_address', 'table' => 'company'], - '联系人' => ['name' => 'name', 'table' => 'contact'], - '岗位' => ['name' => 'job','table' => 'contact'], - '固定电话' => ['name' => 'phone', 'table' => 'contact'], - '手机号码' => ['name' => 'mobile', 'table' => 'contact'], - '邮箱' => ['name' => 'email', 'table' => 'contact'], - '是否法人' => ['name' => 'is_faren', 'table' => 'contact'] - ]; - - public function getAreaTAttr($value, $data){ - $text = [$data['province'], $data['city'], $data['area']]; - return implode(",", array_filter($text)); - } - - public function getIndustryTAttr($value, $data){ - $text = [$data['industry'], $data['industry_sub'], $data['industry_three']]; - return implode(",", array_filter($text)); - } - - public function contact(){ - return $this->hasMany(Contact::class); - } -} \ No newline at end of file diff --git a/app/model/operate/Ads.php b/app/model/operate/Ads.php new file mode 100644 index 0000000..0ec7493 --- /dev/null +++ b/app/model/operate/Ads.php @@ -0,0 +1,37 @@ + +// +---------------------------------------------------------------------- +namespace app\model\operate; + +use app\model\BaseModel; +use think\model\concern\SoftDelete; +use think\facade\Cache; + +class Ads extends BaseModel{ + + protected function getStatusTextAttr($value, $data){ + $status = ['禁用', '启用']; + return isset($status[$data['status']]) ? $status[$data['status']] : ''; + } + + public function getPhotoAttr($value, $data){ + if($data['photo_list']){ + if($data['type'] == 1){ + return explode(",", $data['photo_list']); + }else{ + return $data['photo_list']; + } + }else{ + if($data['type'] == 1){ + return []; + }else{ + return ''; + } + } + } +} \ No newline at end of file diff --git a/app/model/operate/Client.php b/app/model/operate/Client.php new file mode 100644 index 0000000..9b657a8 --- /dev/null +++ b/app/model/operate/Client.php @@ -0,0 +1,25 @@ + +// +---------------------------------------------------------------------- +namespace app\model\operate; + +use app\model\BaseModel; +use think\model\concern\SoftDelete; +use think\facade\Cache; + +class Client extends BaseModel{ + + protected function getStatusTextAttr($value, $data){ + $status = ['禁用', '启用']; + return isset($status[$data['status']]) ? $status[$data['status']] : ''; + } + + public function setting(){ + return $this->hasMany(ClientConfig::class, 'client_id', 'id'); + } +} \ No newline at end of file diff --git a/route/auth.php b/app/model/operate/ClientConfig.php similarity index 60% rename from route/auth.php rename to app/model/operate/ClientConfig.php index cbb2452..1926985 100644 --- a/route/auth.php +++ b/app/model/operate/ClientConfig.php @@ -1,14 +1,21 @@ - -// +---------------------------------------------------------------------- -use think\facade\Route; - -Route::group('auth', function(){ - Route::post('login', 'auth.Index/login'); - Route::get('member', 'auth.Index/member'); -}); \ No newline at end of file + +// +---------------------------------------------------------------------- +namespace app\model\operate; + +use app\model\BaseModel; +use think\model\concern\SoftDelete; +use think\facade\Cache; + +class ClientConfig extends BaseModel{ + + protected function getStatusTextAttr($value, $data){ + $status = ['禁用', '启用']; + return isset($status[$data['status']]) ? $status[$data['status']] : ''; + } +} \ No newline at end of file diff --git a/app/model/customer/Contact.php b/app/model/operate/ClientMenu.php similarity index 68% rename from app/model/customer/Contact.php rename to app/model/operate/ClientMenu.php index 3180375..eb75bd6 100644 --- a/app/model/customer/Contact.php +++ b/app/model/operate/ClientMenu.php @@ -6,16 +6,16 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- -namespace app\model\customer; +namespace app\model\operate; use app\model\BaseModel; use think\model\concern\SoftDelete; +use think\facade\Cache; -class Contact extends BaseModel{ - - use SoftDelete; - protected $deleteTime = 'delete_time'; - protected $defaultSoftDelete = 0; - protected $name = "company_contact"; +class ClientMenu extends BaseModel{ + protected function getStatusTextAttr($value, $data){ + $status = ['禁用', '启用']; + return isset($status[$data['status']]) ? $status[$data['status']] : ''; + } } \ No newline at end of file diff --git a/app/model/system/Dictionary.php b/app/model/system/Dictionary.php index dacff99..9cfed1a 100644 --- a/app/model/system/Dictionary.php +++ b/app/model/system/Dictionary.php @@ -16,5 +16,4 @@ class Dictionary extends BaseModel{ use SoftDelete; protected $deleteTime = 'delete_time'; protected $defaultSoftDelete = 0; - } \ No newline at end of file diff --git a/app/services/FieldService.php b/app/services/FieldService.php new file mode 100644 index 0000000..3d28960 --- /dev/null +++ b/app/services/FieldService.php @@ -0,0 +1,41 @@ + +// +---------------------------------------------------------------------- +namespace app\services; + +class FieldService{ + + public function getFields($model = 'student'){ + if(method_exists(new self(), $model)){ + return $this->$model(); + }else{ + return []; + } + } + + /** + * @title 学员导入字段 + * + * @return void + */ + public function student(){ + return ['学生姓名' => 'name', '性别' => 'sex', '电话' => 'mobile', '身份证号码' => 'id_card']; + } + + /** + * @title 题库导入字段 + * + * @return void + */ + public function exam(){ + return [ + '题目类型' => 'type_text', '题干' => 'title', '答案' => 'answer', '解析' => 'analysis', + '选项A' => 'A', '选项B' => 'B', '选项C' => 'C', '选项D' => 'D', '选项E' => 'E' + ]; + } +} \ No newline at end of file diff --git a/app/services/auth/RoleService.php b/app/services/auth/RoleService.php index 5111f51..a503593 100644 --- a/app/services/auth/RoleService.php +++ b/app/services/auth/RoleService.php @@ -49,11 +49,11 @@ class RoleService{ } $role = Roles::find($id); // 删除权限 - PermissionAccess::where('role_id', '=', $role_id)->delete(); + PermissionAccess::where('role_id', '=', $id)->delete(); // 删除部门关联 // $role->detachDepartments(); // 删除用户关联 - RolesAccess::where('role_id', '=', $role_id)->delete(); + RolesAccess::where('role_id', '=', $id)->delete(); // 删除 $role->delete(); } @@ -73,6 +73,7 @@ class RoleService{ (new PermissionAccess())->saveAll($save); return true; } + public function updateRoleAuth($request){ $role_id = $request->param('role_id', ''); $data_range = $request->param('data_range', ''); @@ -87,6 +88,11 @@ class RoleService{ return $role->save($save); } + public function createRole($request){ + $data = $request->param(); + return Roles::create($data); + } + public function updateRole($request){ $data = $request->param(); return Roles::update($data); diff --git a/app/services/company/CompanyService.php b/app/services/company/CompanyService.php deleted file mode 100644 index 1459476..0000000 --- a/app/services/company/CompanyService.php +++ /dev/null @@ -1,119 +0,0 @@ - -// +---------------------------------------------------------------------- -namespace app\services\company; - -use app\model\customer\Company; -use app\model\customer\Contact; - -/** - * Undocumented class - */ -class CompanyService { - - /** - * @title 获取企业列表 - * - * @param [type] $request - * @return void - */ - public function getCompanyList($request) { - $param = $request->param(); - $map = []; - if (isset($param['name']) && $param['name']) { - $map[] = ['name', 'LIKE', '%' . $param['name'] . '%']; - } - if (isset($param['org_code']) && $param['org_code']) { - $map[] = ['org_code', '=', $param['org_code']]; - } - $list = Company::with(['contact'])->where($map)->order('id desc')->paginate($request->pageConfig); - return $list->append(['area_t', 'industry_t']); - } - - /** - * @title 获取企业详情 - * - * @param [type] $request - * @return void - */ - public function getCompanyDetail($request) { - $param = $request->param(); - if (!isset($param['id'])) { - return []; - } - $map = []; - $map[] = ['id', '=', $param['id']]; - $data = Company::with(['contact'])->where($map)->find(); - return $data->append(['area_t', 'industry_t']); - } - - /** - * @title 导入数据 - * - * @return void - */ - public function insertCompanyData($request) { - $data = $request->post('data'); - $company = new Company(); - $contactM = new Contact(); - - $resultData = []; - foreach ($data as $k => $item) { - $info = []; - if (!is_array($item)) { - continue; - } - foreach ($item as $key => $value) { - if (isset($company->insertFieldAlis[$key])) { - $info[$company->insertFieldAlis[$key]['table']][$company->insertFieldAlis[$key]['name']] = trim($value); - } - } - $info['company']['uid'] = $info['contact']['uid'] = request()->user['uid']; - - if (isset($info['company']) && isset($info['company']['name'])) { - $customer = $company->where('name', '=', trim($info['company']['name']))->find(); - $company_id = isset($customer['id']) ? $customer['id'] : 0; - if (!$company_id) { - $info['company']['turnover'] = ''; - $info['company']['staff_num'] = ''; - $info['company']['come_from'] = ''; - $info['company']['company_type'] = ''; - $info['company']['pc_count'] = ''; - $customer = Company::create($info['company']); - $company_id = $customer->id; - } else { - $save_coustomer = $info['company']; - if (!empty($save_coustomer)) { - $save_coustomer['id'] = $company_id; - $result = $customer->save($save_coustomer); - } - } - if (isset($info['contact']['name'])) { - $map = []; - $map[] = ['name', '=', $info['contact']['name']]; - $map[] = ['mobile', '=', isset($info['contact']['mobile']) ? $info['contact']['mobile'] : '']; - $map[] = ['company_id', '=', $company_id]; - $contact = $contactM->where($map)->find(); //每次查询重新实例化 - $contact_id = isset($contact['id']) ? $contact['id'] : 0; - if (!$contact_id) { - $info['contact']['company_id'] = $company_id; - $res = Contact::create($info['contact']); - $contact_id = $res->id; - } else { - $info['contact']['id'] = $contact_id; - $contact->save($info['contact']); - } - } else { - $contact_id = 0; - } - $resultData[] = ['company_id' => $company_id, 'contact_id' => (int) $contact_id, 'company' => $info['company'], 'contact' => $info['contact']]; - } - } - return empty($resultData) ? false : $resultData; - } -} \ No newline at end of file diff --git a/app/services/operate/AdsService.php b/app/services/operate/AdsService.php new file mode 100644 index 0000000..118c8aa --- /dev/null +++ b/app/services/operate/AdsService.php @@ -0,0 +1,81 @@ + +// +---------------------------------------------------------------------- +namespace app\services\operate; + +use app\model\operate\Ads; + +class AdsService{ + + /** + * @title 获取广告 + * + * @param [type] $request + * @return void + */ + public function getDataList($request){ + $param = $request->param(); + $order = "id desc"; + $map = []; + if(isset($param['title']) && $param['title'] != ''){ + $map[] = ['title', 'LIKE', '%' . $param['title'] . '%']; + } + if(isset($param['name']) && $param['name'] != ''){ + $map[] = ['name', '=', $param['name']]; + } + + $list = Ads::where($map)->order($order)->append(['status_text', 'photo'])->paginate($request->pageConfig); + return $list; + } + + /** + * @title 添加广告 + * + * @param [type] $request + * @return void + */ + public function create($request){ + $data = $request->param(); + + $data['user_id'] = $request->user['uid']; + return Ads::create($data); + } + + /** + * @title 编辑广告 + * + * @param [type] $request + * @return void + */ + public function update($request){ + $data = $request->param(); + + $ads = Ads::find($data['id']); + return $ads->save($data); + } + + /** + * @title 删除广告 + * + * @param [type] $request + * @return void + */ + public function delete($request){ + $id = $request->post('id', 0); + if(!$id){ + throw new \think\Exception("非法操作!", 1); + } + + return Ads::where('id', $id)->delete(); + } + + public function getAdsDetail($request){ + $name = $request->param('name', ''); + return Ads::where('name', $name)->append(['photo'])->find(); + } +} \ No newline at end of file diff --git a/app/services/operate/ClientConfigService.php b/app/services/operate/ClientConfigService.php new file mode 100644 index 0000000..6ba1b04 --- /dev/null +++ b/app/services/operate/ClientConfigService.php @@ -0,0 +1,75 @@ + +// +---------------------------------------------------------------------- +namespace app\services\operate; + +use app\model\operate\ClientConfig; + +class ClientConfigService{ + + /** + * @title 获取广告 + * + * @param [type] $request + * @return void + */ + public function getDataList($request){ + $param = $request->param(); + $order = "id desc"; + $map = []; + if(isset($param['title']) && $param['title'] != ''){ + $map[] = ['title', 'LIKE', '%' . $param['title'] . '%']; + } + if(isset($param['name']) && $param['name'] != ''){ + $map[] = ['name', '=', $param['name']]; + } + + $list = ClientConfig::where($map)->order($order)->append(['status_text'])->paginate($request->pageConfig); + return $list; + } + + /** + * @title 添加广告 + * + * @param [type] $request + * @return void + */ + public function create($request){ + $data = $request->param(); + + return ClientConfig::create($data); + } + + /** + * @title 编辑配置 + * + * @param [type] $request + * @return void + */ + public function update($request){ + $data = $request->param(); + + $config = ClientConfig::find($data['id']); + $config->save($data); + return $config; + } + + /** + * @title 删除配置 + * + * @param [type] $request + * @return void + */ + public function delete($request){ + $data = $request->param(); + + $config = ClientConfig::find($data['id']); + + return $config->delete(); + } +} \ No newline at end of file diff --git a/app/services/operate/ClientMenuService.php b/app/services/operate/ClientMenuService.php new file mode 100644 index 0000000..ac0c467 --- /dev/null +++ b/app/services/operate/ClientMenuService.php @@ -0,0 +1,75 @@ + +// +---------------------------------------------------------------------- +namespace app\services\operate; + +use app\model\operate\ClientMenu; + +class ClientMenuService{ + + /** + * @title 获取广告 + * + * @param [type] $request + * @return void + */ + public function getDataList($request){ + $param = $request->param(); + $order = "id desc"; + $map = []; + if(isset($param['title']) && $param['title'] != ''){ + $map[] = ['title', 'LIKE', '%' . $param['title'] . '%']; + } + if(isset($param['name']) && $param['name'] != ''){ + $map[] = ['name', '=', $param['name']]; + } + + $list = ClientMenu::where($map)->order($order)->append(['status_text'])->paginate($request->pageConfig); + return $list; + } + + /** + * @title 添加广告 + * + * @param [type] $request + * @return void + */ + public function create($request){ + $data = $request->param(); + + $data['user_id'] = $request->user['uid']; + return ClientMenu::create($data); + } + + /** + * @title 编辑广告 + * + * @param [type] $request + * @return void + */ + public function update($request){ + $data = $request->param(); + + $menu = ClientMenu::find($data['id']); + return $client->save($data); + } + + /** + * @title 删除配置 + * + * @param [type] $request + * @return void + */ + public function delete($request){ + $data = $request->param(); + + $menu = ClientMenu::find($data['id']); + + return $menu->delete(); + } +} \ No newline at end of file diff --git a/app/services/operate/ClientService.php b/app/services/operate/ClientService.php new file mode 100644 index 0000000..18a5a1e --- /dev/null +++ b/app/services/operate/ClientService.php @@ -0,0 +1,91 @@ + +// +---------------------------------------------------------------------- +namespace app\services\operate; + +use app\model\operate\Client; + +class ClientService{ + + /** + * @title 获取广告 + * + * @param [type] $request + * @return void + */ + public function getDataList($request){ + $param = $request->param(); + $order = "id desc"; + $map = []; + if(isset($param['title']) && $param['title'] != ''){ + $map[] = ['title', 'LIKE', '%' . $param['title'] . '%']; + } + if(isset($param['name']) && $param['name'] != ''){ + $map[] = ['name', '=', $param['name']]; + } + + $list = Client::with(['setting'])->where($map)->order($order)->append(['status_text'])->paginate($request->pageConfig); + return $list; + } + + /** + * @title 添加广告 + * + * @param [type] $request + * @return void + */ + public function create($request){ + $data = $request->param(); + + $data['user_id'] = $request->user['uid']; + return Client::create($data); + } + + /** + * @title 编辑广告 + * + * @param [type] $request + * @return void + */ + public function update($request){ + $data = $request->param(); + + $client = Client::find($data['id']); + return $client->save($data); + } + + public function getClientMenu($request){ + $param = $request->param(); + + $list = []; + if(isset($param['type'])){ + if($param['type'] == 'home'){ + $list = [ + ['title' => '常考题', 'image' => request()->static() . 'images/icon/5.jpg', 'url' => '/pages/exam/index/index'], + ['title' => '模拟考', 'image' => request()->static() . 'images/icon/6.jpg', 'url' => '/pages/exam/index/index'], + ['title' => '题库练习', 'image' => request()->static() . 'images/icon/7.jpg', 'url' => '/pages/exam/index/index'], + ['title' => '易错题', 'image' => request()->static() . 'images/icon/8.jpg', 'url' => '/pages/exam/index/index'], + ['title' => '我的错题', 'image' => request()->static() . 'images/icon/10.png', 'url' => '/pages/exam/my/index', 'desc' => '巩固错题,轻轻松松过考'], + ['title' => '我的收藏', 'image' => request()->static() . 'images/icon/9.png', 'url' => '/pages/exam/my/index', 'desc' => '您收藏的题目,都在这里'], + ]; + }else{ + $list = [ + ['title' => '我的资料', 'icon' => 'profile', 'iconColor' => 'green', 'url' => '/pages/ucenter/profile/index'], + ['title' => '我的报名', 'icon' => 'edit', 'iconColor' => 'green', 'url' => '/pages/ucenter/enter/index'], + ['title' => '我的记录', 'icon' => 'list', 'iconColor' => 'green', 'url' => '/pages/ucenter/exam/index'], + ['title' => '我的订单', 'icon' => 'shop', 'iconColor' => 'green', 'url' => '/pages/ucenter/order/index'], + ['title' => '邀请推广', 'icon' => 'qrcode', 'iconColor' => 'green', 'url' => '/pages/ucenter/invite/index'], + ['title' => '关于我们', 'icon' => 'info', 'iconColor' => 'green', 'url' => '/pages/ucenter/about/index'], + ]; + } + } + + + return $list; + } +} \ No newline at end of file diff --git a/app/services/system/DictionaryService.php b/app/services/system/DictionaryService.php index b44cf30..4d1b9dd 100644 --- a/app/services/system/DictionaryService.php +++ b/app/services/system/DictionaryService.php @@ -30,6 +30,20 @@ class DictionaryService{ $list = Dictionary::where($map)->order('id desc')->paginate($request->pageConfig); return $list; } + + /** + * @title 所有字典数据 + * + * @return void + */ + public function getDictionaryAll(){ + $list = Dictionary::where([])->select(); + $data = []; + foreach($list as $value){ + $data[$value['dic_type']][] = $value->toArray(); + } + return $data; + } /** * @title 获取字典明细 * diff --git a/app/services/wechat/OauthService.php b/app/services/wechat/OauthService.php new file mode 100644 index 0000000..65b4613 --- /dev/null +++ b/app/services/wechat/OauthService.php @@ -0,0 +1,60 @@ + +// +---------------------------------------------------------------------- +namespace app\services\wechat; + +use EasyWeChat\Factory; +use think\facade\Config; +use app\model\student\Student; +use app\model\student\Wechat; + +class OauthService{ + + public function oauth($request){ + $code = $request->post('code'); + $config = Config::get('wechat.miniapp'); + + $app = Factory::miniProgram($config); + try { + //获取openid + $session_code = $app->auth->session($code); + + $wechat = Wechat::where('openid', '=', $session_code['openid'])->findOrEmpty(); + if($wechat->isEmpty()){ + $userInfo = $app->encryptor->decryptData($session_code['session_key'], $request->post('iv'), $request->post('encrypted')); + $data = [ + 'headimgurl' => $userInfo['avatarUrl'], + 'nickname' => $userInfo['nickName'], + 'openid'=> $userInfo['openId'], + 'sex' => $userInfo['gender'], + 'city' => $userInfo['city'], + 'country' => $userInfo['country'], + 'province' => $userInfo['province'], + 'language' => $userInfo['language'] + ]; + $wechat = Wechat::create($data); + } + + if($wechat['uid'] > 0){ + $wechat['users'] = Student::with(['enter'])->visible(['name', 'mobile', 'sex', 'address', 'id', 'id_card', 'invite_id', 'exam_num', 'incorrect_num', 'point'])->find($wechat['uid'])->append(['token']); + } + return $wechat; + } catch (\Exception $e) { + throw new \think\Exception($e->getMessage(), 100); + } + } + + public function getQrCode($request){ + $config = Config::get('wechat.miniapp'); + + $app = Factory::miniProgram($config); + + $res = $app->url_link->generate([]); + return $res; + } +} \ No newline at end of file diff --git a/app/validate/File.php b/app/validate/File.php index a0d20d8..d17b4c2 100644 --- a/app/validate/File.php +++ b/app/validate/File.php @@ -13,13 +13,14 @@ use think\Validate; class File extends Validate{ protected $rule = [ - 'avatar' => 'fileSize:102400|fileExt:jpg,png', - 'image' => 'fileSize:204800|fileExt:jpg,jpeg,png,webp', - 'file' => 'fileSize:1024 * 1000|fileExt:doc,xls,zip,rar' + 'avatar' => 'fileSize:1048576|fileExt:jpg,png', + 'image' => 'fileSize:1048576 * 2|fileExt:jpg,jpeg,png,webp', + 'file' => 'fileSize:1048576 * 5|fileExt:doc,xls,zip,rar' ]; protected $message = [ 'avatar.fileSize' => '图片不大于1M', 'avatar.fileExt' => '头像后缀不正确', 'avatar.image' => '头像尺寸不正确', + 'image.fileSize' => '图片大小超过允许上传大小' ]; } \ No newline at end of file diff --git a/app/validate/auth/Index.php b/app/validate/admin/auth/Index.php similarity index 90% rename from app/validate/auth/Index.php rename to app/validate/admin/auth/Index.php index c74f188..bb59edb 100644 --- a/app/validate/auth/Index.php +++ b/app/validate/admin/auth/Index.php @@ -1,27 +1,27 @@ - -// +---------------------------------------------------------------------- -namespace app\validate\auth; - -use think\Validate; - -class Index extends Validate{ - - protected $rule = [ - 'username' => 'require:id', - 'password' => 'require' - ]; - protected $message = [ - 'password.require' => '登录密码必须', - 'username.require' => '登录用户名必须' - ]; - protected $scene = [ - 'login' => ['username', 'password'], - 'resetpasswd' => ['username', 'password'] - ]; + +// +---------------------------------------------------------------------- +namespace app\validate\admin\auth; + +use think\Validate; + +class Index extends Validate{ + + protected $rule = [ + 'username' => 'require', + 'password' => 'require' + ]; + protected $message = [ + 'password.require' => '登录密码必须', + 'username.require' => '登录用户名必须' + ]; + protected $scene = [ + 'login' => ['username', 'password'], + 'resetpasswd' => ['username', 'password'] + ]; } \ No newline at end of file diff --git a/app/validate/auth/Users.php b/app/validate/admin/auth/Users.php similarity index 95% rename from app/validate/auth/Users.php rename to app/validate/admin/auth/Users.php index def5769..d46605c 100644 --- a/app/validate/auth/Users.php +++ b/app/validate/admin/auth/Users.php @@ -6,7 +6,7 @@ // +---------------------------------------------------------------------- // | Author: molong // +---------------------------------------------------------------------- -namespace app\validate\auth; +namespace app\validate\admin\auth; use think\Validate; diff --git a/app/validate/api/student/Enter.php b/app/validate/api/student/Enter.php new file mode 100644 index 0000000..523e572 --- /dev/null +++ b/app/validate/api/student/Enter.php @@ -0,0 +1,30 @@ + +// +---------------------------------------------------------------------- +namespace app\validate\api\student; + +use think\Validate; + +class Enter extends Validate{ + + protected $rule = [ + 'category_id' => 'require', + 'id_card' => 'require|idCard', + 'mobile' => 'require|mobile' + ]; + protected $message = [ + 'category_id.require' => '科目必选', + 'id_card.require' => '身份证号码必填', + 'id_card.idCard' => '身份证号码格式错误', + 'mobile.require' => '手机号码必填', + 'mobile.mobile' => '手机号码格式错误' + ]; + protected $scene = [ + 'add' => ['category_id', 'id_card'] + ]; +} \ No newline at end of file diff --git a/app/validate/api/student/Login.php b/app/validate/api/student/Login.php new file mode 100644 index 0000000..ae996a5 --- /dev/null +++ b/app/validate/api/student/Login.php @@ -0,0 +1,36 @@ + +// +---------------------------------------------------------------------- +namespace app\validate\api\student; + +use think\Validate; + +class Login extends Validate{ + + protected $rule = [ + 'name' => 'require|chsAlpha', + 'mobile' => 'require|mobile|unique:student', + 'password' => 'require', + 'repassword'=>'require|confirm:password' + ]; + protected $message = [ + 'password.require' => '登录密码必须', + 'mobile.require' => '手机号码必须', + 'mobile.mobile' => '手机号码不正确', + 'mobile.unique' => '当前手机号码已注册', + 'name.require' => '姓名必须', + 'name.chsAlpha' => '姓名格式不正确', + 'repassword.require' => '确认密码必须', + 'repassword.confirm' => '两次密码输入不同' + ]; + protected $scene = [ + 'login' => ['name', 'mobile', 'password'], + 'register' => ['name', 'mobile', 'password', 'repassword'], + 'resetpasswd' => ['name', 'password'] + ]; +} \ No newline at end of file diff --git a/route/admin.php b/route/admin.php new file mode 100644 index 0000000..cce1f61 --- /dev/null +++ b/route/admin.php @@ -0,0 +1,31 @@ + +// +---------------------------------------------------------------------- +use think\facade\Route; + +Route::rule('/', 'Index/index'); +Route::rule('test', 'Index/test'); + +Route::group('/admin', function(){ + Route::rule('auth/user/:action', 'admin.auth.User/:action'); + Route::rule('auth/department/:action', 'admin.auth.Department/:action'); + Route::rule('auth/role/:action', 'admin.auth.Role/:action'); + Route::rule('system/:controller/:action', 'admin.system.:controller/:action'); + Route::rule('student/:controller/:action', 'admin.student.:controller/:action'); + Route::rule('exam/:controller/:action', 'admin.exam.:controller/:action'); + Route::rule('point/:controller/:action', 'admin.point.:controller/:action'); + Route::rule('operate/:controller/:action', 'admin.operate.:controller/:action'); +})->middleware(['Api', 'Auth']); + +Route::group('admin/auth', function(){ + Route::post('login', 'admin.auth.Index/login'); +})->middleware(['Api']); + +Route::miss('index/miss'); \ No newline at end of file diff --git a/route/api.php b/route/api.php new file mode 100644 index 0000000..df7d7a5 --- /dev/null +++ b/route/api.php @@ -0,0 +1,17 @@ + +// +---------------------------------------------------------------------- +use think\facade\Route; + +Route::group('/api', function(){ + Route::rule('operate/:controller/:action', 'api.operate.:controller/:action')->middleware(['ApiAuth']); +})->middleware(['Api']); + +Route::miss('index/miss'); \ No newline at end of file diff --git a/route/app.php b/route/app.php index ed05ba0..2b9148e 100644 --- a/route/app.php +++ b/route/app.php @@ -10,15 +10,4 @@ // +---------------------------------------------------------------------- use think\facade\Route; -Route::rule('/', 'Index/index'); -Route::rule('test', 'Index/test'); - -Route::group('/', function(){ - Route::rule('system/:controller/:action', 'system.:controller/:action'); - Route::rule('auth/user/:action', 'auth.User/:action'); - Route::rule('auth/department/:action', 'auth.Department/:action'); - Route::rule('auth/role/:action', 'auth.Role/:action'); - Route::rule('customer/company/:action', 'customer.Company/:action'); -})->middleware([\app\middleware\Check::class], 'api'); - -Route::miss('index/miss'); \ No newline at end of file +Route::rule('template', 'index/template'); \ No newline at end of file diff --git a/ui/.gitignore b/ui/.gitignore index 2bdd9d9..1c5840d 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -1,24 +1,10 @@ -.DS_Store node_modules -/dist - -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# Editor directories and files -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? - -/package-lock.json +out/ +logs/ +run/ +.idea/ +package-lock.json +data/ +.vscode/launch.json +public/electron/ +pnpm-lock.yaml \ No newline at end of file diff --git a/ui/.editorconfig b/ui/frontend/.editorconfig similarity index 100% rename from ui/.editorconfig rename to ui/frontend/.editorconfig diff --git a/ui/.env.development b/ui/frontend/.env.development similarity index 100% rename from ui/.env.development rename to ui/frontend/.env.development diff --git a/ui/.env.production b/ui/frontend/.env.production similarity index 100% rename from ui/.env.production rename to ui/frontend/.env.production diff --git a/ui/frontend/.gitignore b/ui/frontend/.gitignore new file mode 100644 index 0000000..2bdd9d9 --- /dev/null +++ b/ui/frontend/.gitignore @@ -0,0 +1,24 @@ +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +/package-lock.json diff --git a/ui/LICENSE b/ui/frontend/LICENSE similarity index 100% rename from ui/LICENSE rename to ui/frontend/LICENSE diff --git a/ui/README.md b/ui/frontend/README.md similarity index 100% rename from ui/README.md rename to ui/frontend/README.md diff --git a/ui/babel.config.js b/ui/frontend/babel.config.js similarity index 100% rename from ui/babel.config.js rename to ui/frontend/babel.config.js diff --git a/ui/jsconfig.json b/ui/frontend/jsconfig.json similarity index 100% rename from ui/jsconfig.json rename to ui/frontend/jsconfig.json diff --git a/ui/frontend/package.json b/ui/frontend/package.json new file mode 100644 index 0000000..dbd3c43 --- /dev/null +++ b/ui/frontend/package.json @@ -0,0 +1,74 @@ +{ + "name": "scui", + "version": "1.6.6", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build --report", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "@element-plus/icons-vue": "2.0.6", + "@tinymce/tinymce-vue": "5.0.0", + "axios": "0.27.2", + "codemirror": "5.65.5", + "core-js": "3.24.1", + "cropperjs": "1.5.12", + "crypto-js": "4.1.1", + "echarts": "5.3.3", + "element-plus": "2.2.12", + "nprogress": "0.2.0", + "qrcodejs2": "0.0.2", + "sortablejs": "1.15.0", + "tinymce": "6.1.2", + "vue": "3.2.37", + "vue-i18n": "9.2.2", + "vue-router": "4.1.3", + "vuedraggable": "4.0.3", + "vuex": "4.0.2", + "xgplayer": "2.31.7", + "xgplayer-hls": "2.5.2", + "xlsx": "^0.18.5" + }, + "devDependencies": { + "@babel/core": "7.18.9", + "@babel/eslint-parser": "7.18.9", + "@vue/cli-plugin-babel": "5.0.8", + "@vue/cli-plugin-eslint": "5.0.8", + "@vue/cli-service": "5.0.8", + "eslint": "8.21.0", + "eslint-plugin-vue": "9.3.0", + "sass": "1.37.5", + "sass-loader": "10.1.1" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "globals": { + "APP_CONFIG": true + }, + "extends": [ + "plugin:vue/vue3-essential", + "eslint:recommended" + ], + "parserOptions": { + "parser": "@babel/eslint-parser", + "requireConfigFile": false + }, + "rules": { + "indent": 0, + "no-tabs": 0, + "no-mixed-spaces-and-tabs": 0, + "vue/no-unused-components": 0, + "vue/multi-word-component-names": 0 + } + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not dead", + "not ie 11" + ] +} diff --git a/ui/public/config.js b/ui/frontend/public/config.js similarity index 100% rename from ui/public/config.js rename to ui/frontend/public/config.js diff --git a/ui/public/favicon.ico b/ui/frontend/public/favicon.ico similarity index 100% rename from ui/public/favicon.ico rename to ui/frontend/public/favicon.ico diff --git a/ui/public/index.html b/ui/frontend/public/index.html similarity index 100% rename from ui/public/index.html rename to ui/frontend/public/index.html diff --git a/ui/public/static/images/404.png b/ui/frontend/public/static/images/404.png similarity index 100% rename from ui/public/static/images/404.png rename to ui/frontend/public/static/images/404.png diff --git a/ui/public/static/images/auth_banner.jpg b/ui/frontend/public/static/images/auth_banner.jpg similarity index 100% rename from ui/public/static/images/auth_banner.jpg rename to ui/frontend/public/static/images/auth_banner.jpg diff --git a/ui/public/static/images/avatar.jpg b/ui/frontend/public/static/images/avatar.jpg similarity index 100% rename from ui/public/static/images/avatar.jpg rename to ui/frontend/public/static/images/avatar.jpg diff --git a/ui/public/static/images/avatar2.gif b/ui/frontend/public/static/images/avatar2.gif similarity index 100% rename from ui/public/static/images/avatar2.gif rename to ui/frontend/public/static/images/avatar2.gif diff --git a/ui/public/static/images/avatar3.gif b/ui/frontend/public/static/images/avatar3.gif similarity index 100% rename from ui/public/static/images/avatar3.gif rename to ui/frontend/public/static/images/avatar3.gif diff --git a/ui/public/static/images/loginbg.svg b/ui/frontend/public/static/images/loginbg.svg similarity index 100% rename from ui/public/static/images/loginbg.svg rename to ui/frontend/public/static/images/loginbg.svg diff --git a/ui/public/static/images/logo-r.png b/ui/frontend/public/static/images/logo-r.png similarity index 100% rename from ui/public/static/images/logo-r.png rename to ui/frontend/public/static/images/logo-r.png diff --git a/ui/public/static/images/logo.png b/ui/frontend/public/static/images/logo.png similarity index 100% rename from ui/public/static/images/logo.png rename to ui/frontend/public/static/images/logo.png diff --git a/ui/public/static/images/no-widgets.svg b/ui/frontend/public/static/images/no-widgets.svg similarity index 100% rename from ui/public/static/images/no-widgets.svg rename to ui/frontend/public/static/images/no-widgets.svg diff --git a/ui/public/static/images/tasks-example.png b/ui/frontend/public/static/images/tasks-example.png similarity index 100% rename from ui/public/static/images/tasks-example.png rename to ui/frontend/public/static/images/tasks-example.png diff --git a/ui/public/static/images/ver.svg b/ui/frontend/public/static/images/ver.svg similarity index 100% rename from ui/public/static/images/ver.svg rename to ui/frontend/public/static/images/ver.svg diff --git a/ui/public/static/js/tinymce/langs/zh_CN.js b/ui/frontend/public/static/js/tinymce/langs/zh_CN.js similarity index 100% rename from ui/public/static/js/tinymce/langs/zh_CN.js rename to ui/frontend/public/static/js/tinymce/langs/zh_CN.js diff --git a/ui/public/static/js/tinymce/skins/content/dark/content.css b/ui/frontend/public/static/js/tinymce/skins/content/dark/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/dark/content.css rename to ui/frontend/public/static/js/tinymce/skins/content/dark/content.css diff --git a/ui/public/static/js/tinymce/skins/content/dark/content.min.css b/ui/frontend/public/static/js/tinymce/skins/content/dark/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/dark/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/content/dark/content.min.css diff --git a/ui/public/static/js/tinymce/skins/content/default/content.css b/ui/frontend/public/static/js/tinymce/skins/content/default/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/default/content.css rename to ui/frontend/public/static/js/tinymce/skins/content/default/content.css diff --git a/ui/public/static/js/tinymce/skins/content/default/content.min.css b/ui/frontend/public/static/js/tinymce/skins/content/default/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/default/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/content/default/content.min.css diff --git a/ui/public/static/js/tinymce/skins/content/document/content.css b/ui/frontend/public/static/js/tinymce/skins/content/document/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/document/content.css rename to ui/frontend/public/static/js/tinymce/skins/content/document/content.css diff --git a/ui/public/static/js/tinymce/skins/content/document/content.min.css b/ui/frontend/public/static/js/tinymce/skins/content/document/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/document/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/content/document/content.min.css diff --git a/ui/public/static/js/tinymce/skins/content/tinymce-5-dark/content.css b/ui/frontend/public/static/js/tinymce/skins/content/tinymce-5-dark/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/tinymce-5-dark/content.css rename to ui/frontend/public/static/js/tinymce/skins/content/tinymce-5-dark/content.css diff --git a/ui/public/static/js/tinymce/skins/content/tinymce-5-dark/content.min.css b/ui/frontend/public/static/js/tinymce/skins/content/tinymce-5-dark/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/tinymce-5-dark/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/content/tinymce-5-dark/content.min.css diff --git a/ui/public/static/js/tinymce/skins/content/tinymce-5/content.css b/ui/frontend/public/static/js/tinymce/skins/content/tinymce-5/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/tinymce-5/content.css rename to ui/frontend/public/static/js/tinymce/skins/content/tinymce-5/content.css diff --git a/ui/public/static/js/tinymce/skins/content/tinymce-5/content.min.css b/ui/frontend/public/static/js/tinymce/skins/content/tinymce-5/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/tinymce-5/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/content/tinymce-5/content.min.css diff --git a/ui/public/static/js/tinymce/skins/content/writer/content.css b/ui/frontend/public/static/js/tinymce/skins/content/writer/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/writer/content.css rename to ui/frontend/public/static/js/tinymce/skins/content/writer/content.css diff --git a/ui/public/static/js/tinymce/skins/content/writer/content.min.css b/ui/frontend/public/static/js/tinymce/skins/content/writer/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/content/writer/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/content/writer/content.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/content.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/content.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.inline.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/content.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/content.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/content.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/content.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/content.inline.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.inline.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/content.inline.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.inline.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/content.inline.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.inline.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/content.inline.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.inline.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/content.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/content.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/skin.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/skin.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/skin.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/skin.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.css diff --git a/ui/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/oxide/skin.shadowdom.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/content.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/content.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/content.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.inline.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/content.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/content.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/content.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.min.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.css diff --git a/ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css b/ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css similarity index 100% rename from ui/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css rename to ui/frontend/public/static/js/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css diff --git a/ui/src/App.vue b/ui/frontend/src/App.vue similarity index 100% rename from ui/src/App.vue rename to ui/frontend/src/App.vue diff --git a/ui/src/api/index.js b/ui/frontend/src/api/index.js similarity index 100% rename from ui/src/api/index.js rename to ui/frontend/src/api/index.js diff --git a/ui/src/api/model/auth.js b/ui/frontend/src/api/model/auth.js similarity index 100% rename from ui/src/api/model/auth.js rename to ui/frontend/src/api/model/auth.js diff --git a/ui/src/api/model/common.js b/ui/frontend/src/api/model/common.js similarity index 100% rename from ui/src/api/model/common.js rename to ui/frontend/src/api/model/common.js diff --git a/ui/src/api/model/customer.js b/ui/frontend/src/api/model/customer.js similarity index 100% rename from ui/src/api/model/customer.js rename to ui/frontend/src/api/model/customer.js diff --git a/ui/src/api/model/demo.js b/ui/frontend/src/api/model/demo.js similarity index 100% rename from ui/src/api/model/demo.js rename to ui/frontend/src/api/model/demo.js diff --git a/ui/src/api/model/system.js b/ui/frontend/src/api/model/system.js similarity index 100% rename from ui/src/api/model/system.js rename to ui/frontend/src/api/model/system.js diff --git a/ui/src/api/model/tools.js b/ui/frontend/src/api/model/tools.js similarity index 96% rename from ui/src/api/model/tools.js rename to ui/frontend/src/api/model/tools.js index a6ee6bd..c12952d 100644 --- a/ui/src/api/model/tools.js +++ b/ui/frontend/src/api/model/tools.js @@ -1,123 +1,123 @@ -import config from "@/config" -import http from "@/utils/request" - -export default { - filter: { - list: { - url: `${config.API_URL}tools/filter/index`, - name: "获得过滤数据", - get: async function(params){ - return await http.get(this.url, params); - } - }, - insert:{ - url: `${config.API_URL}tools/filter/insert`, - name: "导入过滤数据", - post: async function(data={}){ - return await http.post(this.url, data); - } - }, - search: { - url: `${config.API_URL}/tools/filter/search`, - name: "过滤数据", - get: async function(params){ - return await http.get(this.url, params); - } - }, - delete:{ - url: `${config.API_URL}/tools/filter/delete`, - name: "删除过滤数据", - post: async function(data={}){ - return await http.post(this.url, data); - } - }, - edit:{ - url: `${config.API_URL}/tools/filter/edit`, - name: "更新过滤数据", - post: async function(data={}){ - return await http.post(this.url, data); - } - }, - task: { - url: `${config.API_URL}/tools/filter/task`, - name: "任务单数据", - get: async function(params){ - return await http.get(this.url, params); - } - }, - batch:{ - url: `${config.API_URL}/tools/filter/batch`, - name: "条件删除", - post: async function(data={}){ - return await http.post(this.url, data); - } - } - }, - inspect:{ - list: { - url: `${config.API_URL}/tools/inspect/index`, - name: "获得质检数据", - get: async function(data){ - let params = Object.assign({}, data); - let users = params.user || {}, uids = []; - if(users.length > 0){ - users.map((item) => { - uids.push(item.uid); - }) - } - params.user = uids; - return await http.get(this.url, params); - } - }, - insert:{ - url: `${config.API_URL}/tools/inspect/insert`, - name: "导入质检数据", - post: async function(data={}){ - return await http.post(this.url, data); - } - }, - edit:{ - url: `${config.API_URL}/tools/inspect/edit`, - name: "质检数据操作", - post: async function(data={}){ - return await http.post(this.url, data); - } - }, - delete:{ - url: `${config.API_URL}/tools/inspect/delete`, - name: "删除过滤数据", - post: async function(data={}){ - let params = Object.assign({}, data); - let users = params.user || {}, uids = []; - if(users.length > 0){ - users.map((item) => { - uids.push(item.uid); - }) - } - params.user = uids; - return await http.post(this.url, params); - } - }, - average:{ - url: `${config.API_URL}/tools/inspect/average`, - name: "质检数据操作", - post: async function(data={}){ - let params = Object.assign({}, data); - let users = params.users || {}, uids = [], user = params.user || {}, uid = []; - if(users.length > 0){ - users.map((item) => { - uids.push(item.uid); - }) - } - if(user.length > 0){ - user.map((item) => { - uid.push(item.uid); - }) - } - params.users = uids; - params.user = uid; - return await http.post(this.url, params); - } - } - } +import config from "@/config" +import http from "@/utils/request" + +export default { + filter: { + list: { + url: `${config.API_URL}tools/filter/index`, + name: "获得过滤数据", + get: async function(params){ + return await http.get(this.url, params); + } + }, + insert:{ + url: `${config.API_URL}tools/filter/insert`, + name: "导入过滤数据", + post: async function(data={}){ + return await http.post(this.url, data); + } + }, + search: { + url: `${config.API_URL}/tools/filter/search`, + name: "过滤数据", + get: async function(params){ + return await http.get(this.url, params); + } + }, + delete:{ + url: `${config.API_URL}/tools/filter/delete`, + name: "删除过滤数据", + post: async function(data={}){ + return await http.post(this.url, data); + } + }, + edit:{ + url: `${config.API_URL}/tools/filter/edit`, + name: "更新过滤数据", + post: async function(data={}){ + return await http.post(this.url, data); + } + }, + task: { + url: `${config.API_URL}/tools/filter/task`, + name: "任务单数据", + get: async function(params){ + return await http.get(this.url, params); + } + }, + batch:{ + url: `${config.API_URL}/tools/filter/batch`, + name: "条件删除", + post: async function(data={}){ + return await http.post(this.url, data); + } + } + }, + inspect:{ + list: { + url: `${config.API_URL}/tools/inspect/index`, + name: "获得质检数据", + get: async function(data){ + let params = Object.assign({}, data); + let users = params.user || {}, uids = []; + if(users.length > 0){ + users.map((item) => { + uids.push(item.uid); + }) + } + params.user = uids; + return await http.get(this.url, params); + } + }, + insert:{ + url: `${config.API_URL}/tools/inspect/insert`, + name: "导入质检数据", + post: async function(data={}){ + return await http.post(this.url, data); + } + }, + edit:{ + url: `${config.API_URL}/tools/inspect/edit`, + name: "质检数据操作", + post: async function(data={}){ + return await http.post(this.url, data); + } + }, + delete:{ + url: `${config.API_URL}/tools/inspect/delete`, + name: "删除过滤数据", + post: async function(data={}){ + let params = Object.assign({}, data); + let users = params.user || {}, uids = []; + if(users.length > 0){ + users.map((item) => { + uids.push(item.uid); + }) + } + params.user = uids; + return await http.post(this.url, params); + } + }, + average:{ + url: `${config.API_URL}/tools/inspect/average`, + name: "质检数据操作", + post: async function(data={}){ + let params = Object.assign({}, data); + let users = params.users || {}, uids = [], user = params.user || {}, uid = []; + if(users.length > 0){ + users.map((item) => { + uids.push(item.uid); + }) + } + if(user.length > 0){ + user.map((item) => { + uid.push(item.uid); + }) + } + params.users = uids; + params.user = uid; + return await http.post(this.url, params); + } + } + } } \ No newline at end of file diff --git a/ui/src/api/model/user.js b/ui/frontend/src/api/model/user.js similarity index 95% rename from ui/src/api/model/user.js rename to ui/frontend/src/api/model/user.js index f506b4c..2008595 100644 --- a/ui/src/api/model/user.js +++ b/ui/frontend/src/api/model/user.js @@ -1,86 +1,86 @@ -import config from "@/config" -import http from "@/utils/request" - -export default { - list: { - url: `${config.API_URL}auth/user/index`, - name: "获得用户列表", - get: async function(params){ - return await http.get(this.url, params); - } - }, - add: { - url: `${config.API_URL}auth/user/add`, - name: "添加用户", - post: async function(params){ - return await http.post(this.url, params); - } - }, - edit: { - url: `${config.API_URL}auth/user/edit`, - name: "编辑用户", - post: async function(params){ - return await http.post(this.url, params); - } - }, - uppasswd:{ - url: `${config.API_URL}auth/user/passwd`, - name: "修改密码", - post: async function(params){ - return await http.post(this.url, params); - } - }, - uprole: { - url: `${config.API_URL}auth/user/auth`, - name: "编辑用户", - post: async function(params){ - return await http.post(this.url, params); - } - }, - role: { - list: { - url: `${config.API_URL}auth/role/index`, - name: "获得角色列表", - get: async function(params){ - return await http.get(this.url, params); - } - }, - edit: { - url: `${config.API_URL}auth/role/edit`, - name: "编辑角色", - post: async function(params){ - return await http.post(this.url, params); - } - }, - auth: { - url: `${config.API_URL}auth/role/auth`, - name: "编辑角色", - post: async function(params){ - return await http.post(this.url, params); - } - } - }, - department: { - list: { - url: `${config.API_URL}auth/department/index`, - name: "获得部门列表", - get: async function(params){ - return await http.get(this.url, params); - } - }, - edit: { - url: `${config.API_URL}auth/department/edit`, - name: "编辑部门", - post: async function(params){ - return await http.post(this.url, params); - } - } - }, - userinfo:{ - url: `${config.API_URL}auth/user/info`, - name: "获得用户信息", - get: async function(params){ - return await http.get(this.url, params); - } - } +import config from "@/config" +import http from "@/utils/request" + +export default { + list: { + url: `${config.API_URL}auth/user/index`, + name: "获得用户列表", + get: async function(params){ + return await http.get(this.url, params); + } + }, + add: { + url: `${config.API_URL}auth/user/add`, + name: "添加用户", + post: async function(params){ + return await http.post(this.url, params); + } + }, + edit: { + url: `${config.API_URL}auth/user/edit`, + name: "编辑用户", + post: async function(params){ + return await http.post(this.url, params); + } + }, + uppasswd:{ + url: `${config.API_URL}auth/user/passwd`, + name: "修改密码", + post: async function(params){ + return await http.post(this.url, params); + } + }, + uprole: { + url: `${config.API_URL}auth/user/auth`, + name: "编辑用户", + post: async function(params){ + return await http.post(this.url, params); + } + }, + role: { + list: { + url: `${config.API_URL}auth/role/index`, + name: "获得角色列表", + get: async function(params){ + return await http.get(this.url, params); + } + }, + edit: { + url: `${config.API_URL}auth/role/edit`, + name: "编辑角色", + post: async function(params){ + return await http.post(this.url, params); + } + }, + auth: { + url: `${config.API_URL}auth/role/auth`, + name: "编辑角色", + post: async function(params){ + return await http.post(this.url, params); + } + } + }, + department: { + list: { + url: `${config.API_URL}auth/department/index`, + name: "获得部门列表", + get: async function(params){ + return await http.get(this.url, params); + } + }, + edit: { + url: `${config.API_URL}auth/department/edit`, + name: "编辑部门", + post: async function(params){ + return await http.post(this.url, params); + } + } + }, + userinfo:{ + url: `${config.API_URL}auth/user/info`, + name: "获得用户信息", + get: async function(params){ + return await http.get(this.url, params); + } + } } \ No newline at end of file diff --git a/ui/src/assets/icons/BugFill.vue b/ui/frontend/src/assets/icons/BugFill.vue similarity index 100% rename from ui/src/assets/icons/BugFill.vue rename to ui/frontend/src/assets/icons/BugFill.vue diff --git a/ui/src/assets/icons/BugLine.vue b/ui/frontend/src/assets/icons/BugLine.vue similarity index 100% rename from ui/src/assets/icons/BugLine.vue rename to ui/frontend/src/assets/icons/BugLine.vue diff --git a/ui/src/assets/icons/Code.vue b/ui/frontend/src/assets/icons/Code.vue similarity index 100% rename from ui/src/assets/icons/Code.vue rename to ui/frontend/src/assets/icons/Code.vue diff --git a/ui/src/assets/icons/Download.vue b/ui/frontend/src/assets/icons/Download.vue similarity index 100% rename from ui/src/assets/icons/Download.vue rename to ui/frontend/src/assets/icons/Download.vue diff --git a/ui/src/assets/icons/FileExcel.vue b/ui/frontend/src/assets/icons/FileExcel.vue similarity index 100% rename from ui/src/assets/icons/FileExcel.vue rename to ui/frontend/src/assets/icons/FileExcel.vue diff --git a/ui/src/assets/icons/FilePpt.vue b/ui/frontend/src/assets/icons/FilePpt.vue similarity index 100% rename from ui/src/assets/icons/FilePpt.vue rename to ui/frontend/src/assets/icons/FilePpt.vue diff --git a/ui/src/assets/icons/FileWord.vue b/ui/frontend/src/assets/icons/FileWord.vue similarity index 100% rename from ui/src/assets/icons/FileWord.vue rename to ui/frontend/src/assets/icons/FileWord.vue diff --git a/ui/src/assets/icons/Organization.vue b/ui/frontend/src/assets/icons/Organization.vue similarity index 100% rename from ui/src/assets/icons/Organization.vue rename to ui/frontend/src/assets/icons/Organization.vue diff --git a/ui/src/assets/icons/Upload.vue b/ui/frontend/src/assets/icons/Upload.vue similarity index 100% rename from ui/src/assets/icons/Upload.vue rename to ui/frontend/src/assets/icons/Upload.vue diff --git a/ui/src/assets/icons/Vue.vue b/ui/frontend/src/assets/icons/Vue.vue similarity index 100% rename from ui/src/assets/icons/Vue.vue rename to ui/frontend/src/assets/icons/Vue.vue diff --git a/ui/src/assets/icons/Wechat.vue b/ui/frontend/src/assets/icons/Wechat.vue similarity index 100% rename from ui/src/assets/icons/Wechat.vue rename to ui/frontend/src/assets/icons/Wechat.vue diff --git a/ui/src/assets/icons/index.js b/ui/frontend/src/assets/icons/index.js similarity index 100% rename from ui/src/assets/icons/index.js rename to ui/frontend/src/assets/icons/index.js diff --git a/ui/src/components/scCodeEditor/index.vue b/ui/frontend/src/components/scCodeEditor/index.vue similarity index 100% rename from ui/src/components/scCodeEditor/index.vue rename to ui/frontend/src/components/scCodeEditor/index.vue diff --git a/ui/src/components/scContextmenu/index.vue b/ui/frontend/src/components/scContextmenu/index.vue similarity index 100% rename from ui/src/components/scContextmenu/index.vue rename to ui/frontend/src/components/scContextmenu/index.vue diff --git a/ui/src/components/scContextmenu/item.vue b/ui/frontend/src/components/scContextmenu/item.vue similarity index 100% rename from ui/src/components/scContextmenu/item.vue rename to ui/frontend/src/components/scContextmenu/item.vue diff --git a/ui/src/components/scCron/index.vue b/ui/frontend/src/components/scCron/index.vue similarity index 100% rename from ui/src/components/scCron/index.vue rename to ui/frontend/src/components/scCron/index.vue diff --git a/ui/src/components/scCropper/index.vue b/ui/frontend/src/components/scCropper/index.vue similarity index 100% rename from ui/src/components/scCropper/index.vue rename to ui/frontend/src/components/scCropper/index.vue diff --git a/ui/src/components/scDialog/index.vue b/ui/frontend/src/components/scDialog/index.vue similarity index 100% rename from ui/src/components/scDialog/index.vue rename to ui/frontend/src/components/scDialog/index.vue diff --git a/ui/src/components/scEcharts/echarts-theme-T.js b/ui/frontend/src/components/scEcharts/echarts-theme-T.js similarity index 100% rename from ui/src/components/scEcharts/echarts-theme-T.js rename to ui/frontend/src/components/scEcharts/echarts-theme-T.js diff --git a/ui/src/components/scEcharts/index.vue b/ui/frontend/src/components/scEcharts/index.vue similarity index 100% rename from ui/src/components/scEcharts/index.vue rename to ui/frontend/src/components/scEcharts/index.vue diff --git a/ui/src/components/scEditor/index.vue b/ui/frontend/src/components/scEditor/index.vue similarity index 100% rename from ui/src/components/scEditor/index.vue rename to ui/frontend/src/components/scEditor/index.vue diff --git a/ui/src/components/scFileExport/column.vue b/ui/frontend/src/components/scFileExport/column.vue similarity index 100% rename from ui/src/components/scFileExport/column.vue rename to ui/frontend/src/components/scFileExport/column.vue diff --git a/ui/src/components/scFileExport/index.vue b/ui/frontend/src/components/scFileExport/index.vue similarity index 100% rename from ui/src/components/scFileExport/index.vue rename to ui/frontend/src/components/scFileExport/index.vue diff --git a/ui/src/components/scFileImport/index.vue b/ui/frontend/src/components/scFileImport/index.vue similarity index 100% rename from ui/src/components/scFileImport/index.vue rename to ui/frontend/src/components/scFileImport/index.vue diff --git a/ui/src/components/scFileSelect/index.vue b/ui/frontend/src/components/scFileSelect/index.vue similarity index 100% rename from ui/src/components/scFileSelect/index.vue rename to ui/frontend/src/components/scFileSelect/index.vue diff --git a/ui/src/components/scFilterBar/index.vue b/ui/frontend/src/components/scFilterBar/index.vue similarity index 100% rename from ui/src/components/scFilterBar/index.vue rename to ui/frontend/src/components/scFilterBar/index.vue diff --git a/ui/src/components/scFilterBar/my.vue b/ui/frontend/src/components/scFilterBar/my.vue similarity index 100% rename from ui/src/components/scFilterBar/my.vue rename to ui/frontend/src/components/scFilterBar/my.vue diff --git a/ui/src/components/scFilterBar/pinyin.js b/ui/frontend/src/components/scFilterBar/pinyin.js similarity index 100% rename from ui/src/components/scFilterBar/pinyin.js rename to ui/frontend/src/components/scFilterBar/pinyin.js diff --git a/ui/src/components/scFilterBar/pySelect.vue b/ui/frontend/src/components/scFilterBar/pySelect.vue similarity index 100% rename from ui/src/components/scFilterBar/pySelect.vue rename to ui/frontend/src/components/scFilterBar/pySelect.vue diff --git a/ui/src/components/scForm/index.vue b/ui/frontend/src/components/scForm/index.vue similarity index 100% rename from ui/src/components/scForm/index.vue rename to ui/frontend/src/components/scForm/index.vue diff --git a/ui/src/components/scForm/items/tableselect.vue b/ui/frontend/src/components/scForm/items/tableselect.vue similarity index 100% rename from ui/src/components/scForm/items/tableselect.vue rename to ui/frontend/src/components/scForm/items/tableselect.vue diff --git a/ui/src/components/scFormTable/index.vue b/ui/frontend/src/components/scFormTable/index.vue similarity index 100% rename from ui/src/components/scFormTable/index.vue rename to ui/frontend/src/components/scFormTable/index.vue diff --git a/ui/src/components/scIconSelect/index.vue b/ui/frontend/src/components/scIconSelect/index.vue similarity index 100% rename from ui/src/components/scIconSelect/index.vue rename to ui/frontend/src/components/scIconSelect/index.vue diff --git a/ui/src/components/scMini/scStatusIndicator.vue b/ui/frontend/src/components/scMini/scStatusIndicator.vue similarity index 100% rename from ui/src/components/scMini/scStatusIndicator.vue rename to ui/frontend/src/components/scMini/scStatusIndicator.vue diff --git a/ui/src/components/scMini/scTrend.vue b/ui/frontend/src/components/scMini/scTrend.vue similarity index 100% rename from ui/src/components/scMini/scTrend.vue rename to ui/frontend/src/components/scMini/scTrend.vue diff --git a/ui/src/components/scPageHeader/index.vue b/ui/frontend/src/components/scPageHeader/index.vue similarity index 100% rename from ui/src/components/scPageHeader/index.vue rename to ui/frontend/src/components/scPageHeader/index.vue diff --git a/ui/src/components/scPasswordStrength/index.vue b/ui/frontend/src/components/scPasswordStrength/index.vue similarity index 100% rename from ui/src/components/scPasswordStrength/index.vue rename to ui/frontend/src/components/scPasswordStrength/index.vue diff --git a/ui/src/components/scQrCode/index.vue b/ui/frontend/src/components/scQrCode/index.vue similarity index 100% rename from ui/src/components/scQrCode/index.vue rename to ui/frontend/src/components/scQrCode/index.vue diff --git a/ui/src/components/scSelect/index.vue b/ui/frontend/src/components/scSelect/index.vue similarity index 100% rename from ui/src/components/scSelect/index.vue rename to ui/frontend/src/components/scSelect/index.vue diff --git a/ui/src/components/scSelectFilter/index.vue b/ui/frontend/src/components/scSelectFilter/index.vue similarity index 100% rename from ui/src/components/scSelectFilter/index.vue rename to ui/frontend/src/components/scSelectFilter/index.vue diff --git a/ui/src/components/scStatistic/index.vue b/ui/frontend/src/components/scStatistic/index.vue similarity index 100% rename from ui/src/components/scStatistic/index.vue rename to ui/frontend/src/components/scStatistic/index.vue diff --git a/ui/src/components/scTable/column.js b/ui/frontend/src/components/scTable/column.js similarity index 100% rename from ui/src/components/scTable/column.js rename to ui/frontend/src/components/scTable/column.js diff --git a/ui/src/components/scTable/columnSetting.vue b/ui/frontend/src/components/scTable/columnSetting.vue similarity index 100% rename from ui/src/components/scTable/columnSetting.vue rename to ui/frontend/src/components/scTable/columnSetting.vue diff --git a/ui/src/components/scTable/index.vue b/ui/frontend/src/components/scTable/index.vue similarity index 100% rename from ui/src/components/scTable/index.vue rename to ui/frontend/src/components/scTable/index.vue diff --git a/ui/src/components/scTableSelect/index.vue b/ui/frontend/src/components/scTableSelect/index.vue similarity index 100% rename from ui/src/components/scTableSelect/index.vue rename to ui/frontend/src/components/scTableSelect/index.vue diff --git a/ui/src/components/scTitle/index.vue b/ui/frontend/src/components/scTitle/index.vue similarity index 100% rename from ui/src/components/scTitle/index.vue rename to ui/frontend/src/components/scTitle/index.vue diff --git a/ui/src/components/scUpload/file.vue b/ui/frontend/src/components/scUpload/file.vue similarity index 100% rename from ui/src/components/scUpload/file.vue rename to ui/frontend/src/components/scUpload/file.vue diff --git a/ui/src/components/scUpload/index.vue b/ui/frontend/src/components/scUpload/index.vue similarity index 100% rename from ui/src/components/scUpload/index.vue rename to ui/frontend/src/components/scUpload/index.vue diff --git a/ui/src/components/scUpload/multiple.vue b/ui/frontend/src/components/scUpload/multiple.vue similarity index 100% rename from ui/src/components/scUpload/multiple.vue rename to ui/frontend/src/components/scUpload/multiple.vue diff --git a/ui/src/components/scUserSelect/index.vue b/ui/frontend/src/components/scUserSelect/index.vue similarity index 96% rename from ui/src/components/scUserSelect/index.vue rename to ui/frontend/src/components/scUserSelect/index.vue index bdead5a..cbacdcc 100644 --- a/ui/src/components/scUserSelect/index.vue +++ b/ui/frontend/src/components/scUserSelect/index.vue @@ -1,265 +1,265 @@ - - - - - - - \ No newline at end of file diff --git a/ui/src/components/scVideo/index.vue b/ui/frontend/src/components/scVideo/index.vue similarity index 100% rename from ui/src/components/scVideo/index.vue rename to ui/frontend/src/components/scVideo/index.vue diff --git a/ui/src/components/scWaterMark/index.vue b/ui/frontend/src/components/scWaterMark/index.vue similarity index 100% rename from ui/src/components/scWaterMark/index.vue rename to ui/frontend/src/components/scWaterMark/index.vue diff --git a/ui/src/components/scWorkflow/index.vue b/ui/frontend/src/components/scWorkflow/index.vue similarity index 100% rename from ui/src/components/scWorkflow/index.vue rename to ui/frontend/src/components/scWorkflow/index.vue diff --git a/ui/src/components/scWorkflow/nodeWrap.vue b/ui/frontend/src/components/scWorkflow/nodeWrap.vue similarity index 100% rename from ui/src/components/scWorkflow/nodeWrap.vue rename to ui/frontend/src/components/scWorkflow/nodeWrap.vue diff --git a/ui/src/components/scWorkflow/nodes/addNode.vue b/ui/frontend/src/components/scWorkflow/nodes/addNode.vue similarity index 100% rename from ui/src/components/scWorkflow/nodes/addNode.vue rename to ui/frontend/src/components/scWorkflow/nodes/addNode.vue diff --git a/ui/src/components/scWorkflow/nodes/approver.vue b/ui/frontend/src/components/scWorkflow/nodes/approver.vue similarity index 100% rename from ui/src/components/scWorkflow/nodes/approver.vue rename to ui/frontend/src/components/scWorkflow/nodes/approver.vue diff --git a/ui/src/components/scWorkflow/nodes/branch.vue b/ui/frontend/src/components/scWorkflow/nodes/branch.vue similarity index 100% rename from ui/src/components/scWorkflow/nodes/branch.vue rename to ui/frontend/src/components/scWorkflow/nodes/branch.vue diff --git a/ui/src/components/scWorkflow/nodes/promoter.vue b/ui/frontend/src/components/scWorkflow/nodes/promoter.vue similarity index 100% rename from ui/src/components/scWorkflow/nodes/promoter.vue rename to ui/frontend/src/components/scWorkflow/nodes/promoter.vue diff --git a/ui/src/components/scWorkflow/nodes/send.vue b/ui/frontend/src/components/scWorkflow/nodes/send.vue similarity index 100% rename from ui/src/components/scWorkflow/nodes/send.vue rename to ui/frontend/src/components/scWorkflow/nodes/send.vue diff --git a/ui/src/components/scWorkflow/select.vue b/ui/frontend/src/components/scWorkflow/select.vue similarity index 100% rename from ui/src/components/scWorkflow/select.vue rename to ui/frontend/src/components/scWorkflow/select.vue diff --git a/ui/src/config/fileSelect.js b/ui/frontend/src/config/fileSelect.js similarity index 100% rename from ui/src/config/fileSelect.js rename to ui/frontend/src/config/fileSelect.js diff --git a/ui/src/config/filterBar.js b/ui/frontend/src/config/filterBar.js similarity index 100% rename from ui/src/config/filterBar.js rename to ui/frontend/src/config/filterBar.js diff --git a/ui/src/config/iconSelect.js b/ui/frontend/src/config/iconSelect.js similarity index 100% rename from ui/src/config/iconSelect.js rename to ui/frontend/src/config/iconSelect.js diff --git a/ui/src/config/index.js b/ui/frontend/src/config/index.js similarity index 100% rename from ui/src/config/index.js rename to ui/frontend/src/config/index.js diff --git a/ui/src/config/myConfig.js b/ui/frontend/src/config/myConfig.js similarity index 100% rename from ui/src/config/myConfig.js rename to ui/frontend/src/config/myConfig.js diff --git a/ui/src/config/route.js b/ui/frontend/src/config/route.js similarity index 100% rename from ui/src/config/route.js rename to ui/frontend/src/config/route.js diff --git a/ui/src/config/select.js b/ui/frontend/src/config/select.js similarity index 100% rename from ui/src/config/select.js rename to ui/frontend/src/config/select.js diff --git a/ui/src/config/table.js b/ui/frontend/src/config/table.js similarity index 100% rename from ui/src/config/table.js rename to ui/frontend/src/config/table.js diff --git a/ui/src/config/tableSelect.js b/ui/frontend/src/config/tableSelect.js similarity index 100% rename from ui/src/config/tableSelect.js rename to ui/frontend/src/config/tableSelect.js diff --git a/ui/src/config/upload.js b/ui/frontend/src/config/upload.js similarity index 100% rename from ui/src/config/upload.js rename to ui/frontend/src/config/upload.js diff --git a/ui/src/config/workflow.js b/ui/frontend/src/config/workflow.js similarity index 100% rename from ui/src/config/workflow.js rename to ui/frontend/src/config/workflow.js diff --git a/ui/src/directives/auth.js b/ui/frontend/src/directives/auth.js similarity index 100% rename from ui/src/directives/auth.js rename to ui/frontend/src/directives/auth.js diff --git a/ui/src/directives/copy.js b/ui/frontend/src/directives/copy.js similarity index 100% rename from ui/src/directives/copy.js rename to ui/frontend/src/directives/copy.js diff --git a/ui/src/directives/role.js b/ui/frontend/src/directives/role.js similarity index 100% rename from ui/src/directives/role.js rename to ui/frontend/src/directives/role.js diff --git a/ui/src/directives/time.js b/ui/frontend/src/directives/time.js similarity index 100% rename from ui/src/directives/time.js rename to ui/frontend/src/directives/time.js diff --git a/ui/src/layout/components/NavMenu.vue b/ui/frontend/src/layout/components/NavMenu.vue similarity index 100% rename from ui/src/layout/components/NavMenu.vue rename to ui/frontend/src/layout/components/NavMenu.vue diff --git a/ui/src/layout/components/iframeView.vue b/ui/frontend/src/layout/components/iframeView.vue similarity index 100% rename from ui/src/layout/components/iframeView.vue rename to ui/frontend/src/layout/components/iframeView.vue diff --git a/ui/src/layout/components/search.vue b/ui/frontend/src/layout/components/search.vue similarity index 100% rename from ui/src/layout/components/search.vue rename to ui/frontend/src/layout/components/search.vue diff --git a/ui/src/layout/components/setting.vue b/ui/frontend/src/layout/components/setting.vue similarity index 100% rename from ui/src/layout/components/setting.vue rename to ui/frontend/src/layout/components/setting.vue diff --git a/ui/src/layout/components/sideM.vue b/ui/frontend/src/layout/components/sideM.vue similarity index 100% rename from ui/src/layout/components/sideM.vue rename to ui/frontend/src/layout/components/sideM.vue diff --git a/ui/src/layout/components/tags.vue b/ui/frontend/src/layout/components/tags.vue similarity index 100% rename from ui/src/layout/components/tags.vue rename to ui/frontend/src/layout/components/tags.vue diff --git a/ui/src/layout/components/tasks.vue b/ui/frontend/src/layout/components/tasks.vue similarity index 100% rename from ui/src/layout/components/tasks.vue rename to ui/frontend/src/layout/components/tasks.vue diff --git a/ui/src/layout/components/topbar.vue b/ui/frontend/src/layout/components/topbar.vue similarity index 100% rename from ui/src/layout/components/topbar.vue rename to ui/frontend/src/layout/components/topbar.vue diff --git a/ui/src/layout/components/userbar.vue b/ui/frontend/src/layout/components/userbar.vue similarity index 100% rename from ui/src/layout/components/userbar.vue rename to ui/frontend/src/layout/components/userbar.vue diff --git a/ui/src/layout/components/winTool.vue b/ui/frontend/src/layout/components/winTool.vue similarity index 100% rename from ui/src/layout/components/winTool.vue rename to ui/frontend/src/layout/components/winTool.vue diff --git a/ui/src/layout/index.vue b/ui/frontend/src/layout/index.vue similarity index 100% rename from ui/src/layout/index.vue rename to ui/frontend/src/layout/index.vue diff --git a/ui/src/layout/other/404.vue b/ui/frontend/src/layout/other/404.vue similarity index 100% rename from ui/src/layout/other/404.vue rename to ui/frontend/src/layout/other/404.vue diff --git a/ui/src/layout/other/empty.vue b/ui/frontend/src/layout/other/empty.vue similarity index 100% rename from ui/src/layout/other/empty.vue rename to ui/frontend/src/layout/other/empty.vue diff --git a/ui/src/locales/index.js b/ui/frontend/src/locales/index.js similarity index 100% rename from ui/src/locales/index.js rename to ui/frontend/src/locales/index.js diff --git a/ui/src/locales/lang/en.js b/ui/frontend/src/locales/lang/en.js similarity index 100% rename from ui/src/locales/lang/en.js rename to ui/frontend/src/locales/lang/en.js diff --git a/ui/src/locales/lang/zh-cn.js b/ui/frontend/src/locales/lang/zh-cn.js similarity index 100% rename from ui/src/locales/lang/zh-cn.js rename to ui/frontend/src/locales/lang/zh-cn.js diff --git a/ui/src/main.js b/ui/frontend/src/main.js similarity index 100% rename from ui/src/main.js rename to ui/frontend/src/main.js diff --git a/ui/src/mixin/import.vue b/ui/frontend/src/mixin/import.vue similarity index 96% rename from ui/src/mixin/import.vue rename to ui/frontend/src/mixin/import.vue index cc3c11e..ac53642 100644 --- a/ui/src/mixin/import.vue +++ b/ui/frontend/src/mixin/import.vue @@ -1,76 +1,76 @@ - \ No newline at end of file diff --git a/ui/src/pages/auth/department/index.vue b/ui/frontend/src/pages/auth/department/index.vue similarity index 97% rename from ui/src/pages/auth/department/index.vue rename to ui/frontend/src/pages/auth/department/index.vue index f29db7f..a8f1166 100644 --- a/ui/src/pages/auth/department/index.vue +++ b/ui/frontend/src/pages/auth/department/index.vue @@ -1,146 +1,146 @@ - - - \ No newline at end of file diff --git a/ui/src/pages/auth/department/save.vue b/ui/frontend/src/pages/auth/department/save.vue similarity index 96% rename from ui/src/pages/auth/department/save.vue rename to ui/frontend/src/pages/auth/department/save.vue index 08b7846..e5a7a0d 100644 --- a/ui/src/pages/auth/department/save.vue +++ b/ui/frontend/src/pages/auth/department/save.vue @@ -1,118 +1,118 @@ - - - \ No newline at end of file diff --git a/ui/src/pages/auth/menu/index.vue b/ui/frontend/src/pages/auth/menu/index.vue similarity index 100% rename from ui/src/pages/auth/menu/index.vue rename to ui/frontend/src/pages/auth/menu/index.vue diff --git a/ui/src/pages/auth/menu/save.vue b/ui/frontend/src/pages/auth/menu/save.vue similarity index 100% rename from ui/src/pages/auth/menu/save.vue rename to ui/frontend/src/pages/auth/menu/save.vue diff --git a/ui/src/pages/auth/role/index.vue b/ui/frontend/src/pages/auth/role/index.vue similarity index 100% rename from ui/src/pages/auth/role/index.vue rename to ui/frontend/src/pages/auth/role/index.vue diff --git a/ui/src/pages/auth/role/permission.vue b/ui/frontend/src/pages/auth/role/permission.vue similarity index 100% rename from ui/src/pages/auth/role/permission.vue rename to ui/frontend/src/pages/auth/role/permission.vue diff --git a/ui/src/pages/auth/role/save.vue b/ui/frontend/src/pages/auth/role/save.vue similarity index 100% rename from ui/src/pages/auth/role/save.vue rename to ui/frontend/src/pages/auth/role/save.vue diff --git a/ui/src/pages/auth/user/index.vue b/ui/frontend/src/pages/auth/user/index.vue similarity index 100% rename from ui/src/pages/auth/user/index.vue rename to ui/frontend/src/pages/auth/user/index.vue diff --git a/ui/src/pages/auth/user/role.vue b/ui/frontend/src/pages/auth/user/role.vue similarity index 95% rename from ui/src/pages/auth/user/role.vue rename to ui/frontend/src/pages/auth/user/role.vue index 90524ba..62ed8f4 100644 --- a/ui/src/pages/auth/user/role.vue +++ b/ui/frontend/src/pages/auth/user/role.vue @@ -1,81 +1,81 @@ - - - - - \ No newline at end of file diff --git a/ui/src/pages/auth/user/save.vue b/ui/frontend/src/pages/auth/user/save.vue similarity index 100% rename from ui/src/pages/auth/user/save.vue rename to ui/frontend/src/pages/auth/user/save.vue diff --git a/ui/src/pages/customer/company/detail.vue b/ui/frontend/src/pages/customer/company/detail.vue similarity index 100% rename from ui/src/pages/customer/company/detail.vue rename to ui/frontend/src/pages/customer/company/detail.vue diff --git a/ui/src/pages/customer/company/list.vue b/ui/frontend/src/pages/customer/company/list.vue similarity index 100% rename from ui/src/pages/customer/company/list.vue rename to ui/frontend/src/pages/customer/company/list.vue diff --git a/ui/src/pages/customer/company/save.vue b/ui/frontend/src/pages/customer/company/save.vue similarity index 100% rename from ui/src/pages/customer/company/save.vue rename to ui/frontend/src/pages/customer/company/save.vue diff --git a/ui/src/pages/customer/company/search.vue b/ui/frontend/src/pages/customer/company/search.vue similarity index 100% rename from ui/src/pages/customer/company/search.vue rename to ui/frontend/src/pages/customer/company/search.vue diff --git a/ui/src/pages/home/index.vue b/ui/frontend/src/pages/home/index.vue similarity index 100% rename from ui/src/pages/home/index.vue rename to ui/frontend/src/pages/home/index.vue diff --git a/ui/src/pages/home/widgets/components/about.vue b/ui/frontend/src/pages/home/widgets/components/about.vue similarity index 100% rename from ui/src/pages/home/widgets/components/about.vue rename to ui/frontend/src/pages/home/widgets/components/about.vue diff --git a/ui/src/pages/home/widgets/components/echarts.vue b/ui/frontend/src/pages/home/widgets/components/echarts.vue similarity index 100% rename from ui/src/pages/home/widgets/components/echarts.vue rename to ui/frontend/src/pages/home/widgets/components/echarts.vue diff --git a/ui/src/pages/home/widgets/components/index.js b/ui/frontend/src/pages/home/widgets/components/index.js similarity index 100% rename from ui/src/pages/home/widgets/components/index.js rename to ui/frontend/src/pages/home/widgets/components/index.js diff --git a/ui/src/pages/home/widgets/components/progress.vue b/ui/frontend/src/pages/home/widgets/components/progress.vue similarity index 100% rename from ui/src/pages/home/widgets/components/progress.vue rename to ui/frontend/src/pages/home/widgets/components/progress.vue diff --git a/ui/src/pages/home/widgets/components/time.vue b/ui/frontend/src/pages/home/widgets/components/time.vue similarity index 100% rename from ui/src/pages/home/widgets/components/time.vue rename to ui/frontend/src/pages/home/widgets/components/time.vue diff --git a/ui/src/pages/home/widgets/components/ver.vue b/ui/frontend/src/pages/home/widgets/components/ver.vue similarity index 100% rename from ui/src/pages/home/widgets/components/ver.vue rename to ui/frontend/src/pages/home/widgets/components/ver.vue diff --git a/ui/src/pages/home/widgets/components/welcome.vue b/ui/frontend/src/pages/home/widgets/components/welcome.vue similarity index 100% rename from ui/src/pages/home/widgets/components/welcome.vue rename to ui/frontend/src/pages/home/widgets/components/welcome.vue diff --git a/ui/src/pages/home/widgets/index.vue b/ui/frontend/src/pages/home/widgets/index.vue similarity index 100% rename from ui/src/pages/home/widgets/index.vue rename to ui/frontend/src/pages/home/widgets/index.vue diff --git a/ui/src/pages/home/work/components/myapp.vue b/ui/frontend/src/pages/home/work/components/myapp.vue similarity index 100% rename from ui/src/pages/home/work/components/myapp.vue rename to ui/frontend/src/pages/home/work/components/myapp.vue diff --git a/ui/src/pages/home/work/index.vue b/ui/frontend/src/pages/home/work/index.vue similarity index 100% rename from ui/src/pages/home/work/index.vue rename to ui/frontend/src/pages/home/work/index.vue diff --git a/ui/src/pages/login/components/commonPage.vue b/ui/frontend/src/pages/login/components/commonPage.vue similarity index 100% rename from ui/src/pages/login/components/commonPage.vue rename to ui/frontend/src/pages/login/components/commonPage.vue diff --git a/ui/src/pages/login/components/passwordForm.vue b/ui/frontend/src/pages/login/components/passwordForm.vue similarity index 100% rename from ui/src/pages/login/components/passwordForm.vue rename to ui/frontend/src/pages/login/components/passwordForm.vue diff --git a/ui/src/pages/login/components/phoneForm.vue b/ui/frontend/src/pages/login/components/phoneForm.vue similarity index 100% rename from ui/src/pages/login/components/phoneForm.vue rename to ui/frontend/src/pages/login/components/phoneForm.vue diff --git a/ui/src/pages/login/index.vue b/ui/frontend/src/pages/login/index.vue similarity index 100% rename from ui/src/pages/login/index.vue rename to ui/frontend/src/pages/login/index.vue diff --git a/ui/src/pages/login/resetPassword.vue b/ui/frontend/src/pages/login/resetPassword.vue similarity index 100% rename from ui/src/pages/login/resetPassword.vue rename to ui/frontend/src/pages/login/resetPassword.vue diff --git a/ui/src/pages/login/userRegister.vue b/ui/frontend/src/pages/login/userRegister.vue similarity index 100% rename from ui/src/pages/login/userRegister.vue rename to ui/frontend/src/pages/login/userRegister.vue diff --git a/ui/src/pages/system/client/index.vue b/ui/frontend/src/pages/system/client/index.vue similarity index 100% rename from ui/src/pages/system/client/index.vue rename to ui/frontend/src/pages/system/client/index.vue diff --git a/ui/src/pages/system/client/save.vue b/ui/frontend/src/pages/system/client/save.vue similarity index 100% rename from ui/src/pages/system/client/save.vue rename to ui/frontend/src/pages/system/client/save.vue diff --git a/ui/src/pages/system/dic/dic.vue b/ui/frontend/src/pages/system/dic/dic.vue similarity index 100% rename from ui/src/pages/system/dic/dic.vue rename to ui/frontend/src/pages/system/dic/dic.vue diff --git a/ui/src/pages/system/dic/index.vue b/ui/frontend/src/pages/system/dic/index.vue similarity index 100% rename from ui/src/pages/system/dic/index.vue rename to ui/frontend/src/pages/system/dic/index.vue diff --git a/ui/src/pages/system/dic/list.vue b/ui/frontend/src/pages/system/dic/list.vue similarity index 100% rename from ui/src/pages/system/dic/list.vue rename to ui/frontend/src/pages/system/dic/list.vue diff --git a/ui/src/pages/system/log/index.vue b/ui/frontend/src/pages/system/log/index.vue similarity index 100% rename from ui/src/pages/system/log/index.vue rename to ui/frontend/src/pages/system/log/index.vue diff --git a/ui/src/pages/system/log/info.vue b/ui/frontend/src/pages/system/log/info.vue similarity index 100% rename from ui/src/pages/system/log/info.vue rename to ui/frontend/src/pages/system/log/info.vue diff --git a/ui/src/pages/system/setting/index.vue b/ui/frontend/src/pages/system/setting/index.vue similarity index 100% rename from ui/src/pages/system/setting/index.vue rename to ui/frontend/src/pages/system/setting/index.vue diff --git a/ui/src/pages/system/table/index.vue b/ui/frontend/src/pages/system/table/index.vue similarity index 100% rename from ui/src/pages/system/table/index.vue rename to ui/frontend/src/pages/system/table/index.vue diff --git a/ui/src/pages/system/table/save.vue b/ui/frontend/src/pages/system/table/save.vue similarity index 100% rename from ui/src/pages/system/table/save.vue rename to ui/frontend/src/pages/system/table/save.vue diff --git a/ui/src/pages/system/task/index.vue b/ui/frontend/src/pages/system/task/index.vue similarity index 100% rename from ui/src/pages/system/task/index.vue rename to ui/frontend/src/pages/system/task/index.vue diff --git a/ui/src/pages/system/task/logs.vue b/ui/frontend/src/pages/system/task/logs.vue similarity index 100% rename from ui/src/pages/system/task/logs.vue rename to ui/frontend/src/pages/system/task/logs.vue diff --git a/ui/src/pages/system/task/save.vue b/ui/frontend/src/pages/system/task/save.vue similarity index 100% rename from ui/src/pages/system/task/save.vue rename to ui/frontend/src/pages/system/task/save.vue diff --git a/ui/src/pages/ucenter/index.vue b/ui/frontend/src/pages/ucenter/index.vue similarity index 100% rename from ui/src/pages/ucenter/index.vue rename to ui/frontend/src/pages/ucenter/index.vue diff --git a/ui/src/pages/ucenter/user/account.vue b/ui/frontend/src/pages/ucenter/user/account.vue similarity index 100% rename from ui/src/pages/ucenter/user/account.vue rename to ui/frontend/src/pages/ucenter/user/account.vue diff --git a/ui/src/pages/ucenter/user/logs.vue b/ui/frontend/src/pages/ucenter/user/logs.vue similarity index 100% rename from ui/src/pages/ucenter/user/logs.vue rename to ui/frontend/src/pages/ucenter/user/logs.vue diff --git a/ui/src/pages/ucenter/user/password.vue b/ui/frontend/src/pages/ucenter/user/password.vue similarity index 100% rename from ui/src/pages/ucenter/user/password.vue rename to ui/frontend/src/pages/ucenter/user/password.vue diff --git a/ui/src/pages/ucenter/user/pushSettings.vue b/ui/frontend/src/pages/ucenter/user/pushSettings.vue similarity index 100% rename from ui/src/pages/ucenter/user/pushSettings.vue rename to ui/frontend/src/pages/ucenter/user/pushSettings.vue diff --git a/ui/src/pages/ucenter/user/seting.vue b/ui/frontend/src/pages/ucenter/user/seting.vue similarity index 100% rename from ui/src/pages/ucenter/user/seting.vue rename to ui/frontend/src/pages/ucenter/user/seting.vue diff --git a/ui/src/pages/ucenter/user/space.vue b/ui/frontend/src/pages/ucenter/user/space.vue similarity index 100% rename from ui/src/pages/ucenter/user/space.vue rename to ui/frontend/src/pages/ucenter/user/space.vue diff --git a/ui/src/pages/ucenter/user/upToEnterprise.vue b/ui/frontend/src/pages/ucenter/user/upToEnterprise.vue similarity index 100% rename from ui/src/pages/ucenter/user/upToEnterprise.vue rename to ui/frontend/src/pages/ucenter/user/upToEnterprise.vue diff --git a/ui/src/router/index.js b/ui/frontend/src/router/index.js similarity index 100% rename from ui/src/router/index.js rename to ui/frontend/src/router/index.js diff --git a/ui/src/router/scrollBehavior.js b/ui/frontend/src/router/scrollBehavior.js similarity index 100% rename from ui/src/router/scrollBehavior.js rename to ui/frontend/src/router/scrollBehavior.js diff --git a/ui/src/router/systemRouter.js b/ui/frontend/src/router/systemRouter.js similarity index 100% rename from ui/src/router/systemRouter.js rename to ui/frontend/src/router/systemRouter.js diff --git a/ui/src/sent.js b/ui/frontend/src/sent.js similarity index 100% rename from ui/src/sent.js rename to ui/frontend/src/sent.js diff --git a/ui/src/store/index.js b/ui/frontend/src/store/index.js similarity index 100% rename from ui/src/store/index.js rename to ui/frontend/src/store/index.js diff --git a/ui/src/store/modules/global.js b/ui/frontend/src/store/modules/global.js similarity index 100% rename from ui/src/store/modules/global.js rename to ui/frontend/src/store/modules/global.js diff --git a/ui/src/store/modules/iframe.js b/ui/frontend/src/store/modules/iframe.js similarity index 100% rename from ui/src/store/modules/iframe.js rename to ui/frontend/src/store/modules/iframe.js diff --git a/ui/src/store/modules/keepAlive.js b/ui/frontend/src/store/modules/keepAlive.js similarity index 100% rename from ui/src/store/modules/keepAlive.js rename to ui/frontend/src/store/modules/keepAlive.js diff --git a/ui/src/store/modules/viewTags.js b/ui/frontend/src/store/modules/viewTags.js similarity index 100% rename from ui/src/store/modules/viewTags.js rename to ui/frontend/src/store/modules/viewTags.js diff --git a/ui/src/style/app.scss b/ui/frontend/src/style/app.scss similarity index 100% rename from ui/src/style/app.scss rename to ui/frontend/src/style/app.scss diff --git a/ui/src/style/dark.scss b/ui/frontend/src/style/dark.scss similarity index 100% rename from ui/src/style/dark.scss rename to ui/frontend/src/style/dark.scss diff --git a/ui/src/style/fix.scss b/ui/frontend/src/style/fix.scss similarity index 100% rename from ui/src/style/fix.scss rename to ui/frontend/src/style/fix.scss diff --git a/ui/src/style/media.scss b/ui/frontend/src/style/media.scss similarity index 100% rename from ui/src/style/media.scss rename to ui/frontend/src/style/media.scss diff --git a/ui/src/style/pages.scss b/ui/frontend/src/style/pages.scss similarity index 100% rename from ui/src/style/pages.scss rename to ui/frontend/src/style/pages.scss diff --git a/ui/src/style/style.scss b/ui/frontend/src/style/style.scss similarity index 100% rename from ui/src/style/style.scss rename to ui/frontend/src/style/style.scss diff --git a/ui/src/utils/color.js b/ui/frontend/src/utils/color.js similarity index 100% rename from ui/src/utils/color.js rename to ui/frontend/src/utils/color.js diff --git a/ui/src/utils/db.js b/ui/frontend/src/utils/db.js similarity index 100% rename from ui/src/utils/db.js rename to ui/frontend/src/utils/db.js diff --git a/ui/src/utils/errorHandler.js b/ui/frontend/src/utils/errorHandler.js similarity index 100% rename from ui/src/utils/errorHandler.js rename to ui/frontend/src/utils/errorHandler.js diff --git a/ui/src/utils/excel.js b/ui/frontend/src/utils/excel.js similarity index 96% rename from ui/src/utils/excel.js rename to ui/frontend/src/utils/excel.js index b25deaa..dcd3a73 100644 --- a/ui/src/utils/excel.js +++ b/ui/frontend/src/utils/excel.js @@ -1,154 +1,154 @@ -/* eslint-disable */ -import * as XLSX from "xlsx"; - -function auto_width(ws, data) { - /*set worksheet max width per col*/ - const colWidth = data.map(row => row.map(val => { - /*if null/undefined*/ - if (val == null) { - return { - 'wch': 10 - }; - } - /*if chinese*/ - else if (val.toString().charCodeAt(0) > 255) { - return { - 'wch': val.toString().length * 2 - }; - } else { - return { - 'wch': val.toString().length - }; - } - })) - /*start in the first row*/ - let result = colWidth[0]; - for (let i = 1; i < colWidth.length; i++) { - for (let j = 0; j < colWidth[i].length; j++) { - if (result[j]['wch'] < colWidth[i][j]['wch']) { - result[j]['wch'] = colWidth[i][j]['wch'] > 30 ? 30 : colWidth[i][j]['wch']; - } - } - } - ws['!cols'] = result; -} -function json_to_array(key, jsonData) { - return jsonData.map(v => key.map(j => { - return v[j] - })); -} -// fix data,return string -function fixdata(data) { - let o = '' - let l = 0 - const w = 10240 - for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w))) - o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w))) - return o -} -// get head from excel file,return array -function get_header_row(sheet) { - const headers = [] - const range = XLSX.utils.decode_range(sheet['!ref']) - let C - const R = range.s.r /* start in the first row */ - for (C = range.s.c; C <= range.e.c; ++C) { - /* walk every column in the range */ - var cell = sheet[XLSX.utils.encode_cell({ - c: C, - r: R - })] /* find the cell in the first row */ - var hdr = 'UNKNOWN ' + C // <-- replace with your desired default - if (cell && cell.t) hdr = XLSX.utils.format_cell(cell) - headers.push(hdr) - } - return headers -} -export const export_table_to_excel = (id, filename) => { - const table = document.getElementById(id); - const wb = XLSX.utils.table_to_book(table); - XLSX.writeFile(wb, filename); - /* the second way */ - // const table = document.getElementById(id); - // const wb = XLSX.utils.book_new(); - // const ws = XLSX.utils.table_to_sheet(table); - // XLSX.utils.book_append_sheet(wb, ws, filename); - // XLSX.writeFile(wb, filename); -} -export const export_json_to_excel = ({ - data, - key, - title, - filename, - autoWidth -}) => { - const wb = XLSX.utils.book_new(); - data.unshift(title); - const ws = XLSX.utils.json_to_sheet(data, { - header: key, - skipHeader: true - }); - if (autoWidth) { - const arr = json_to_array(key, data); - auto_width(ws, arr); - } - XLSX.utils.book_append_sheet(wb, ws, filename); - // electron.ipcRenderer.send('sync-saveFile-dialog', {data:wb, filename: filename + '.xlsx'}); - XLSX.writeFile(wb, filename + '.xlsx'); -} -export const export_array_to_excel = ({ - key, - data, - title, - filename, - autoWidth -}) => { - const wb = XLSX.utils.book_new(); - const arr = json_to_array(key, data); - arr.unshift(title); - const ws = XLSX.utils.aoa_to_sheet(arr); - if (autoWidth) { - auto_width(ws, arr); - } - XLSX.utils.book_append_sheet(wb, ws, filename); - XLSX.writeFile(wb, filename + '.xlsx'); -} -export const read = (data, type) => { - /* if type == 'base64' must fix data first */ - // const fixedData = fixdata(data) - // const workbook = XLSX.read(btoa(fixedData), { type: 'base64' }) - const workbook = XLSX.read(data, { - type: type - }); - const firstSheetName = workbook.SheetNames[0]; - const worksheet = workbook.Sheets[firstSheetName]; - const header = get_header_row(worksheet); - const results = XLSX.utils.sheet_to_json(worksheet); - return { - header, - results - }; -} -export const get_object_keys = (objects) => { - var keys = []; - for (var property in objects) { - keys.push(property); - } - return keys; -} -export const get_key_data = (data, key) => { - for (var i in data) { - if (key.indexOf(i) == -1) { - delete data[i]; - } - } - return data; -} -export default { - export_table_to_excel, - export_array_to_excel, - export_json_to_excel, - get_object_keys, - get_key_data, - read +/* eslint-disable */ +import * as XLSX from "xlsx"; + +function auto_width(ws, data) { + /*set worksheet max width per col*/ + const colWidth = data.map(row => row.map(val => { + /*if null/undefined*/ + if (val == null) { + return { + 'wch': 10 + }; + } + /*if chinese*/ + else if (val.toString().charCodeAt(0) > 255) { + return { + 'wch': val.toString().length * 2 + }; + } else { + return { + 'wch': val.toString().length + }; + } + })) + /*start in the first row*/ + let result = colWidth[0]; + for (let i = 1; i < colWidth.length; i++) { + for (let j = 0; j < colWidth[i].length; j++) { + if (result[j]['wch'] < colWidth[i][j]['wch']) { + result[j]['wch'] = colWidth[i][j]['wch'] > 30 ? 30 : colWidth[i][j]['wch']; + } + } + } + ws['!cols'] = result; +} +function json_to_array(key, jsonData) { + return jsonData.map(v => key.map(j => { + return v[j] + })); +} +// fix data,return string +function fixdata(data) { + let o = '' + let l = 0 + const w = 10240 + for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w))) + o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w))) + return o +} +// get head from excel file,return array +function get_header_row(sheet) { + const headers = [] + const range = XLSX.utils.decode_range(sheet['!ref']) + let C + const R = range.s.r /* start in the first row */ + for (C = range.s.c; C <= range.e.c; ++C) { + /* walk every column in the range */ + var cell = sheet[XLSX.utils.encode_cell({ + c: C, + r: R + })] /* find the cell in the first row */ + var hdr = 'UNKNOWN ' + C // <-- replace with your desired default + if (cell && cell.t) hdr = XLSX.utils.format_cell(cell) + headers.push(hdr) + } + return headers +} +export const export_table_to_excel = (id, filename) => { + const table = document.getElementById(id); + const wb = XLSX.utils.table_to_book(table); + XLSX.writeFile(wb, filename); + /* the second way */ + // const table = document.getElementById(id); + // const wb = XLSX.utils.book_new(); + // const ws = XLSX.utils.table_to_sheet(table); + // XLSX.utils.book_append_sheet(wb, ws, filename); + // XLSX.writeFile(wb, filename); +} +export const export_json_to_excel = ({ + data, + key, + title, + filename, + autoWidth +}) => { + const wb = XLSX.utils.book_new(); + data.unshift(title); + const ws = XLSX.utils.json_to_sheet(data, { + header: key, + skipHeader: true + }); + if (autoWidth) { + const arr = json_to_array(key, data); + auto_width(ws, arr); + } + XLSX.utils.book_append_sheet(wb, ws, filename); + // electron.ipcRenderer.send('sync-saveFile-dialog', {data:wb, filename: filename + '.xlsx'}); + XLSX.writeFile(wb, filename + '.xlsx'); +} +export const export_array_to_excel = ({ + key, + data, + title, + filename, + autoWidth +}) => { + const wb = XLSX.utils.book_new(); + const arr = json_to_array(key, data); + arr.unshift(title); + const ws = XLSX.utils.aoa_to_sheet(arr); + if (autoWidth) { + auto_width(ws, arr); + } + XLSX.utils.book_append_sheet(wb, ws, filename); + XLSX.writeFile(wb, filename + '.xlsx'); +} +export const read = (data, type) => { + /* if type == 'base64' must fix data first */ + // const fixedData = fixdata(data) + // const workbook = XLSX.read(btoa(fixedData), { type: 'base64' }) + const workbook = XLSX.read(data, { + type: type + }); + const firstSheetName = workbook.SheetNames[0]; + const worksheet = workbook.Sheets[firstSheetName]; + const header = get_header_row(worksheet); + const results = XLSX.utils.sheet_to_json(worksheet); + return { + header, + results + }; +} +export const get_object_keys = (objects) => { + var keys = []; + for (var property in objects) { + keys.push(property); + } + return keys; +} +export const get_key_data = (data, key) => { + for (var i in data) { + if (key.indexOf(i) == -1) { + delete data[i]; + } + } + return data; +} +export default { + export_table_to_excel, + export_array_to_excel, + export_json_to_excel, + get_object_keys, + get_key_data, + read } \ No newline at end of file diff --git a/ui/src/utils/load.js b/ui/frontend/src/utils/load.js similarity index 100% rename from ui/src/utils/load.js rename to ui/frontend/src/utils/load.js diff --git a/ui/src/utils/permission.js b/ui/frontend/src/utils/permission.js similarity index 100% rename from ui/src/utils/permission.js rename to ui/frontend/src/utils/permission.js diff --git a/ui/src/utils/print.js b/ui/frontend/src/utils/print.js similarity index 100% rename from ui/src/utils/print.js rename to ui/frontend/src/utils/print.js diff --git a/ui/src/utils/request.js b/ui/frontend/src/utils/request.js similarity index 100% rename from ui/src/utils/request.js rename to ui/frontend/src/utils/request.js diff --git a/ui/src/utils/template.js b/ui/frontend/src/utils/template.js similarity index 100% rename from ui/src/utils/template.js rename to ui/frontend/src/utils/template.js diff --git a/ui/src/utils/tool.js b/ui/frontend/src/utils/tool.js similarity index 100% rename from ui/src/utils/tool.js rename to ui/frontend/src/utils/tool.js diff --git a/ui/src/utils/useTabs.js b/ui/frontend/src/utils/useTabs.js similarity index 100% rename from ui/src/utils/useTabs.js rename to ui/frontend/src/utils/useTabs.js diff --git a/ui/src/utils/verificate.js b/ui/frontend/src/utils/verificate.js similarity index 100% rename from ui/src/utils/verificate.js rename to ui/frontend/src/utils/verificate.js diff --git a/ui/vue.config.js b/ui/frontend/vue.config.js similarity index 100% rename from ui/vue.config.js rename to ui/frontend/vue.config.js diff --git a/ui/main.js b/ui/main.js new file mode 100644 index 0000000..98527c4 --- /dev/null +++ b/ui/main.js @@ -0,0 +1,2 @@ +const { ElectronEgg } = require('ee-core'); +new ElectronEgg(); \ No newline at end of file diff --git a/ui/package.json b/ui/package.json index dbd3c43..410ad32 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,74 +1,63 @@ { - "name": "scui", - "version": "1.6.6", - "private": true, + "name": "sentos", + "version": "1.0.0", + "description": "A fast, desktop software development framework", + "main": "main.js", "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build --report", - "lint": "vue-cli-service lint" + "dev": "ee-bin dev", + "dev-frontend": "ee-bin dev --serve=frontend", + "dev-electron": "ee-bin dev --serve=electron", + "build-frontend": "ee-bin build", + "start": "ee-bin start", + "rd": "ee-bin rd", + "encrypt": "ee-bin encrypt", + "clean": "ee-bin clean", + "icon": "ee-bin icon", + "reload": "nodemon --config ./electron/config/nodemon.json", + "rebuild": "electron-rebuild", + "re-sqlite": "electron-rebuild -f -w better-sqlite3", + "build-w": "electron-builder --config=./electron/config/builder.json -w=nsis --x64", + "build-w-32": "electron-builder --config=./electron/config/builder.json -w=nsis --ia32", + "build-w-64": "electron-builder --config=./electron/config/builder.json -w=nsis --x64", + "build-w-arm64": "electron-builder --config=./electron/config/builder.json -w=nsis --arm64", + "build-wz": "electron-builder --config=./electron/config/builder.json -w=7z --x64", + "build-wz-32": "electron-builder --config=./electron/config/builder.json -w=7z --ia32", + "build-wz-64": "electron-builder --config=./electron/config/builder.json -w=7z --x64", + "build-wz-arm64": "electron-builder --config=./electron/config/builder.json -w=7z --arm64", + "build-m": "electron-builder --config=./electron/config/builder.json -m", + "build-m-arm64": "electron-builder --config=./electron/config/builder.json -m --arm64", + "build-l": "electron-builder --config=./electron/config/builder.json -l=deb --x64", + "build-l-32": "electron-builder --config=./electron/config/builder.json -l=deb --ia32", + "build-l-64": "electron-builder --config=./electron/config/builder.json -l=deb --x64", + "build-l-arm64": "electron-builder --config=./electron/config/builder.json -l=deb --arm64", + "build-l-armv7l": "electron-builder --config=./electron/config/builder.json -l=deb --armv7l", + "build-lr-64": "electron-builder --config=./electron/config/builder.json -l=rpm --x64", + "build-lp-64": "electron-builder --config=./electron/config/builder.json -l=pacman --x64", + "test": "set DEBUG=* && electron . --env=local" + }, + "keywords": [ + "thinkphp", + "vue", + "Electron", + "electron-egg", + "ElectronEgg" + ], + "author": "molong, Inc ", + "license": "Apache", + "devDependencies": { + "@electron/rebuild": "^3.2.13", + "debug": "^4.3.3", + "ee-bin": "^1.3.0", + "electron": "^21.4.4", + "electron-builder": "^23.6.0", + "eslint": "^5.13.0", + "eslint-plugin-prettier": "^3.0.1", + "nodemon": "^2.0.16" }, "dependencies": { - "@element-plus/icons-vue": "2.0.6", - "@tinymce/tinymce-vue": "5.0.0", - "axios": "0.27.2", - "codemirror": "5.65.5", - "core-js": "3.24.1", - "cropperjs": "1.5.12", - "crypto-js": "4.1.1", - "echarts": "5.3.3", - "element-plus": "2.2.12", - "nprogress": "0.2.0", - "qrcodejs2": "0.0.2", - "sortablejs": "1.15.0", - "tinymce": "6.1.2", - "vue": "3.2.37", - "vue-i18n": "9.2.2", - "vue-router": "4.1.3", - "vuedraggable": "4.0.3", - "vuex": "4.0.2", - "xgplayer": "2.31.7", - "xgplayer-hls": "2.5.2", - "xlsx": "^0.18.5" - }, - "devDependencies": { - "@babel/core": "7.18.9", - "@babel/eslint-parser": "7.18.9", - "@vue/cli-plugin-babel": "5.0.8", - "@vue/cli-plugin-eslint": "5.0.8", - "@vue/cli-service": "5.0.8", - "eslint": "8.21.0", - "eslint-plugin-vue": "9.3.0", - "sass": "1.37.5", - "sass-loader": "10.1.1" - }, - "eslintConfig": { - "root": true, - "env": { - "node": true - }, - "globals": { - "APP_CONFIG": true - }, - "extends": [ - "plugin:vue/vue3-essential", - "eslint:recommended" - ], - "parserOptions": { - "parser": "@babel/eslint-parser", - "requireConfigFile": false - }, - "rules": { - "indent": 0, - "no-tabs": 0, - "no-mixed-spaces-and-tabs": 0, - "vue/no-unused-components": 0, - "vue/multi-word-component-names": 0 - } - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not dead", - "not ie 11" - ] -} + "dayjs": "^1.10.7", + "ee-core": "^2.6.0", + "electron-updater": "^5.3.0", + "lodash": "^4.17.21" + } +} \ No newline at end of file