项目初始化
This commit is contained in:
1
addons/version/.addonrc
Normal file
1
addons/version/.addonrc
Normal file
@@ -0,0 +1 @@
|
||||
{"files":["application\/admin\/controller\/Version.php","application\/admin\/lang\/zh-cn\/version.php","application\/admin\/view\/version\/index.html","application\/admin\/view\/version\/edit.html","application\/admin\/view\/version\/add.html","public\/assets\/js\/backend\/version.js"],"license":"regular","licenseto":"101612","licensekey":"bnPgkHIilzdxRyCQ 1MO2oi0mP3Ma5y6e24Vp0w==","domains":["45.221"],"licensecodes":[],"validations":["01aa56d41a1a59da181975a3a6c82078"],"menus":["version","version\/index","version\/add","version\/edit","version\/del","version\/multi"]}
|
||||
65
addons/version/Version.php
Normal file
65
addons/version/Version.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace addons\version;
|
||||
|
||||
use app\common\library\Menu;
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* 版本管理插件
|
||||
*/
|
||||
class Version extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
$menu = [
|
||||
[
|
||||
'name' => 'version',
|
||||
'title' => '版本管理',
|
||||
'icon' => 'fa fa-file-text-o',
|
||||
'remark' => '常用于管理移动端应用版本更新',
|
||||
'sublist' => [
|
||||
['name' => 'version/index', 'title' => '查看'],
|
||||
['name' => 'version/add', 'title' => '添加'],
|
||||
['name' => 'version/edit', 'title' => '修改'],
|
||||
['name' => 'version/del', 'title' => '删除'],
|
||||
['name' => 'version/multi', 'title' => '批量更新'],
|
||||
]
|
||||
]
|
||||
];
|
||||
Menu::create($menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
Menu::delete('version');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件启用方法
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
Menu::enable('version');
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件禁用方法
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
Menu::disable('version');
|
||||
}
|
||||
|
||||
}
|
||||
4
addons/version/config.php
Normal file
4
addons/version/config.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
16
addons/version/controller/Index.php
Normal file
16
addons/version/controller/Index.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace addons\version\controller;
|
||||
|
||||
use think\addons\Controller;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error("当前插件暂无前台页面");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
10
addons/version/info.ini
Normal file
10
addons/version/info.ini
Normal file
@@ -0,0 +1,10 @@
|
||||
name = version
|
||||
title = 版本管理
|
||||
intro = 版本管理插件
|
||||
author = FastAdmin
|
||||
website = http://www.fastadmin.net
|
||||
version = 1.0.4
|
||||
state = 1
|
||||
url = /addons/version
|
||||
license = regular
|
||||
licenseto = 101612
|
||||
20
addons/version/install.sql
Normal file
20
addons/version/install.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `__PREFIX__version` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`oldversion` varchar(30) DEFAULT '' COMMENT '旧版本号',
|
||||
`newversion` varchar(30) DEFAULT '' COMMENT '新版本号',
|
||||
`packagesize` varchar(30) DEFAULT '' COMMENT '包大小',
|
||||
`content` varchar(500) DEFAULT '' COMMENT '升级内容',
|
||||
`downloadurl` varchar(255) DEFAULT '' COMMENT '下载地址',
|
||||
`enforce` tinyint(1) UNSIGNED DEFAULT '0' COMMENT '强制更新',
|
||||
`createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
|
||||
`updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
|
||||
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
|
||||
`status` varchar(30) DEFAULT '' COMMENT '状态',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='版本表';
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO `__PREFIX__version` (`id`, `oldversion`, `newversion`, `packagesize`, `content`, `downloadurl`, `enforce`, `createtime`, `updatetime`, `weigh`, `status`) VALUES
|
||||
(1, '1.1.1,2', '1.2.1', '20M', '更新内容', 'https://www.example.com', 1, 1520425318, 0, 0, 'normal');
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user