From e0b9bb5804744b5507da5273b81e12680b9f4442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=A8=E6=A0=88=E5=B0=8F=E5=AD=A6=E7=94=9F?= <1518079521@qq.com> Date: Sat, 1 Jul 2023 16:20:54 +0800 Subject: [PATCH] update niucloud --- .../hello_world/app/dict/notice/weapp.php | 4 +- .../controller/applet/SiteVersion.php | 56 +++++++ .../adminapi/controller/applet/Version.php | 110 ++++++++++++ .../controller/applet/VersionDownload.php | 33 ++++ niucloud/app/adminapi/controller/diy/Diy.php | 6 +- .../adminapi/controller/sys/Attachment.php | 72 +++++--- .../app/adminapi/controller/sys/Common.php | 39 +++++ .../app/adminapi/controller/sys/Schedule.php | 19 ++- .../adminapi/controller/upload/Storage.php | 2 +- .../app/adminapi/controller/upload/Upload.php | 6 +- .../app/adminapi/controller/weapp/Package.php | 35 ++++ niucloud/app/adminapi/route/applet.php | 54 ++++++ niucloud/app/adminapi/route/sys.php | 12 +- niucloud/app/api/controller/upload/Upload.php | 13 +- niucloud/app/api/controller/weapp/Weapp.php | 7 + niucloud/app/api/middleware/ApiChannel.php | 5 +- niucloud/app/api/route/route.php | 2 + niucloud/app/common.php | 81 ++++++++- niucloud/app/dict/applet/AppletlDict.php | 43 +++++ niucloud/app/dict/diy/ComponentDict.php | 4 - niucloud/app/dict/diy/LinkDict.php | 4 - niucloud/app/dict/diy/PagesDict.php | 77 +++++++-- niucloud/app/dict/diy/TemplateDict.php | 5 - niucloud/app/dict/menu/admin.php | 13 ++ niucloud/app/dict/menu/site.php | 2 +- niucloud/app/dict/notice/weapp.php | 4 +- niucloud/app/dict/schedule/ScheduleDict.php | 17 ++ niucloud/app/dict/sys/FileDict.php | 19 ++- niucloud/app/dict/sys/IconDict.php | 31 ++++ niucloud/app/event.php | 3 +- niucloud/app/install/controller/Index.php | 2 +- niucloud/app/install/source/database.sql | 99 +++++++---- niucloud/app/install/view/index/step-4.html | 4 +- niucloud/app/job/notice/Notice.php | 2 +- niucloud/app/lang/en/api.php | 5 +- niucloud/app/lang/en/dict.php | 8 +- niucloud/app/lang/en/validate.php | 7 +- niucloud/app/lang/zh-cn/api.php | 11 +- niucloud/app/lang/zh-cn/dict.php | 9 +- niucloud/app/lang/zh-cn/validate.php | 8 +- niucloud/app/listener/notice/Weapp.php | 6 +- niucloud/app/listener/notice/Wechat.php | 62 ++++--- .../app/model/applet/AppletSiteVersion.php | 45 +++++ niucloud/app/model/applet/AppletVersion.php | 38 +++++ niucloud/app/model/article/Article.php | 24 ++- niucloud/app/model/diy/Diy.php | 12 ++ niucloud/app/model/sys/SysMenu.php | 2 + .../admin/applet/AppletDownloadService.php | 44 +++++ .../admin/applet/AppletVersionService.php | 124 ++++++++++++++ .../admin/applet/AppletVersionSiteService.php | 73 ++++++++ .../service/admin/article/ArticleService.php | 4 +- .../app/service/admin/auth/AuthService.php | 5 +- niucloud/app/service/admin/diy/DiyService.php | 46 +++-- .../service/admin/generator/vm/controller.vm | 2 +- .../service/admin/generator/vm/web_index.vm | 2 +- .../admin/install/InstallSystemService.php | 4 +- .../admin/schedule/ScheduleService.php | 15 +- .../app/service/admin/site/SiteService.php | 25 +-- .../service/admin/stat/SiteStatService.php | 57 +------ .../app/service/admin/sys/AreaService.php | 2 +- .../service/admin/sys/AttachmentService.php | 157 +++++++++++++----- .../app/service/admin/sys/ConfigService.php | 38 ++++- .../app/service/admin/sys/MenuService.php | 3 +- .../app/service/admin/sys/SystemService.php | 7 +- .../{file => upload}/StorageConfigService.php | 2 +- .../{file => upload}/UploadConfigService.php | 2 +- .../admin/{file => upload}/UploadService.php | 12 +- .../admin/weapp/WeappPackageService.php | 35 ++++ .../admin/weapp/WeappTemplateService.php | 6 +- .../service/api/article/ArticleService.php | 6 +- .../app/service/api/login/AuthService.php | 5 +- .../app/service/api/notice/NoticeService.php | 11 ++ .../app/service/api/upload/UploadService.php | 11 +- .../core/addon/CoreAddonInstallService.php | 61 +++++-- niucloud/app/service/core/addon/WapTrait.php | 25 ++- .../core/applet/CoreAppletDownloadService.php | 106 ++++++++++++ .../applet/CoreAppletSiteVersionService.php | 118 +++++++++++++ .../core/applet/CoreAppletVersionService.php | 67 ++++++++ .../app/service/core/menu/CoreMenuService.php | 7 +- .../app/service/core/notice/NoticeService.php | 2 +- .../service/core/pay/CorePayEventService.php | 1 + .../service/core/pay/CoreRefundService.php | 2 +- .../core/paytype/CoreBalanceService.php | 22 ++- .../core/schedule/CoreScheduleService.php | 3 +- .../app/service/core/site/CoreSiteService.php | 24 +-- .../service/core/sys/CoreSysConfigService.php | 7 +- .../service/core/upload/CoreBase64Service.php | 10 +- .../service/core/upload/CoreFileService.php | 4 +- .../service/core/upload/CoreImageService.php | 33 ++-- .../core/upload/CoreStorageService.php | 6 +- .../core/upload/CoreUploadConfigService.php | 2 +- .../service/core/upload/CoreUploadService.php | 20 +-- niucloud/app/validate/sys/Schedule.php | 49 ++++++ niucloud/config/upload.php | 20 ++- niucloud/config/version.php | 4 +- niucloud/core/dict/BaseDict.php | 2 +- niucloud/core/dict/Icon.php | 50 ++++++ niucloud/core/template/TemplateLoader.php | 8 +- niucloud/core/template/Weapp.php | 2 +- niucloud/core/upload/Aliyun.php | 2 +- niucloud/core/upload/BaseUpload.php | 40 ++--- niucloud/core/upload/Local.php | 11 +- niucloud/core/upload/Qiniu.php | 2 +- niucloud/core/upload/Tencent.php | 2 +- 104 files changed, 2053 insertions(+), 479 deletions(-) create mode 100644 niucloud/app/adminapi/controller/applet/SiteVersion.php create mode 100644 niucloud/app/adminapi/controller/applet/Version.php create mode 100644 niucloud/app/adminapi/controller/applet/VersionDownload.php create mode 100644 niucloud/app/adminapi/controller/sys/Common.php create mode 100644 niucloud/app/adminapi/controller/weapp/Package.php create mode 100644 niucloud/app/adminapi/route/applet.php create mode 100644 niucloud/app/dict/applet/AppletlDict.php create mode 100644 niucloud/app/dict/sys/IconDict.php create mode 100644 niucloud/app/model/applet/AppletSiteVersion.php create mode 100644 niucloud/app/model/applet/AppletVersion.php create mode 100644 niucloud/app/service/admin/applet/AppletDownloadService.php create mode 100644 niucloud/app/service/admin/applet/AppletVersionService.php create mode 100644 niucloud/app/service/admin/applet/AppletVersionSiteService.php rename niucloud/app/service/admin/{file => upload}/StorageConfigService.php (98%) rename niucloud/app/service/admin/{file => upload}/UploadConfigService.php (97%) rename niucloud/app/service/admin/{file => upload}/UploadService.php (88%) create mode 100644 niucloud/app/service/admin/weapp/WeappPackageService.php create mode 100644 niucloud/app/service/core/applet/CoreAppletDownloadService.php create mode 100644 niucloud/app/service/core/applet/CoreAppletSiteVersionService.php create mode 100644 niucloud/app/service/core/applet/CoreAppletVersionService.php create mode 100644 niucloud/app/validate/sys/Schedule.php create mode 100644 niucloud/core/dict/Icon.php diff --git a/niucloud/addon/hello_world/app/dict/notice/weapp.php b/niucloud/addon/hello_world/app/dict/notice/weapp.php index 823650272..86e0c9a18 100644 --- a/niucloud/addon/hello_world/app/dict/notice/weapp.php +++ b/niucloud/addon/hello_world/app/dict/notice/weapp.php @@ -1,9 +1,11 @@ [ - 'temp_key' => '111', + 'tid' => '111', 'content' => [ ['消息内容', '{name}', 'keyword1'], ], + 'kid_list' => [1, 3, 4, 2], + 'scene_desc' => '' ] ]; \ No newline at end of file diff --git a/niucloud/app/adminapi/controller/applet/SiteVersion.php b/niucloud/app/adminapi/controller/applet/SiteVersion.php new file mode 100644 index 000000000..93a5e85ae --- /dev/null +++ b/niucloud/app/adminapi/controller/applet/SiteVersion.php @@ -0,0 +1,56 @@ +request->params([ + + ]); + return success(( new AppletVersionSiteService())->getPage($data)); + } + + /** + * 详情 + * @param int $id + */ + public function info(int $id) + { + return success(( new AppletVersionSiteService() )->getInfo($id)); + } + + /** + * 查询最后一个下载或升级的版本 + * @param string $type + * @return Response + */ + public function getLastVersion(string $type){ + return success(( new AppletVersionSiteService() )->getLastVersion($type)); + } + + +} diff --git a/niucloud/app/adminapi/controller/applet/Version.php b/niucloud/app/adminapi/controller/applet/Version.php new file mode 100644 index 000000000..2f1948333 --- /dev/null +++ b/niucloud/app/adminapi/controller/applet/Version.php @@ -0,0 +1,110 @@ +request->params([ + + ]); + return success(( new AppletVersionService() )->getPage($data)); + } + + /** + * 详情 + * @param int $id + */ + public function info(int $id) + { + return success(( new AppletVersionService() )->getInfo($id)); + } + + /** + * 添加 + * @return Response + */ + public function add() + { + $data = $this->request->params([ + [ 'type', '' ], + [ 'desc', '' ], + [ 'status', '' ], + [ 'path', '' ], + [ 'version', '' ], + ]); + $id = ( new AppletVersionService() )->add($data); + return success('ADD_SUCCESS'); + } + + /** + * 编辑 + * @param int $id + * @return Response + */ + public function edit(int $id) + { + $data = $this->request->params([ + [ 'desc', '' ], + [ 'status', '' ], + [ 'path', '' ], + [ 'version', '' ], + ]); + + ( new AppletVersionService() )->edit($id, $data); + return success('EDIT_SUCCESS'); + } + + /** + * 删除 + * @param int $id + */ + public function del(int $id) + { + ( new AppletVersionService() )->del($id); + return success('DELETE_SUCCESS'); + } + + /** + * 设置状态 + * @param int $id + * @param $type + * @return Response + */ + public function setStatus(int $id, $status){ + ( new AppletVersionService() )->setStatus($id, $status); + return success('EDIT_SUCCESS'); + } + /** + * 小程序包上传 + * @return Response + * @throws \Exception + */ + public function upload(){ + $data = $this->request->params([ + ['file', 'file'], + ], true); + return success(data:( new AppletVersionService() )->upload($data['file'])); + } +} diff --git a/niucloud/app/adminapi/controller/applet/VersionDownload.php b/niucloud/app/adminapi/controller/applet/VersionDownload.php new file mode 100644 index 000000000..fe34d72df --- /dev/null +++ b/niucloud/app/adminapi/controller/applet/VersionDownload.php @@ -0,0 +1,33 @@ +download($id); + } + + +} diff --git a/niucloud/app/adminapi/controller/diy/Diy.php b/niucloud/app/adminapi/controller/diy/Diy.php index ee693bcf2..4cc147cc8 100644 --- a/niucloud/app/adminapi/controller/diy/Diy.php +++ b/niucloud/app/adminapi/controller/diy/Diy.php @@ -31,6 +31,7 @@ class Diy extends BaseAdminController $data = $this->request->params([ [ "title", "" ], [ "type", "" ], + [ 'mode', '' ] ]); return success(( new DiyService() )->getPage($data)); } @@ -70,9 +71,10 @@ class Diy extends BaseAdminController [ "name", "" ], [ "type", "" ], [ 'template', '' ], - [ 'mode', 'diy' ], + [ 'mode', 'diy' ], // 页面展示模式,diy:自定义,fixed:固定 [ "value", "" ], - [ 'is_default', 0 ] + [ 'is_default', 0 ], + [ 'is_change', '' ] ]); $this->validate($data, 'app\validate\diy\Diy.add'); diff --git a/niucloud/app/adminapi/controller/sys/Attachment.php b/niucloud/app/adminapi/controller/sys/Attachment.php index ca51b1f63..50dd47012 100644 --- a/niucloud/app/adminapi/controller/sys/Attachment.php +++ b/niucloud/app/adminapi/controller/sys/Attachment.php @@ -25,13 +25,13 @@ class Attachment extends BaseAdminController public function lists() { $data = $this->request->params([ - ['att_type', ''], - ['cate_id', 0], - ['real_name', ''], - ['page', 0], - ['limit', 0], + [ 'att_type', '' ], + [ 'cate_id', 0 ], + [ 'real_name', '' ], + [ 'page', 0 ], + [ 'limit', 0 ], ]); - return success((new AttachmentService())->getPage($data)); + return success(( new AttachmentService() )->getPage($data)); } /** @@ -48,11 +48,12 @@ class Attachment extends BaseAdminController * 批量删除 * @return Response */ - public function batchDel(){ + public function batchDel() + { $data = $this->request->params([ - ['att_ids', []], + [ 'att_ids', [] ], ]); - (new AttachmentService())->delAll($data['att_ids']); + ( new AttachmentService() )->delAll($data[ 'att_ids' ]); return success('DELETE_SUCCESS'); } @@ -63,11 +64,11 @@ class Attachment extends BaseAdminController public function addCategory() { $data = $this->request->params([ - ['type', FileDict::IMAGE], - ['name', ''] + [ 'type', FileDict::IMAGE ], + [ 'name', '' ] ]); $this->validate($data, 'app\validate\sys\AttachmentCategory.add'); - (new AttachmentService())->addCategory($data); + ( new AttachmentService() )->addCategory($data); return success('ADD_SUCCESS'); } @@ -77,10 +78,10 @@ class Attachment extends BaseAdminController public function categoryLists() { $data = $this->request->params([ - ['type', ''], - ['name', ''], + [ 'type', '' ], + [ 'name', '' ], ]); - return success((new AttachmentService())->getCategoryList($data)); + return success(( new AttachmentService() )->getCategoryList($data)); } /** @@ -90,10 +91,10 @@ class Attachment extends BaseAdminController public function editCategory($id) { $data = $this->request->params([ - ['name', ''] + [ 'name', '' ] ]); $this->validate($data, 'app\validate\sys\AttachmentCategory.edit'); - (new AttachmentService())->editCategory($id, $data); + ( new AttachmentService() )->editCategory($id, $data); return success('EDIT_SUCCESS'); } @@ -104,7 +105,7 @@ class Attachment extends BaseAdminController */ public function deleteCategory($id) { - (new AttachmentService())->delCategory($id); + ( new AttachmentService() )->delCategory($id); return success('DELETE_SUCCESS'); } @@ -115,9 +116,9 @@ class Attachment extends BaseAdminController public function moveCategory($att_id) { $data = $this->request->params([ - ['cate_id', ''] + [ 'cate_id', '' ] ]); - (new AttachmentService())->modifyCategory($att_id, $data['cate_id']); + ( new AttachmentService() )->modifyCategory($att_id, $data[ 'cate_id' ]); return success('SUCCESS'); } @@ -129,11 +130,36 @@ class Attachment extends BaseAdminController public function batchMoveCategory() { $data = $this->request->params([ - ['cate_id', ''], - ['att_ids', []] + [ 'cate_id', '' ], + [ 'att_ids', [] ] ]); - (new AttachmentService())->batchModifyCategory($data['att_ids'], $data['cate_id']); + ( new AttachmentService() )->batchModifyCategory($data[ 'att_ids' ], $data[ 'cate_id' ]); return success('SUCCESS'); } + /** + * 获取图标库分类列表 + */ + public function getIconCategoryList() + { + $data = $this->request->params([ + [ 'name', '' ], + ]); + return success(( new AttachmentService() )->getIconCategoryList($data)); + } + + /** + * 获取图标库列表 + */ + public function getIconList() + { + $data = $this->request->params([ + [ 'page', 0 ], + [ 'limit', 0 ], + [ 'cate_id', 0 ], + [ 'real_name', '' ], + ]); + return success(( new AttachmentService() )->getIconList($data)); + } + } diff --git a/niucloud/app/adminapi/controller/sys/Common.php b/niucloud/app/adminapi/controller/sys/Common.php new file mode 100644 index 000000000..9916cce90 --- /dev/null +++ b/niucloud/app/adminapi/controller/sys/Common.php @@ -0,0 +1,39 @@ +getMonth()); + } + + /** + * 星期 + * @return \think\Response + */ + public function getWeek(){ + return success((new DateDict())->getWeek()); + } + + +} diff --git a/niucloud/app/adminapi/controller/sys/Schedule.php b/niucloud/app/adminapi/controller/sys/Schedule.php index b91c15086..dcf516c66 100644 --- a/niucloud/app/adminapi/controller/sys/Schedule.php +++ b/niucloud/app/adminapi/controller/sys/Schedule.php @@ -33,6 +33,13 @@ class Schedule extends BaseAdminController } + /** + * 计划任务模板 + * @return \think\Response + */ + public function template(){ + return success(data:(new ScheduleService())->getTemplateList()); + } /** * 获取任务模式 @@ -62,6 +69,7 @@ class Schedule extends BaseAdminController [ 'time', [] ], [ 'status', ScheduleDict::OFF ], ]); + $this->validate($data, 'app\validate\sys\Schedule.add'); ( new ScheduleService() )->add($data); return success('ADD_SUCCESS'); } @@ -74,7 +82,7 @@ class Schedule extends BaseAdminController public function edit(int $id) { $data = $this->request->params([ - [ 'key', '' ], +// [ 'key', '' ], [ 'time', [] ], [ 'status', ScheduleDict::OFF ], ]); @@ -100,8 +108,15 @@ class Schedule extends BaseAdminController */ public function del(int $id) { - ( new ScheduleService() )->del($id); return success('DELETE_SUCCESS'); } + + /** + * 时间间隔类型 + * @return \think\Response + */ + public function getDateType(){ + return success(data:ScheduleDict::getDateType()); + } } diff --git a/niucloud/app/adminapi/controller/upload/Storage.php b/niucloud/app/adminapi/controller/upload/Storage.php index 8930987ce..6a486e396 100644 --- a/niucloud/app/adminapi/controller/upload/Storage.php +++ b/niucloud/app/adminapi/controller/upload/Storage.php @@ -12,7 +12,7 @@ namespace app\adminapi\controller\upload; use app\dict\sys\StorageDict; -use app\service\admin\file\StorageConfigService; +use app\service\admin\upload\StorageConfigService; use core\base\BaseAdminController; use core\exception\AdminException; use think\Response; diff --git a/niucloud/app/adminapi/controller/upload/Upload.php b/niucloud/app/adminapi/controller/upload/Upload.php index 132c7d066..dd4f1a913 100644 --- a/niucloud/app/adminapi/controller/upload/Upload.php +++ b/niucloud/app/adminapi/controller/upload/Upload.php @@ -11,8 +11,8 @@ namespace app\adminapi\controller\upload; -use app\service\admin\file\UploadConfigService; -use app\service\admin\file\UploadService; +use app\service\admin\upload\UploadConfigService; +use app\service\admin\upload\UploadService; use core\base\BaseAdminController; use think\Response; @@ -56,7 +56,7 @@ class Upload extends BaseAdminController ['file', 'file'], ], true); $upload_service = new UploadService(); - return success($upload_service->document($data['file'], $type, true)); + return success($upload_service->document($data['file'], $type)); } /** diff --git a/niucloud/app/adminapi/controller/weapp/Package.php b/niucloud/app/adminapi/controller/weapp/Package.php new file mode 100644 index 000000000..098579f41 --- /dev/null +++ b/niucloud/app/adminapi/controller/weapp/Package.php @@ -0,0 +1,35 @@ +request->params([ + ['version', ''], + ['path', ''], + ['desc', ''], + ['config', []], + ]); + + } + +} diff --git a/niucloud/app/adminapi/route/applet.php b/niucloud/app/adminapi/route/applet.php new file mode 100644 index 000000000..e3e33785e --- /dev/null +++ b/niucloud/app/adminapi/route/applet.php @@ -0,0 +1,54 @@ +middleware([ + AdminCheckToken::class, + AdminCheckRole::class, + AdminLog::class +]); \ No newline at end of file diff --git a/niucloud/app/adminapi/route/sys.php b/niucloud/app/adminapi/route/sys.php index c9792f679..263c9c553 100644 --- a/niucloud/app/adminapi/route/sys.php +++ b/niucloud/app/adminapi/route/sys.php @@ -122,6 +122,10 @@ Route::group('sys', function () { Route::put('upload/config', 'upload.Upload/setUploadConfig'); //获取上传设置 Route::get('upload/config', 'upload.Upload/getUploadConfig'); + // 获取图标库列表 + Route::get('attachment/icon_category', 'sys.Attachment/getIconCategoryList'); + // 获取图标库列表 + Route::get('attachment/icon', 'sys.Attachment/getIconList'); /***************************************************** 协议管理 ****************************************************/ //消息列表 Route::get('agreement', 'sys.Agreement/lists'); @@ -167,13 +171,19 @@ Route::group('sys', function () { Route::delete('schedule/:id', 'sys.Schedule/del'); //任务模式 Route::get('schedule/type', 'sys.Schedule/getType'); + //任务模板 + Route::get('schedule/template', 'sys.Schedule/template'); + //任务时间间隔 + Route::get('schedule/datetype', 'sys.Schedule/getDateType'); /***************************************************** 应用管理 ****************************************************/ Route::get('applist', 'sys.App/getAppList'); /***************************************************** 清理缓存-刷新菜单 ****************************************************/ Route::post('schema/clear', 'sys.System/schemaCache'); - + /***************************************************** 公共字典数据 ****************************************************/ + Route::get('date/month', 'sys.Common/getMonth'); + Route::get('date/week', 'sys.Common/getWeek'); })->middleware([ AdminCheckToken::class, diff --git a/niucloud/app/api/controller/upload/Upload.php b/niucloud/app/api/controller/upload/Upload.php index de37b02af..83e6187c6 100644 --- a/niucloud/app/api/controller/upload/Upload.php +++ b/niucloud/app/api/controller/upload/Upload.php @@ -19,6 +19,10 @@ use core\base\BaseApiController; class Upload extends BaseApiController { + /** + * 图片上传 + * @return \think\Response + */ public function image(){ $data = $this->request->params([ ['file', 'file'], @@ -27,6 +31,10 @@ class Upload extends BaseApiController return success($upload_service->image($data['file'])); } + /** + * 远程图片拉取 + * @return \think\Response + */ public function imageFetch(){ $data = $this->request->params([ ['url', ''], @@ -36,7 +44,10 @@ class Upload extends BaseApiController } - + /** + * base64图片上传 + * @return \think\Response + */ public function imageBase64(){ $data = $this->request->params([ ['content', ''], diff --git a/niucloud/app/api/controller/weapp/Weapp.php b/niucloud/app/api/controller/weapp/Weapp.php index 102c8823e..b5e564a51 100644 --- a/niucloud/app/api/controller/weapp/Weapp.php +++ b/niucloud/app/api/controller/weapp/Weapp.php @@ -11,6 +11,7 @@ namespace app\api\controller\weapp; +use app\service\api\notice\NoticeService; use app\service\api\weapp\WeappAuthService; use core\base\BaseApiController; use EasyWeChat\Kernel\Exceptions\InvalidArgumentException; @@ -44,4 +45,10 @@ class Weapp extends BaseApiController $weapp_auth_service = new WeappAuthService(); return success($weapp_auth_service->register($data['openid'], $data['mobile'], $data['mobile_code'])); } + + + public function subscribeMessage(){ + $data = $this->request->params([ ['keys', ''] ]); + return success((new NoticeService())->getWeappNoticeTemplateId($data['keys'])); + } } diff --git a/niucloud/app/api/middleware/ApiChannel.php b/niucloud/app/api/middleware/ApiChannel.php index e78513184..c3850ed31 100644 --- a/niucloud/app/api/middleware/ApiChannel.php +++ b/niucloud/app/api/middleware/ApiChannel.php @@ -40,10 +40,7 @@ class ApiChannel if (in_array($request->rule()->getRule(), $channel_rules)) { $site_id = $request->param('site_id', -1); if ($site_id != -1) { - $site_info = (new CoreSiteService())->getSiteCache($site_id); - if(empty($site_info)) throw new AuthException('SITE_NOT_EXIST'); - $site_code = $site_info['code'] ?? ''; - $request->pushHeader([ system_name('api_site_id_name') => $site_code ]); + $request->pushHeader([ system_name('api_site_id_name') => $site_id ]); } } return $next($request); diff --git a/niucloud/app/api/route/route.php b/niucloud/app/api/route/route.php index e7c6f0087..7f263c747 100644 --- a/niucloud/app/api/route/route.php +++ b/niucloud/app/api/route/route.php @@ -40,6 +40,8 @@ Route::group(function() { Route::post('weapp/login', 'weapp.Weapp/login'); //小程序通过code注册 Route::post('weapp/register', 'weapp.Weapp/register'); + // 获取小程序订阅消息模板id + Route::get('weapp/subscribemsg', 'weapp.Weapp/subscribeMessage'); //登录 Route::get('login', 'login.Login/login'); //第三方绑定 diff --git a/niucloud/app/common.php b/niucloud/app/common.php index 37c2931d6..54d44d0e9 100644 --- a/niucloud/app/common.php +++ b/niucloud/app/common.php @@ -6,6 +6,7 @@ use think\facade\Lang; use think\facade\Queue; use think\facade\Cache; use core\util\Snowflake; +use app\service\core\upload\CoreImageService; // 应用公共文件 /** @@ -369,11 +370,11 @@ function filter($string) */ function create_no(string $prefix = '', string $tag = '') { - $dataCenterId = 1; - $machineId = 2; - $snowflake = new Snowflake($dataCenterId, $machineId); + $data_center_id = 1; + $machine_id = 2; + $snowflake = new Snowflake($data_center_id, $machine_id); $id = $snowflake->generateId(); - return $prefix.$tag.$id; + return $prefix.date('YmdHi').$tag.$id; } /** @@ -706,4 +707,74 @@ function cache_remember(string $name = null, $value = '', $tag = null, $options */ function project_path() { return dirname(root_path()) . DIRECTORY_SEPARATOR; -} \ No newline at end of file +} + +/** + * 图片转base64 + * @param string $path + * @param $is_delete 转换后是否删除原图 + * @return void + */ +function image_to_base64(string $path, $is_delete = false) { + if (!file_exists($path)) return 'image not exist'; + + $mime = getimagesize($path)['mime']; + $image_data = file_get_contents($path); + // 将图片转换为 base64 + $base64_data = base64_encode($image_data); + + if ($is_delete) @unlink($path); + + return "data:{$mime};base64,{$base64_data}"; +} +/** + * 获取缩略图 + * @param $site_id + * @param $image + * @param $thumb_type + * @return mixed + * @throws Exception + */ +function get_thumb_images($site_id, $image, $thumb_type = 'all', bool $is_throw_exception = false){ + + return (new CoreImageService())->thumb($site_id, $image, $thumb_type, $is_throw_exception); +} +/** + * 版本号转整数 例如1.0.0=001.000.000=001000000=1000000 + * @param string $ver + * @return int + */ +function version_to_int($version) { + $version_array = explode(".", $version); + + $v1 = sprintf('%03s', (int) $version_array[0] ?? 0); + $v2 = sprintf('%03s', (int) $version_array[1] ?? 0); + $v3 = sprintf('%03s', (int) $version_array[2] ?? 0); + return (int) "{$v1}{$v2}{$v3}"; +} + +/** + * 整数版本号转字符串例如 1000000=001000000=001.000.000=1.0.0 + * @param int $ver + * @return string + */ +function version_to_string($ver) { + if($ver > 999) { + if($ver > 999999) { + $ver = $ver . ""; + $v3 = (int) substr($ver, -3); + $v2 = (int) substr($ver, -6, 3); + $v1 = (int) substr($ver, 0, strlen($ver) - 6); + } else { + $ver = $ver . ""; + $v3 = (int) substr($ver, -3); + $v2 = (int) substr($ver, 0, strlen($ver) - 3); + $v1 = 0; + } + } else { + $v3 = $ver; + $v2 = 0; + $v1 = 0; + } + return "{$v1}.{$v2}.{$v3}"; +} diff --git a/niucloud/app/dict/applet/AppletlDict.php b/niucloud/app/dict/applet/AppletlDict.php new file mode 100644 index 000000000..e782a258b --- /dev/null +++ b/niucloud/app/dict/applet/AppletlDict.php @@ -0,0 +1,43 @@ + get_lang('dict_applet.channel_weapp'),//启用 + self::OFF => get_lang('dict_applet.channel_wechat'),//下架 + ]; + return $data; + } +} \ No newline at end of file diff --git a/niucloud/app/dict/diy/ComponentDict.php b/niucloud/app/dict/diy/ComponentDict.php index c1d6ad05d..2955b02f4 100644 --- a/niucloud/app/dict/diy/ComponentDict.php +++ b/niucloud/app/dict/diy/ComponentDict.php @@ -21,10 +21,6 @@ use core\dict\DictLoader; class ComponentDict { - /** - * 获取组件 - * @return array|null - */ public static function getComponent() { $system_components = [ diff --git a/niucloud/app/dict/diy/LinkDict.php b/niucloud/app/dict/diy/LinkDict.php index f8a82d21c..404529a89 100644 --- a/niucloud/app/dict/diy/LinkDict.php +++ b/niucloud/app/dict/diy/LinkDict.php @@ -20,10 +20,6 @@ use core\dict\DictLoader; */ class LinkDict { - /** - * 获取链接 - * @return array - */ public static function getLink() { $system_links = [ diff --git a/niucloud/app/dict/diy/PagesDict.php b/niucloud/app/dict/diy/PagesDict.php index a61f23ed3..ee55ffbe6 100644 --- a/niucloud/app/dict/diy/PagesDict.php +++ b/niucloud/app/dict/diy/PagesDict.php @@ -21,11 +21,6 @@ use core\dict\DictLoader; class PagesDict { - /** - * 获取页面数据 - * @param array $params - * @return array|string|null - */ public static function getPages($params = []) { $system_pages = [ @@ -258,14 +253,74 @@ class PagesDict ] ], // 'tourism' => [ -// "title" => "旅游", // 页面名称 +// "title" => "固定模板示例", // 页面名称 // 'cover' => 'static/resource/images/diy/template/tourism_cover.png', // 页面封面图 // 'preview' => '', // 页面预览图 -// 'desc' => '酒店旅游住宿门票景点', // 页面描述 +// 'desc' => '描述固定模板', // 页面描述 // 'mode' => 'fixed', // 页面模式:diy:自定义,fixed:固定 // 'data' => [ -// 'component' => 'tourism-index', // 模板组件名称 -// 'link' => '' // 装修链接 +// "global" => [ +// "title" => "固定模板示例", +// "pageBgColor" => "#F8F8F8", +// 'bgUrl' => '', +// 'imgWidth' => '', +// 'imgHeight' => '', +// "bottomTabBarSwitch" => true, +// "template" => [ +// 'textColor' => "#303133", +// "pageBgColor" => "", +// "componentBgColor" => "", +// "topRounded" => 0, +// "bottomRounded" => 0, +// "elementBgColor" => "", +// "topElementRounded" => 0, +// "bottomElementRounded" => 0, +// "margin" => [ +// "top" => 0, +// "bottom" => 0, +// "both" => 0 +// ] +// ], +// 'topStatusBar' => [ +// 'bgColor' => "#ffffff", +// 'isTransparent' => false, +// 'isShow' => true, +// 'style' => 'style-1', +// 'textColor' => "#333333", +// 'textAlign' => 'center', +// ], +// 'popWindow' => [ +// 'imgUrl' => "", +// 'imgWidth' => '', +// 'imgHeight' => '', +// 'count' => -1, +// 'show' => 0, +// 'link' => [ +// 'name' => "" +// ], +// ] +// ], +// "value" => [ +// [ +// "id" => "524jcssmp8c0", +// "componentName" => "DemoIndex", +// "componentTitle" => "固定模板示例", +// "uses" => 0, +// "ignore" => [], +// "pageBgColor" => "", +// "componentBgColor" => "rgba(255, 255, 255, 1)", +// "topRounded" => 0, +// "bottomRounded" => 0, +// "elementBgColor" => "", +// "topElementRounded" => 0, +// "bottomElementRounded" => 0, +// "margin" => [ +// "top" => 0, +// "bottom" => 0, +// "both" => 0 +// ] +// ] +// ] // ] // ] ], @@ -932,6 +987,7 @@ class PagesDict // ] ] ]; + $pages = ( new DictLoader("UniappPages") )->load($system_pages); if (!empty($params[ 'type' ])) { if (!empty($pages[ $params[ 'type' ] ])) { @@ -943,12 +999,11 @@ class PagesDict } } } + return $temp; } else { - return []; } - return $temp; } return $pages; diff --git a/niucloud/app/dict/diy/TemplateDict.php b/niucloud/app/dict/diy/TemplateDict.php index 9cb6f05c7..78be3dd33 100644 --- a/niucloud/app/dict/diy/TemplateDict.php +++ b/niucloud/app/dict/diy/TemplateDict.php @@ -21,11 +21,6 @@ use core\dict\DictLoader; class TemplateDict { - /** - * 获取页面模板 - * @param array $params - * @return array|string|null - */ public static function getTemplate($params = []) { $system_pages = [ diff --git a/niucloud/app/dict/menu/admin.php b/niucloud/app/dict/menu/admin.php index 8949f9642..467835e3c 100644 --- a/niucloud/app/dict/menu/admin.php +++ b/niucloud/app/dict/menu/admin.php @@ -458,6 +458,19 @@ 'sort' => 20, 'status' => 1, 'is_show' => 1, + ], + [ + 'menu_name' => '小程序平台', + 'menu_key' => 'setting_oplatform', + 'menu_type' => 1, + 'icon' => 'iconfont-iconweixin', + 'api_url' => 'sys/weapp', + 'router_path' => 'weapp', + 'view_path' => 'setting/weapp', + 'methods' => 'get', + 'sort' => 20, + 'status' => 1, + 'is_show' => 1, ] ] ], diff --git a/niucloud/app/dict/menu/site.php b/niucloud/app/dict/menu/site.php index 93e18493b..4bb857ed5 100644 --- a/niucloud/app/dict/menu/site.php +++ b/niucloud/app/dict/menu/site.php @@ -485,7 +485,7 @@ return 'is_show' => 1, 'children' => [ [ - 'menu_name' => '账单管理', + 'menu_name' => '财务流水', 'menu_key' => 'site_account_list', 'menu_type' => 1, 'icon' => 'element-Postcard', diff --git a/niucloud/app/dict/notice/weapp.php b/niucloud/app/dict/notice/weapp.php index 6040cbcd8..c07c422b1 100644 --- a/niucloud/app/dict/notice/weapp.php +++ b/niucloud/app/dict/notice/weapp.php @@ -1,12 +1,14 @@ [ - 'temp_key' => '755', + 'tid' => '755', 'content' => [ ['交易单号', '{trade_no}', 'keyword1'], ['充值金额', '{price}', 'keyword2'], ['账户余额', '{balance}', 'keyword3'], ['充值时间', '{time}', 'keyword4'], ], + 'kid_list' => [1, 3, 4, 2], + 'scene_desc' => '' ] ]; \ No newline at end of file diff --git a/niucloud/app/dict/schedule/ScheduleDict.php b/niucloud/app/dict/schedule/ScheduleDict.php index 4d22b83a9..99b5f1cec 100644 --- a/niucloud/app/dict/schedule/ScheduleDict.php +++ b/niucloud/app/dict/schedule/ScheduleDict.php @@ -19,6 +19,8 @@ class ScheduleDict const ON = 1; const OFF = 2; + + /** * 任务模式 * @return array @@ -40,4 +42,19 @@ class ScheduleDict self::OFF => get_lang('dict_schedule.off'),//关闭 ]; } + + const MIN = 'min';//每隔几分钟 + const HOUR = 'hour';//每隔几小时 + const DAY = 'day';//每隔几天 + const WEEK = 'week';//每周 + const MONTH = 'month';//每月 + public static function getDateType(){ + return [ + self::MIN => get_lang('dict_schedule.min'), + self::HOUR => get_lang('dict_schedule.hour'), + self::DAY => get_lang('dict_schedule.day'), + self::WEEK => get_lang('dict_schedule.week'), + self::MONTH => get_lang('dict_schedule.month'), + ]; + } } \ No newline at end of file diff --git a/niucloud/app/dict/sys/FileDict.php b/niucloud/app/dict/sys/FileDict.php index 4cd2f4668..a65adadab 100644 --- a/niucloud/app/dict/sys/FileDict.php +++ b/niucloud/app/dict/sys/FileDict.php @@ -50,7 +50,7 @@ class FileDict const WECHAT = 'wechat';//微信支付 - + const APPLET = 'applet';//小程序上传 /** * 获取上传的场景 @@ -62,6 +62,23 @@ class FileDict self::ALIYUN,//阿里云相关上传 self::IMAGE,//图片上传 self::VIDEO,//视频上传 + self::APPLET,//小程序包上传 + ]; + } + + const BIG = 'big'; + const MID = 'mid'; + const SMALL = 'small'; + + /** + * 缩略图规格 + * @return string[] + */ + public static function getThumbType(){ + return [ + self::BIG,//微信相关上传 + self::MID,//阿里云相关上传 + self::SMALL,//图片上传 ]; } } \ No newline at end of file diff --git a/niucloud/app/dict/sys/IconDict.php b/niucloud/app/dict/sys/IconDict.php new file mode 100644 index 000000000..9e553da5a --- /dev/null +++ b/niucloud/app/dict/sys/IconDict.php @@ -0,0 +1,31 @@ +load($system_pages); + return $pages; + } + +} \ No newline at end of file diff --git a/niucloud/app/event.php b/niucloud/app/event.php index 7b255d26f..6b32f7289 100644 --- a/niucloud/app/event.php +++ b/niucloud/app/event.php @@ -39,7 +39,8 @@ $system_event = [ //退款成功 'RefundSuccess' => [ 'app\listener\pay\RefundSuccessListener' ], //转账成功 - 'TransferSuccess' => [ 'app\listener\pay\TransferSuccessListener' ], 'SiteIndex' => [ + 'TransferSuccess' => [ 'app\listener\pay\TransferSuccessListener' ], + 'SiteIndex' => [ 'app\listener\system\SiteIndexListener' ], diff --git a/niucloud/app/install/controller/Index.php b/niucloud/app/install/controller/Index.php index 5dde6a6ae..b9751c23d 100644 --- a/niucloud/app/install/controller/Index.php +++ b/niucloud/app/install/controller/Index.php @@ -344,7 +344,7 @@ class Index extends BaseInstall ]); } //修改自增主键默认值 - Db::execute("alter table ".env('database.prefix', '')."site auto_increment = 1"); + Db::execute("alter table ".env('database.prefix', '')."site auto_increment = 100000"); //获取默认套餐 $group_id = (new SiteGroupService())->addAllMenuGroup(); diff --git a/niucloud/app/install/source/database.sql b/niucloud/app/install/source/database.sql index 5cb53e3fd..b80de1e71 100644 --- a/niucloud/app/install/source/database.sql +++ b/niucloud/app/install/source/database.sql @@ -28,6 +28,36 @@ CREATE TABLE `addon_log` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件日志表'; +DROP TABLE IF EXISTS `applet_site_version`; +CREATE TABLE `applet_site_version` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', + `version_id` int(11) NOT NULL DEFAULT '0' COMMENT '版本id', + `type` varchar(20) NOT NULL DEFAULT '' COMMENT '小程序类型', + `action` varchar(20) NOT NULL DEFAULT '' COMMENT '操作方式 download 下载 upgrade 更新', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站点小程序版本表'; + +DROP TABLE IF EXISTS `applet_version`; +CREATE TABLE `applet_version` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `config` varchar(255) NOT NULL DEFAULT '' COMMENT '配置信息', + `type` varchar(20) NOT NULL DEFAULT '' COMMENT '小程序类型', + `desc` text COMMENT '插件描述', + `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 下架 上架', + `uid` varchar(40) NOT NULL DEFAULT '' COMMENT '发布者', + `path` varchar(255) NOT NULL DEFAULT '' COMMENT '小程序包地址', + `version` varchar(20) NOT NULL DEFAULT '' COMMENT '版本号', + `version_num` varchar(20) NOT NULL DEFAULT '' COMMENT '版本号数字(用于排序)', + `release_version` varchar(20) NOT NULL DEFAULT '' COMMENT '发布线上版本号', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间', + `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', + `site_id` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小程序版本表'; + DROP TABLE IF EXISTS `article`; CREATE TABLE `article` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '文章id', @@ -88,6 +118,7 @@ CREATE TABLE `diy_page` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='自定义页面'; + DROP TABLE IF EXISTS `diy_route`; CREATE TABLE `diy_route` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -108,13 +139,13 @@ CREATE TABLE `generate_column` ( `column_name` varchar(100) NOT NULL DEFAULT '' COMMENT '字段名称', `column_comment` varchar(300) NOT NULL DEFAULT '' COMMENT '字段描述', `column_type` varchar(100) NOT NULL DEFAULT '' COMMENT '字段类型', - `is_required` tinyint(4) DEFAULT '0' COMMENT '是否必填 0-非必填 1-必填', - `is_pk` tinyint(4) DEFAULT '0' COMMENT '是否为主键 0-不是 1-是', - `is_insert` tinyint(4) DEFAULT '0' COMMENT '是否为插入字段 0-不是 1-是', - `is_update` tinyint(4) DEFAULT '0' COMMENT '是否为更新字段 0-不是 1-是', - `is_lists` tinyint(4) DEFAULT '1' COMMENT '是否为列表字段 0-不是 1-是', - `is_query` tinyint(4) DEFAULT '1' COMMENT '是否为查询字段 0-不是 1-是', - `is_search` tinyint(4) DEFAULT '1' COMMENT '是否搜索字段', + `is_required` tinyint(1) DEFAULT '0' COMMENT '是否必填 0-非必填 1-必填', + `is_pk` tinyint(1) DEFAULT '0' COMMENT '是否为主键 0-不是 1-是', + `is_insert` tinyint(1) DEFAULT '0' COMMENT '是否为插入字段 0-不是 1-是', + `is_update` tinyint(1) DEFAULT '0' COMMENT '是否为更新字段 0-不是 1-是', + `is_lists` tinyint(1) DEFAULT '1' COMMENT '是否为列表字段 0-不是 1-是', + `is_query` tinyint(1) DEFAULT '1' COMMENT '是否为查询字段 0-不是 1-是', + `is_search` tinyint(1) DEFAULT '1' COMMENT '是否搜索字段', `query_type` varchar(100) DEFAULT '=' COMMENT '查询类型', `view_type` varchar(100) DEFAULT 'input' COMMENT '显示类型', `dict_type` varchar(255) DEFAULT '' COMMENT '字典类型', @@ -140,10 +171,10 @@ CREATE TABLE `jobs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `queue` varchar(255) NOT NULL, `payload` longtext NOT NULL, - `attempts` tinyint(3) unsigned NOT NULL DEFAULT '0', - `reserve_time` int(10) unsigned DEFAULT '0', - `available_time` int(10) unsigned NOT NULL DEFAULT '0', - `create_time` int(10) unsigned NOT NULL DEFAULT '0', + `attempts` tinyint(4) unsigned NOT NULL DEFAULT '0', + `reserve_time` int(11) unsigned DEFAULT '0', + `available_time` int(11) unsigned DEFAULT '0', + `create_time` int(11) unsigned DEFAULT '0', PRIMARY KEY (`id`), KEY `queue` (`queue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息队列任务表'; @@ -350,6 +381,7 @@ CREATE TABLE `pay` ( `main_id` int(11) NOT NULL DEFAULT '0' COMMENT '支付会员id', `out_trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '支付流水号', `trade_type` varchar(255) NOT NULL DEFAULT '' COMMENT '业务类型', + `trade_id` int(11) NOT NULL DEFAULT '0' COMMENT '业务id', `trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '交易单号', `body` varchar(1000) NOT NULL DEFAULT '' COMMENT '支付主体', `money` decimal(10,2) NOT NULL COMMENT '支付金额', @@ -516,7 +548,6 @@ CREATE TABLE `recharge_order_log` ( DROP TABLE IF EXISTS `site`; CREATE TABLE `site` ( `site_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', - `site_code` varchar(32) NOT NULL DEFAULT '' COMMENT '站点code码', `site_name` varchar(50) NOT NULL DEFAULT '' COMMENT '站点名称', `group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分组ID(0:不限制)', `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字', @@ -542,9 +573,9 @@ CREATE TABLE `site` ( PRIMARY KEY (`site_id`), KEY `create_time` (`create_time`), KEY `group_id` (`group_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=1365 COMMENT='站点表'; +) ENGINE=InnoDB AUTO_INCREMENT=100000 DEFAULT CHARSET=utf8mb4 COMMENT='站点表'; -INSERT INTO `site` VALUES ('1', '11000001', 'niucloud-admin', '0', '', 'admin', '', '', '1', '', '', '0', '0', '0', '', '', '', '', '0', '0', '', '', '', '0'); +INSERT INTO `site` VALUES ('1', 'niucloud-admin', '0', '', 'admin', '', '', '1', '', '', '0', '0', '0', '', '', '', '', '0', '0', '', '', '', '0'); DROP TABLE IF EXISTS `site_account_log`; CREATE TABLE `site_account_log` ( @@ -4333,7 +4364,7 @@ CREATE TABLE `sys_menu` ( `view_path` varchar(255) NOT NULL DEFAULT '' COMMENT '菜单文件地址', `methods` varchar(10) NOT NULL DEFAULT '' COMMENT '提交方式POST GET PUT DELETE', `sort` tinyint(4) NOT NULL DEFAULT '1' COMMENT '排序', - `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '正常,禁用(禁用后不允许访问)', + `status` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '正常,禁用(禁用后不允许访问)', `is_show` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否显示', `create_time` int(11) NOT NULL DEFAULT '0', `delete_time` int(11) NOT NULL DEFAULT '0', @@ -4342,7 +4373,7 @@ CREATE TABLE `sys_menu` ( KEY `is_show` (`is_show`), KEY `menu_key` (`menu_key`,`app_type`), KEY `parent_key` (`parent_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=406 COMMENT='菜单表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='菜单表'; DROP TABLE IF EXISTS `sys_notice`; CREATE TABLE `sys_notice` ( @@ -4369,15 +4400,15 @@ CREATE TABLE `sys_notice_log` ( `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', `key` varchar(255) DEFAULT '' COMMENT '消息key', `notice_type` varchar(50) DEFAULT 'sms' COMMENT '消息类型(sms,wechat.weapp)', - `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '通知的用户id', + `uid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '通知的用户id', `member_id` int(11) NOT NULL DEFAULT '0' COMMENT '消息的会员id', `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '接收人用户昵称或姓名', `receiver` varchar(255) NOT NULL DEFAULT '' COMMENT '接收人(对应手机号,openid)', `content` text COMMENT '消息数据', - `is_click` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '点击次数', - `is_visit` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数', + `is_click` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '点击次数', + `is_visit` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数', `visit_time` int(11) NOT NULL DEFAULT '0' COMMENT '访问时间', - `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '消息时间', + `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '消息时间', `result` varchar(1000) NOT NULL DEFAULT '' COMMENT '结果', `params` text, PRIMARY KEY (`id`), @@ -4411,7 +4442,7 @@ CREATE TABLE `sys_role` ( `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', `role_name` varchar(255) NOT NULL DEFAULT '' COMMENT '角色名称', `rules` text COMMENT '角色权限(menus_id)', - `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态', + `status` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '状态', `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后修改时间', PRIMARY KEY (`role_id`), @@ -4445,11 +4476,11 @@ CREATE TABLE `sys_user` ( `password` varchar(100) NOT NULL DEFAULT '' COMMENT '用户密码', `real_name` varchar(16) NOT NULL DEFAULT '' COMMENT '实际姓名', `last_ip` varchar(16) NOT NULL DEFAULT '' COMMENT '最后一次登录ip', - `last_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后一次登录时间', - `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', - `login_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数', - `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '后台管理员状态 1有效0无效', - `is_del` tinyint(3) unsigned NOT NULL DEFAULT '0', + `last_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后一次登录时间', + `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', + `login_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数', + `status` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '后台管理员状态 1有效0无效', + `is_del` tinyint(4) unsigned NOT NULL DEFAULT '0', `delete_time` tinyint(4) NOT NULL DEFAULT '0' COMMENT '删除时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`uid`), @@ -4458,7 +4489,7 @@ CREATE TABLE `sys_user` ( KEY `is_del` (`is_del`), KEY `password` (`password`), KEY `update_time` (`update_time`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=372 COMMENT='后台管理员表'; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='后台管理员表'; INSERT INTO `sys_user` VALUES ('1', '', '', '', '', '', '0', '0', '0', '1', '0', '0', '0'); @@ -4467,12 +4498,12 @@ CREATE TABLE `sys_user_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员操作记录ID', `ip` varchar(16) NOT NULL DEFAULT '' COMMENT '登录IP', `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', - `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员id', + `uid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '管理员id', `username` varchar(64) NOT NULL DEFAULT '' COMMENT '管理员姓名', `url` varchar(128) NOT NULL DEFAULT '' COMMENT '链接', `params` text COMMENT '参数', `type` varchar(32) NOT NULL DEFAULT '' COMMENT '请求方式', - `create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '操作时间', + `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作时间', PRIMARY KEY (`id`), KEY `create_time` (`create_time`), KEY `site_id` (`site_id`), @@ -4491,7 +4522,7 @@ CREATE TABLE `sys_user_role` ( KEY `create_time` (`create_time`), KEY `site_id` (`site_id`), KEY `uid` (`uid`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=481 COMMENT='用户权限表'; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户权限表'; INSERT INTO `sys_user_role` VALUES ('1', '1', '0', '', '0', '1'); @@ -4542,11 +4573,11 @@ CREATE TABLE `wechat_reply` ( `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '站点id', `keyword` varchar(64) NOT NULL DEFAULT '' COMMENT '关键词', `reply_type` tinyint(4) NOT NULL COMMENT '回复类型 subscribe-关注回复 keyword-关键字回复 default-默认回复', - `matching_type` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '匹配方式:1-全匹配;2-模糊匹配', - `content_type` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '内容类型:1-文本', + `matching_type` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '匹配方式:1-全匹配;2-模糊匹配', + `content_type` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '内容类型:1-文本', `content` text NOT NULL COMMENT '回复内容', - `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '启动状态:1-启动;0-关闭', - `sort` int(10) unsigned NOT NULL DEFAULT '50' COMMENT '排序', + `status` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '启动状态:1-启动;0-关闭', + `sort` int(11) unsigned NOT NULL DEFAULT '50' COMMENT '排序', `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间', diff --git a/niucloud/app/install/view/index/step-4.html b/niucloud/app/install/view/index/step-4.html index e2eaa9306..094f05a1b 100644 --- a/niucloud/app/install/view/index/step-4.html +++ b/niucloud/app/install/view/index/step-4.html @@ -44,13 +44,13 @@ 站点后台 - -