From 8fa5cc82e84cf5a58cda1c7288745c821486d5d6 Mon Sep 17 00:00:00 2001 From: Karson Date: Tue, 27 Mar 2018 17:39:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EAPI=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=85=8D=E7=BD=AE=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A6=96=E9=A1=B5=E7=99=BB=E5=BD=95=E5=85=8D?= =?UTF-8?q?=E8=B4=B9=E6=8F=92=E4=BB=B6=E4=B8=8B=E8=BD=BD=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8DCRUD=E9=BB=98=E8=AE=A4=E7=94=9F=E6=88=90Se?= =?UTF-8?q?lectpage=E8=AF=B7=E6=B1=82=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84BUG=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E5=8F=B0=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9C=AA=E5=8A=A0=E8=BD=BDfrontend-init.js=E7=9A=84BU?= =?UTF-8?q?G=20=E4=BC=98=E5=8C=96=E9=BB=98=E8=AE=A4=E5=85=B3=E9=97=ADDEBUG?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8=EF=BC=8C=E7=8E=B0=E6=94=AF?= =?UTF-8?q?=E6=8C=81https=E8=AF=B7=E6=B1=82=20=E4=BC=98=E5=8C=96=E7=AB=99?= =?UTF-8?q?=E5=86=85FastAdmin=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAhttps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 +++--- .../admin/command/Addon/stubs/info.stub | 2 +- application/admin/command/Api.php | 4 +- .../admin/command/Api/template/index.html | 4 +- .../admin/command/Install/fastadmin.sql | 6 +- application/admin/controller/Addon.php | 2 +- application/admin/controller/Dashboard.php | 6 ++ application/admin/controller/auth/Admin.php | 2 +- application/admin/controller/user/User.php | 2 +- application/admin/lang/zh-cn.php | 2 +- application/admin/lang/zh-cn/addon.php | 3 +- application/admin/lang/zh-cn/auth/rule.php | 2 +- application/admin/lang/zh-cn/dashboard.php | 79 ++++++++++--------- application/admin/library/traits/Backend.php | 2 +- application/admin/view/addon/index.html | 6 +- application/admin/view/common/header.html | 6 +- application/admin/view/common/menu.html | 4 +- application/admin/view/dashboard/index.html | 34 +++++--- application/admin/view/index/index.html | 2 +- application/admin/view/index/login.html | 2 +- application/common/controller/Api.php | 8 ++ application/common/view/tpl/dispatch_jump.tpl | 2 +- application/config.php | 6 +- application/index/controller/Index.php | 2 +- application/index/view/index/index.html | 20 ++--- application/index/view/layout/common.html | 20 ++--- application/index/view/layout/default.html | 18 ++--- public/api.html | 4 +- public/assets/js/backend/addon.js | 10 +-- public/assets/js/backend/dashboard.js | 8 +- public/assets/js/backend/index.js | 43 +++++++++- public/assets/js/frontend/user.js | 1 + public/assets/js/require-frontend.js | 2 +- public/assets/js/require-frontend.min.js | 2 +- public/install.php | 1 + 35 files changed, 201 insertions(+), 138 deletions(-) diff --git a/README.md b/README.md index 9025d314..7cf44c77 100644 --- a/README.md +++ b/README.md @@ -7,18 +7,20 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。 * 基于`Auth`验证的权限管理系统 * 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置 * 支持单管理员多角色 - * 支持目录和控制器结构一键生成权限节点 * 支持管理子级数据或个人数据 +* 强大的一键生成功能 + * 一键生成CRUD,包括控制器、模型、视图、JS、语言包、菜单等 + * 一键压缩打包JS和CSS文件,一键CDN静态资源部署 + * 一键生成控制器菜单和规则 + * 一键生成API接口文档 * 完善的前端功能组件开发 * 基于`AdminLTE`二次开发 * 基于`Bootstrap`开发,自适应手机、平板、PC * 基于`RequireJS`进行JS模块管理,按需加载 * 基于`Less`进行样式开发 * 基于`Bower`进行前端组件包管理 -* 数据库表一键生成`CRUD`,包括控制器、模型、视图、JS、语言包、菜单等 -* 一键压缩打包JS和CSS文件,一键CDN静态资源部署 -* 一键生成API接口文档 * 强大的插件扩展功能,在线安装卸载升级插件 +* 通用的会员模块和API模块 * 共用同一账号体系的Web端会员中心权限验证和API接口会员权限验证 * 二级域名部署支持,同时域名支持绑定到插件 * 多语言支持,服务端及客户端支持 @@ -26,15 +28,15 @@ FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。 * 整合第三方短信接口(阿里云、创蓝短信) * 无缝整合第三方云存储(七牛、阿里云OSS、又拍云)功能 * 第三方登录(QQ、微信、微博)整合 -* Ucenter整合 +* Ucenter整合第三方应用 ## **安装使用** -http://doc.fastadmin.net +https://doc.fastadmin.net ## **在线演示** -http://demo.fastadmin.net +https://demo.fastadmin.net 用户名:admin @@ -49,9 +51,9 @@ http://demo.fastadmin.net 在使用中有任何问题,请使用以下联系方式联系我们 -交流社区: http://forum.fastadmin.net +交流社区: https://forum.fastadmin.net -QQ群: [636393962](https://jq.qq.com/?_wv=1027&k=487PNBb) +QQ群: [636393962](https://jq.qq.com/?_wv=1027&k=487PNBb)(交流群) [696992864](https://jq.qq.com/?_wv=1027&k=5R2AB00)(高级群,付费加入) Email: (karsonzhang#163.com, 把#换成@) @@ -80,6 +82,6 @@ FastAdmin遵循Apache2开源协议发布,并提供免费使用。 本项目包含的第三方源码和二进制文件之版权信息另行标注。 -版权所有Copyright © 2017-2018 by FastAdmin (http://www.fastadmin.net) +版权所有Copyright © 2017-2018 by FastAdmin (https://www.fastadmin.net) All rights reserved。 \ No newline at end of file diff --git a/application/admin/command/Addon/stubs/info.stub b/application/admin/command/Addon/stubs/info.stub index 5df77040..a6a3496f 100644 --- a/application/admin/command/Addon/stubs/info.stub +++ b/application/admin/command/Addon/stubs/info.stub @@ -2,6 +2,6 @@ name = {%name%} title = 插件名称{%name%} intro = FastAdmin插件 author = yourname -website = http://www.fastadmin.net +website = https://www.fastadmin.net version = 1.0.0 state = 1 \ No newline at end of file diff --git a/application/admin/command/Api.php b/application/admin/command/Api.php index 57cdfff1..e5b473af 100755 --- a/application/admin/command/Api.php +++ b/application/admin/command/Api.php @@ -75,10 +75,10 @@ class Api extends Command $directives = $configuration['directives']; $configName = request()->isCli() ? 'opcache.enable_cli' : 'opcache.enable'; if (!$directives[$configName]) { - throw new Exception("Please make sure {$configName} is turned on, Get help:http://forum.fastadmin.net/d/1321"); + throw new Exception("Please make sure {$configName} is turned on, Get help:https://forum.fastadmin.net/d/1321"); } } else { - throw new Exception("Please make sure opcache already enabled, Get help:http://forum.fastadmin.net/d/1321"); + throw new Exception("Please make sure opcache already enabled, Get help:https://forum.fastadmin.net/d/1321"); } } diff --git a/application/admin/command/Api/template/index.html b/application/admin/command/Api/template/index.html index 0f545a79..ca21bbd2 100755 --- a/application/admin/command/Api/template/index.html +++ b/application/admin/command/Api/template/index.html @@ -33,7 +33,7 @@ - {$config.title} + {$config.title}
- FastAdmin + FastAdmin
diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 50610976..c80adfe2 100755 --- a/application/admin/command/Install/fastadmin.sql +++ b/application/admin/command/Install/fastadmin.sql @@ -1,8 +1,8 @@ /* FastAdmin Install SQL - 官网: http://www.fastadmin.net - 演示: http://demo.fastadmin.net + 官网: https://www.fastadmin.net + 演示: https://demo.fastadmin.net Date: 2018年03月07日 */ @@ -564,6 +564,6 @@ CREATE TABLE `fa_version` ( -- ---------------------------- BEGIN; INSERT INTO `fa_version` (`id`, `oldversion`, `newversion`, `packagesize`, `content`, `downloadurl`, `enforce`, `createtime`, `updatetime`, `weigh`, `status`) VALUES -(1, '1.1.1,2', '1.2.1', '20M', '更新内容', 'http://www.fastadmin.net/download.html', 1, 1520425318, 0, 0, 'normal'); +(1, '1.1.1,2', '1.2.1', '20M', '更新内容', 'https://www.fastadmin.net/download.html', 1, 1520425318, 0, 0, 'normal'); COMMIT; SET FOREIGN_KEY_CHECKS = 1; diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index 4f2f5a6a..89b81835 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -13,7 +13,7 @@ use think\Exception; * 插件管理 * * @icon fa fa-circle-o - * @remark 可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:http://www.fastadmin.net/store.html + * @remark 可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:https://www.fastadmin.net/store.html */ class Addon extends Backend { diff --git a/application/admin/controller/Dashboard.php b/application/admin/controller/Dashboard.php index ccb215e8..4175baf8 100644 --- a/application/admin/controller/Dashboard.php +++ b/application/admin/controller/Dashboard.php @@ -3,6 +3,7 @@ namespace app\admin\controller; use app\common\controller\Backend; +use think\Config; /** * 控制台 @@ -28,6 +29,10 @@ class Dashboard extends Backend } $hooks = config('addons.hooks'); $uploadmode = isset($hooks['upload_config_init']) && $hooks['upload_config_init'] ? implode(',', $hooks['upload_config_init']) : 'local'; + $addonComposerCfg = ROOT_PATH . '/vendor/karsonzhang/fastadmin-addons/composer.json'; + Config::parse($addonComposerCfg, "json", "composer"); + $config = Config::get("composer"); + $addonVersion = isset($config['version']) ? $config['version'] : __('Unknown'); $this->view->assign([ 'totaluser' => 35200, 'totalviews' => 219390, @@ -41,6 +46,7 @@ class Dashboard extends Backend 'sevendau' => '32%', 'paylist' => $paylist, 'createlist' => $createlist, + 'addonversion' => $addonVersion, 'uploadmode' => $uploadmode ]); diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index c3747b5d..4b53f7bf 100644 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -70,7 +70,7 @@ class Admin extends Backend if ($this->request->isAjax()) { //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('pkey_name')) + if ($this->request->request('keyField')) { return $this->selectpage(); } diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index c86e12b2..ffde4d1a 100644 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -35,7 +35,7 @@ class User extends Backend if ($this->request->isAjax()) { //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('pkey_name')) + if ($this->request->request('keyField')) { return $this->selectpage(); } diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index 2f0c4c11..483fd47f 100755 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -164,7 +164,7 @@ return [ 'Config tips' => '可以在此增改系统的变量和分组,也可以自定义分组和变量,如果需要删除请从数据库中删除', 'Category tips' => '用于统一管理网站的所有分类,分类可进行无限级分类', 'Attachment tips' => '主要用于管理上传到服务器或第三方存储的数据', - 'Addon tips' => '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:http://www.fastadmin.net/store.html', + 'Addon tips' => '可在线安装、卸载、禁用、启用插件,同时支持添加本地插件。FastAdmin已上线插件商店 ,你可以发布你的免费或付费插件:https://www.fastadmin.net/store.html', 'Admin tips' => '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', 'Admin log tips' => '管理员可以查看自己所拥有的权限的管理员日志', 'Group tips' => '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别的下级角色组或管理员', diff --git a/application/admin/lang/zh-cn/addon.php b/application/admin/lang/zh-cn/addon.php index c00f1527..9a8da324 100755 --- a/application/admin/lang/zh-cn/addon.php +++ b/application/admin/lang/zh-cn/addon.php @@ -14,9 +14,8 @@ return [ 'Userinfo' => '会员信息', 'Online store' => '在线商店', 'Local addon' => '本地插件', - 'Https tips' => '当前你无法在插件管理中在线安装FastAdmin市场中的插件,请前往 FastAdmin插件市场 中下载后进行离线安装。', 'Conflict tips' => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作', - 'Login tips' => '此处登录账号为FastAdmin官网账号', + 'Login tips' => '此处登录账号为FastAdmin官网账号', 'Logined tips' => '你好!%s
当前你已经登录,将同步保存你的购买记录', 'Pay tips' => '支付完成后请稍等1~5分钟后再尝试安装,请不要重复支付,如果仍然无法安装,请加QQ群:636393962向管理员反馈', 'Pay click tips' => '请点击这里在新窗口中进行支付!', diff --git a/application/admin/lang/zh-cn/auth/rule.php b/application/admin/lang/zh-cn/auth/rule.php index ce973a0e..f08139cd 100644 --- a/application/admin/lang/zh-cn/auth/rule.php +++ b/application/admin/lang/zh-cn/auth/rule.php @@ -13,6 +13,6 @@ return [ 'Menu tips' => '规则任意,不可重复,仅做层级显示,无需匹配控制器和方法', 'Node tips' => '控制器/方法名', 'The non-menu rule must have parent' => '非菜单规则节点必须有父级', - 'If not necessary, use the command line to build rule' => '非必要情况下请直接使用命令行php think menu来生成', + 'If not necessary, use the command line to build rule' => '非必要情况下请直接使用命令行php think menu来生成', 'Name only supports letters, numbers, underscore and slash' => 'URL规则只能是小写字母、数字、下划线和/组成', ]; diff --git a/application/admin/lang/zh-cn/dashboard.php b/application/admin/lang/zh-cn/dashboard.php index 113ce344..6dc97710 100644 --- a/application/admin/lang/zh-cn/dashboard.php +++ b/application/admin/lang/zh-cn/dashboard.php @@ -1,42 +1,45 @@ '自定义', - 'Pid' => '父ID', - 'Type' => '栏目类型', - 'Image' => '图片', - 'Total user' => '总会员数', - 'Total view' => '总访问数', - 'Total order' => '总订单数', - 'Total order amount' => '总金额', - 'Today user signup' => '今日注册', - 'Today user login' => '今日登录', - 'Today order' => '今日订单', - 'Unsettle order' => '未处理订单', - 'Seven dnu' => '七日新增', - 'Seven dau' => '七日活跃', - 'Custom zone' => '这里是你的自定义数据', - 'Sales' => '成交数', - 'Orders' => '订单数', - 'Real time' => '实时', - 'Category count' => '分类统计', - 'Category count tips' => '当前分类总记录数', - 'Attachment count' => '附件统计', - 'Attachment count tips' => '当前上传的附件数量', - 'Article count' => '文章统计', - 'News count' => '新闻统计', - 'Comment count' => '评论次数', - 'Like count' => '点赞次数', - 'Recent news' => '最新新闻', - 'Recent discussion' => '最新发贴', - 'Server info' => '服务器信息', - 'PHP version' => 'PHP版本', - 'Fastadmin version' => 'FastAdmin版本', - 'Sapi name' => '运行方式', - 'Debug mode' => '调试模式', - 'Software' => '环境信息', - 'Upload mode' => '上传模式', - 'Upload url' => '上传URL', - 'Timezone' => '时区', - 'Language' => '语言', + 'Custom' => '自定义', + 'Pid' => '父ID', + 'Type' => '栏目类型', + 'Image' => '图片', + 'Total user' => '总会员数', + 'Total view' => '总访问数', + 'Total order' => '总订单数', + 'Total order amount' => '总金额', + 'Today user signup' => '今日注册', + 'Today user login' => '今日登录', + 'Today order' => '今日订单', + 'Unsettle order' => '未处理订单', + 'Seven dnu' => '七日新增', + 'Seven dau' => '七日活跃', + 'Custom zone' => '这里是你的自定义数据', + 'Sales' => '成交数', + 'Orders' => '订单数', + 'Real time' => '实时', + 'Category count' => '分类统计', + 'Category count tips' => '当前分类总记录数', + 'Attachment count' => '附件统计', + 'Attachment count tips' => '当前上传的附件数量', + 'Article count' => '文章统计', + 'News count' => '新闻统计', + 'Comment count' => '评论次数', + 'Like count' => '点赞次数', + 'Recent news' => '最新新闻', + 'Recent discussion' => '最新发贴', + 'Server info' => '服务器信息', + 'PHP version' => 'PHP版本', + 'Fastadmin version' => 'FastAdmin版本', + 'Fastadmin addon version' => 'FastAdmin插件版本', + 'Sapi name' => '运行方式', + 'Debug mode' => '调试模式', + 'Software' => '环境信息', + 'Upload mode' => '上传模式', + 'Upload url' => '上传URL', + 'Upload cdn url' => '上传CDN', + 'Cdn url' => '静态资源CDN', + 'Timezone' => '时区', + 'Language' => '语言', ]; diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index 37087670..cb9ed04c 100755 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -15,7 +15,7 @@ trait Backend if ($this->request->isAjax()) { //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('pkey_name')) + if ($this->request->request('keyField')) { return $this->selectpage(); } diff --git a/application/admin/view/addon/index.html b/application/admin/view/addon/index.html index 9015ff1f..c7e6db56 100644 --- a/application/admin/view/addon/index.html +++ b/application/admin/view/addon/index.html @@ -17,10 +17,6 @@ background:#d2d6de; } -
- - {:__('Warning')} {:__('Https tips')} -
{:build_heading()} @@ -107,7 +103,7 @@ {:__('Homepage')} - http://www.fastadmin.net/store/<%=item.name%>.html + https://www.fastadmin.net/store/<%=item.name%>.html {:__('Intro')} diff --git a/application/admin/view/common/header.html b/application/admin/view/common/header.html index 430969ea..29ffba25 100755 --- a/application/admin/view/common/header.html +++ b/application/admin/view/common/header.html @@ -90,13 +90,13 @@
  • diff --git a/application/admin/view/common/menu.html b/application/admin/view/common/menu.html index 2d18375f..8dcec7ac 100644 --- a/application/admin/view/common/menu.html +++ b/application/admin/view/common/menu.html @@ -30,8 +30,8 @@ diff --git a/application/admin/view/dashboard/index.html b/application/admin/view/dashboard/index.html index 1490e5b6..d9ee7ec6 100644 --- a/application/admin/view/dashboard/index.html +++ b/application/admin/view/dashboard/index.html @@ -336,7 +336,7 @@

    {:__('Recent news')}

    @@ -349,7 +349,7 @@

    {:__('Recent discussion')}

    @@ -364,39 +364,47 @@ - - + + - - + + - + - + - + - + - + - + + + + + - + + + + +
    {:__('PHP version')}{$Think.const.PHP_VERSION}{:__('FastAdmin version')}{$Think.config.fastadmin.version} 检查最新版
    {:__('FastAdmin version')}{$Think.config.fastadmin.version}{:__('FastAdmin addon version')}{$addonversion}
    {:__('Sapi name')}{:__('Sapi name')} {:php_sapi_name()}
    {:__('Debug mode')}{:__('Debug mode')} {$Think.config.app_debug?__('Yes'):__('No')}
    {:__('Software')}{:__('Software')} {$Think.server.SERVER_SOFTWARE}
    {:__('Upload mode')}{:__('Upload mode')} {$uploadmode}
    {:__('Upload url')}{:__('Upload url')} {$config.upload.uploadurl}
    {:__('Timezone')}{:__('Upload Cdn url')}{$config.upload.cdnurl}
    {:__('Timezone')} {:date_default_timezone_get()}
    {:__('Language')}{:__('Cdn url')}__CDN__
    {:__('Language')} {$config.language}
    diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html index 1dd94b91..6f9a394a 100644 --- a/application/admin/view/index/index.html +++ b/application/admin/view/index/index.html @@ -22,7 +22,7 @@
    - Copyright © 2017-2018 Fastadmin. All rights + Copyright © 2017-2018 Fastadmin. All rights reserved.
    diff --git a/application/admin/view/index/login.html b/application/admin/view/index/login.html index 0a298cce..9746acd3 100644 --- a/application/admin/view/index/login.html +++ b/application/admin/view/index/login.html @@ -97,7 +97,7 @@
    - +
    diff --git a/application/common/controller/Api.php b/application/common/controller/Api.php index 46122a46..2acc2307 100644 --- a/application/common/controller/Api.php +++ b/application/common/controller/Api.php @@ -130,6 +130,14 @@ class Api $this->auth->init($token); } } + + $upload = \app\common\model\Config::upload(); + + // 上传信息配置后 + Hook::listen("upload_config_init", $upload); + + Config::set('upload', array_merge(Config::get('upload'), $upload)); + // 加载当前控制器语言包 $this->loadlang($controllername); } diff --git a/application/common/view/tpl/dispatch_jump.tpl b/application/common/view/tpl/dispatch_jump.tpl index c6b3878d..81809335 100755 --- a/application/common/view/tpl/dispatch_jump.tpl +++ b/application/common/view/tpl/dispatch_jump.tpl @@ -42,7 +42,7 @@