addons
This commit is contained in:
parent
b147198b0c
commit
a54e206e00
@ -26,7 +26,7 @@ class Addons extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件列表
|
||||
* 插件动态列表
|
||||
* @return Json
|
||||
*/
|
||||
public function addonsList()
|
||||
@ -57,10 +57,10 @@ class Addons extends AdminController
|
||||
['field'=> 'version','title'=> '版本', 'templet' => '<div>{{d.version}}</div>', 'width'=> 60],
|
||||
['field' => 'author','title'=> '作者', 'width'=> 80],
|
||||
['field' => 'description','title'=> '简介', 'minWidth'=> 200],
|
||||
['field' => 'show','title'=> '状态', 'width'=> 100],
|
||||
['field' => 'install','title'=> '安装', 'width'=> 100],
|
||||
['field' => 'ctime','title'=> '到期时间', 'width'=> 100],
|
||||
['title' => '操作', 'width'=> 200, 'align'=>'center', 'toolbar'=> '#addons-installed-tool']
|
||||
['field' => 'status','title'=> '状态', 'width'=> 95, 'templet' => '#buttonStatus'],
|
||||
['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-installed-tool']
|
||||
];
|
||||
} else {
|
||||
$res = ['code'=>-1,'msg'=>'没有安装任何插件'];
|
||||
@ -119,10 +119,10 @@ class Addons extends AdminController
|
||||
['field' => 'title','title'=> '插件', 'width'=> 200],
|
||||
['field' => 'description','title'=> '简介', 'minWidth'=> 200],
|
||||
['field' => 'author','title'=> '作者', 'width'=> 100],
|
||||
['field' => 'price','title'=> '价格(元)','width'=> 80],
|
||||
['field' => 'price','title'=> '价格(元)','width'=> 85],
|
||||
['field' => 'downloads','title'=> '下载', 'width'=> 70],
|
||||
['field' => 'version','title'=> '版本', 'templet' => '<div>{{d.version}} {{# if(d.have_newversion == 1){ }}<span class="layui-badge-dot"></span>{{# } }}</div>','width'=> 70],
|
||||
['field' => 'status','title'=> '状态', 'width'=> 70],
|
||||
['field' => 'version','title'=> '版本', 'templet' => '<div>{{d.version}} {{# if(d.have_newversion == 1){ }}<span class="layui-badge-dot"></span>{{# } }}</div>','width'=> 75],
|
||||
['field' => 'status','title'=> '在线', 'width'=> 70],
|
||||
['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool']
|
||||
];
|
||||
} else {
|
||||
@ -151,34 +151,6 @@ class Addons extends AdminController
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑版本
|
||||
* @param $id
|
||||
* @return string|Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$addons = AddonsModel::find($id);
|
||||
|
||||
if(Request::isAjax()){
|
||||
$data = Request::only(['id','addons_name','addons_version','addons_auther','addons_resume','addons_price','addons_src']);
|
||||
$result = $addons->where('id',$id)->save($data);
|
||||
if($result){
|
||||
$res = ['code'=>0,'msg'=>'编辑成功'];
|
||||
}else{
|
||||
$res = ['code'=>-1,'msg'=>'编辑失败'];
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
View::assign('addons',$addons);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
@ -219,17 +191,22 @@ class Addons extends AdminController
|
||||
return $this->uploadFiles($type);
|
||||
}
|
||||
|
||||
//安装插件
|
||||
/**
|
||||
* 安装插件
|
||||
* @return Json
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
$data = Request::param();
|
||||
$url = $this->getSystem()['api_url'].'/v1/getaddons';
|
||||
$data = ['name'=>$data['name'], 'version'=>$data['version'], 'uid'=>$data['uid'], 'token'=>$data['token']];
|
||||
$addons = Api::urlPost($url,$data);
|
||||
if( $addons->code == -1) {
|
||||
if( $addons->code < 0) {
|
||||
return json(['code'=>$addons->code,'msg'=>$addons->msg]);
|
||||
}
|
||||
//是否安装?
|
||||
//$this->pay($name,$extend);
|
||||
//版本判断,是否能够安装?
|
||||
$addInstalledVersion = get_addons_info($data['name']);
|
||||
if(!empty($addInstalledVersion)){
|
||||
$verRes = version_compare($data['version'],$addInstalledVersion['version'],'>');
|
||||
@ -325,7 +302,6 @@ class Addons extends AdminController
|
||||
$menu = get_addons_menu($name);
|
||||
if(!empty($menu)){
|
||||
$menu_arr[] = $menu['menu'];
|
||||
// halt( $menu_arr);
|
||||
$this->delAddonMenu($menu_arr);
|
||||
}
|
||||
|
||||
@ -361,7 +337,11 @@ class Addons extends AdminController
|
||||
return json(['code' => 0, 'msg' => '插件卸载成功']);
|
||||
}
|
||||
|
||||
// 启用禁用插件
|
||||
/**
|
||||
* 启用禁用插件
|
||||
* @return Json
|
||||
* @throws Exception
|
||||
*/
|
||||
public function status(){
|
||||
$name = input('name');
|
||||
$info = get_addons_info($name);
|
||||
@ -381,8 +361,13 @@ class Addons extends AdminController
|
||||
|
||||
return json($res);
|
||||
}
|
||||
|
||||
//配置插件
|
||||
|
||||
/**
|
||||
* 配置插件
|
||||
* @param $name
|
||||
* @return string|Json
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function config($name)
|
||||
{
|
||||
$name = input('name');
|
||||
@ -426,6 +411,14 @@ class Addons extends AdminController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单
|
||||
* @param array $menu
|
||||
* @param int $pid
|
||||
* @param int $type
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function addAddonMenu(array $menu,int $pid = 0, int $type = 1)
|
||||
{
|
||||
foreach ($menu as $v){
|
||||
@ -451,7 +444,13 @@ class Addons extends AdminController
|
||||
|
||||
}
|
||||
|
||||
//循环删除菜单
|
||||
/**
|
||||
* 循环删除菜单
|
||||
* @param array $menu
|
||||
* @param string $module
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function delAddonMenu(array $menu,string $module = 'addon')
|
||||
{
|
||||
foreach ($menu as $k=>$v){
|
||||
@ -473,6 +472,10 @@ class Addons extends AdminController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @return mixed|Json
|
||||
*/
|
||||
public function userLogin()
|
||||
{
|
||||
$data = Request::param();
|
||||
@ -485,4 +488,44 @@ class Addons extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单
|
||||
* @return string|Json
|
||||
*/
|
||||
public function pay()
|
||||
{
|
||||
$data = Request::only(['id','name','version','uid','price']);
|
||||
$url = $this->getSystem()['api_url'].'/v1/createOrder';
|
||||
$order = Api::urlPost($url,$data);
|
||||
|
||||
if ($order->code == 0) {
|
||||
$orderData = json_decode(json_encode($order->data),TRUE);
|
||||
View::assign('orderData',$orderData);
|
||||
return View::fetch();
|
||||
} else {
|
||||
return json(['code'=>-1,'msg'=>$order->msg]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付查询
|
||||
* @return Json
|
||||
*/
|
||||
public function isPay()
|
||||
{
|
||||
$param = Request::only(['name','userinfo']);
|
||||
//halt($data);
|
||||
$data = [
|
||||
'name'=>$param['name'],
|
||||
'uid'=> $param['userinfo']['uid'],
|
||||
];
|
||||
$url = $this->getSystem()['api_url'].'/v1/ispay';
|
||||
$res = Api::urlPost($url,$data);
|
||||
if($res->code == 0) {
|
||||
return json(['code'=>0,'msg'=>'payed']);
|
||||
} else {
|
||||
return json(['code'=>-1,'msg'=>'no pay']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,30 +3,18 @@
|
||||
{block name="body"}
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">插件分类</div>
|
||||
<div class="layui-inline">
|
||||
<select name="id" lay-filter="LAY-user-adminrole-type">
|
||||
<option value="">全部插件</option>
|
||||
<option value="">支付</option>
|
||||
<option value="">第三方登陆</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<table id="addons-list" lay-filter="addons-list"></table>
|
||||
|
||||
<script type="text/html" id="toolbar">
|
||||
<div class="layui-btn-group" style="padding-bottom: 10px;">
|
||||
<a href="#denable" type="button" class="layui-btn layui-btn-sm" lay-event="allAddons">全部</a>
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-event="freeAddons">免费</button>
|
||||
<button type="button" class="layui-btn layui-btn-sm" lay-event="payAddons">付费</button>
|
||||
<a href="#enable" type="button" class="layui-btn layui-btn-sm" lay-event="installed">已安装</a>
|
||||
<a type="button" class="layui-btn layui-btn-sm" lay-event="freeAddons">免费</a>
|
||||
<a type="button" class="layui-btn layui-btn-sm" lay-event="payAddons">付费</a>
|
||||
<a href="#enable" type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="installed">已安装</a>
|
||||
</div>
|
||||
<div class="layui-btn-group" style="padding-bottom: 10px;">
|
||||
<button class="layui-btn layui-btn-sm layuiadmin-btn-admin" data-type="add">离线安装</button>
|
||||
<button class="layui-btn layui-btn-danger layui-btn-sm layuiadmin-btn-admin" data-type="add">离线安装</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="addons-tool">
|
||||
@ -36,7 +24,7 @@
|
||||
{{# if(d.isInstall ===1) { }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="config" data-url="{:url('Addons/config')}"><i class="layui-icon layui-icon-set"></i>设置</a>
|
||||
{{# } else { }}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="install" data-url="{:url('Addons/install')}" data-userlogin="{:url('Addons/userLogin')}"><i class="layui-icon layui-icon-edit"></i>安装</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="install" data-url="{:url('Addons/install')}" data-userlogin="{:url('Addons/userLogin')}" data-ispay="{:url('Addons/isPay')}"><i class="layui-icon layui-icon-edit"></i>安装</a>
|
||||
<select id="vers{{d.name}}" name="sss" class="layui-border" lay-ignore lay-filter="versSelect">
|
||||
{{# d.vers.forEach(function(item, index){ }}
|
||||
<option value="{{ item }}">{{ item }}</option>
|
||||
@ -45,28 +33,22 @@
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</script>
|
||||
<script type="text/html" id="buttonStatus">
|
||||
<input type="checkbox" name="{{d.name}}" lay-skin="switch" lay-filter="addonsStatus" lay-text="启动|禁用" {{# if(d.status == 1){ }} checked {{# } }} data-url="{:url('Addons/status')}">
|
||||
</script>
|
||||
<script type="text/html" id="addons-installed-tool">
|
||||
{{# if(d.status == 1){ }}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="status" data-url="{:url('Addons/status')}"><i class="layui-icon layui-icon-pause"></i>禁用</a>
|
||||
{{# } else { }}
|
||||
<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="status" data-url="{:url('Addons/status')}"><i class="layui-icon layui-icon-play"></i>启动</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="config" data-url="{:url('Addons/config')}"><i class="layui-icon layui-icon-set"></i>设置</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="uninstall" data-url="{:url('Addons/uninstall')}"><i class="layui-icon layui-icon-delete"></i>卸载</a>
|
||||
</script>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/user_login" /}
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script src="/static/notify.js"></script>
|
||||
<script>
|
||||
var addonsList = "{:url('Addons/addonsList')}",
|
||||
addonsEdit = "{:url('Addons/edit')}";
|
||||
var addonsList = "{:url('Addons/addonsList')}";
|
||||
|
||||
layui.config({
|
||||
base: '/static/admin/' //静态资源所在路径
|
||||
@ -126,6 +108,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 启动禁用
|
||||
form.on('switch(addonsStatus)', function(data){
|
||||
var data = data.elem;
|
||||
var url = $(this).data('url');
|
||||
//执行帖子审核
|
||||
$.post(url,{ name: data.name },function(res){
|
||||
if(res.code == 0){
|
||||
notify.success(res.msg, "topRight");
|
||||
} else {
|
||||
notify.error(res.msg, "topRight");
|
||||
}
|
||||
table.reloadData("addons-list",{},'deep');
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.layui-btn.layuiadmin-btn-admin').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
|
71
app/admin/view/addons/pay.html
Normal file
71
app/admin/view/addons/pay.html
Normal file
@ -0,0 +1,71 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="body"}
|
||||
<style>
|
||||
.layui-container{background-color: #F9F9F9}
|
||||
.auth-type{margin: 10px 0px;}
|
||||
.order-info{margin:10px 0px; line-height: 30px;}
|
||||
.pay-type{line-height: 50px;}
|
||||
.soft-info{margin: 10px;}
|
||||
.pay-tips{line-height:20px;text-align: center;margin-bottom: 20px;}
|
||||
</style>
|
||||
|
||||
<div class="layui-container">
|
||||
|
||||
<div class="layui-row">
|
||||
<div class="auth-type">
|
||||
授权
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="order-info">
|
||||
<p>订单标题:<em>{$orderData.subject}</em></p>
|
||||
<p>订单编号:<em>{$orderData.out_trade_no}</em></p>
|
||||
<p>订单价格:<em class="scanpay-price">¥{$orderData.total_amount}</em> 元</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs6 layui-col-md6">
|
||||
<div class="pay-type">
|
||||
<div style="padding: 5px;"><a ><img src="/static/res/images/alipay.jpg" style="height:80px;"></a></div>
|
||||
|
||||
</div>
|
||||
<div class="soft-info">
|
||||
<div>不支持退款</div>
|
||||
<br />
|
||||
<div>软件协议:本软件为原作者拥有版权权限,购买软件可以商用,禁止第三方出售行为。</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-col-xs6 layui-col-md6">
|
||||
<div class="qrcode" data-text="{$orderData.qr_code_img}">
|
||||
<img src="{$orderData.qr_code_img}">
|
||||
</div>
|
||||
<div class="pay-tips">
|
||||
<p>请使用支付宝扫一扫<br>扫描二维码进行支付</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type="text/javascript">
|
||||
var $ = layui.jquery;
|
||||
var out_trade_no = "{$orderData.out_trade_no}";
|
||||
var interval = setInterval(function(){
|
||||
var url = 'https://www.aieok.com/pay/checkstatus.html?out_trade_no=' + out_trade_no;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: url,
|
||||
data: {out_trade_no:out_trade_no},
|
||||
dataType:"json",
|
||||
success: function (res) {
|
||||
// 等等支付时,一直轮询
|
||||
if(res.code !== 0) {
|
||||
clearInterval(interval);
|
||||
}
|
||||
}
|
||||
})
|
||||
},2500);
|
||||
</script>
|
||||
{/block}
|
@ -127,7 +127,7 @@ var forumList = "{:url('Forum/list')}",
|
||||
//监听回贴审核
|
||||
form.on('switch(recheck)', function(data){
|
||||
var data= data.elem;
|
||||
status = data.checked ? 1 : -1;
|
||||
var status = data.checked ? 1 : -1;
|
||||
//执行回帖审核
|
||||
$.ajax({
|
||||
type:'post',
|
||||
@ -148,7 +148,6 @@ var forumList = "{:url('Forum/list')}",
|
||||
adim:6
|
||||
})
|
||||
}
|
||||
|
||||
table.reload('LAY-app-forumreply-list');
|
||||
}
|
||||
});
|
||||
|
24
composer.lock
generated
24
composer.lock
generated
@ -2130,16 +2130,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.46",
|
||||
"version": "v4.4.47",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15"
|
||||
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/90425fd98d1ecad98e4b2dca9f54f62069193b15",
|
||||
"reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63",
|
||||
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2199,7 +2199,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.46"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.47"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2215,7 +2215,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-09-03T23:07:25+00:00"
|
||||
"time": "2022-10-03T15:15:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-exporter",
|
||||
@ -2292,16 +2292,16 @@
|
||||
},
|
||||
{
|
||||
"name": "taoser/think-addons",
|
||||
"version": "v1.0.6",
|
||||
"version": "v1.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/taoser/think-addons.git",
|
||||
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541"
|
||||
"reference": "570367e8d4904842625427f132d23c93f5edfc68"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
|
||||
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
|
||||
"url": "https://api.github.com/repos/taoser/think-addons/zipball/570367e8d4904842625427f132d23c93f5edfc68",
|
||||
"reference": "570367e8d4904842625427f132d23c93f5edfc68",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2343,9 +2343,9 @@
|
||||
"description": "The ThinkPHP6 Addons Package",
|
||||
"support": {
|
||||
"issues": "https://github.com/taoser/think-addons/issues",
|
||||
"source": "https://github.com/taoser/think-addons/tree/v1.0.6"
|
||||
"source": "https://github.com/taoser/think-addons/tree/v1.0.8"
|
||||
},
|
||||
"time": "2022-10-06T13:11:38+00:00"
|
||||
"time": "2022-10-15T06:21:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "taoser/think-auth",
|
||||
|
@ -16,7 +16,7 @@ return [
|
||||
// 应用名,此项不可更改
|
||||
'appname' => 'TaoLer',
|
||||
// 版本配置
|
||||
'version' => '2.0.4',
|
||||
'version' => '2.0.5',
|
||||
// 加盐
|
||||
'salt' => 'taoler',
|
||||
// 数据库备份目录
|
||||
|
@ -73,25 +73,50 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
var event = obj.event;
|
||||
var url = $(this).data('url')
|
||||
|
||||
//安装插件
|
||||
if (event === "install") {
|
||||
// 检测权限
|
||||
var userinfo = api.userinfo.get();
|
||||
var userLoginUrl = $(this).data('userlogin');
|
||||
// 安装
|
||||
var install = function (data,url,userLoginUrl,userIsPayUrl){
|
||||
var userinfo = api.userinfo.get(); // 检测权限
|
||||
if(userinfo) {
|
||||
notify.confirm("确认安装吗?", "vcenter",function(){
|
||||
var index = layer.load(1);
|
||||
$.post(url, { name: data.name, version: data.version, uid: userinfo.uid, token: userinfo.token }, function (res) {
|
||||
if (res.code == 0) {
|
||||
// 需要支付
|
||||
if (res.code === -2) {
|
||||
layer.close(index);
|
||||
layer.open({
|
||||
type: 2,
|
||||
area: ['700px', '650px'],
|
||||
fixed: false, //不固定
|
||||
maxmin: true,
|
||||
content: 'pay.html'+ "?id=" + data.id+ "&name=" + data.name + "&version=" + data.version + "&uid=" + userinfo.uid + "&price=" + data.price,
|
||||
success: function (layero, index){
|
||||
// 订单沦陷
|
||||
var intervalPay = setInterval(function() {
|
||||
$.post(userIsPayUrl,{name:data.name, userinfo:userinfo},function (res){
|
||||
if(res.code === 0) {
|
||||
layer.close(index);
|
||||
clearInterval(intervalPay);
|
||||
install(data,url,userLoginUrl,userIsPayUrl);
|
||||
}
|
||||
});
|
||||
},3000);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 安装成功
|
||||
if (res.code === 0) {
|
||||
layer.close(index);
|
||||
notify.success(res.msg, "topRight");
|
||||
} else {
|
||||
}
|
||||
// 安装失败
|
||||
if (res.code === -1) {
|
||||
layer.close(index);
|
||||
notify.error(res.msg, "topRight");
|
||||
}
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// 登录
|
||||
// 未登录时
|
||||
layer.confirm('你当前还未登录TaoLer社区账号,请登录后操作!', {
|
||||
title : '温馨提示',
|
||||
btnAlign: 'c',
|
||||
@ -146,21 +171,13 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 启用禁用
|
||||
if(event == 'status') {
|
||||
notify.confirm("确认框", "vcenter", function(){
|
||||
$.post(url,{ name: data.name },function(res){
|
||||
if (res.code == 0) {
|
||||
notify.success(res.msg, "topRight");
|
||||
} else {
|
||||
notify.error(res.msg, "topRight");
|
||||
}
|
||||
table.reloadData("addons-list",{},'deep');
|
||||
});
|
||||
});
|
||||
//安装插件
|
||||
if (event === "install") {
|
||||
var userLoginUrl = $(this).data('userlogin');
|
||||
var userIsPayUrl = $(this).data('ispay');
|
||||
install(data,url,userLoginUrl,userIsPayUrl);
|
||||
}
|
||||
|
||||
// 卸载插件
|
||||
@ -168,7 +185,7 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
notify.confirm("确认框", "vcenter",function() {
|
||||
var index = layer.load(1);
|
||||
$.post(url, { name: data.name }, function (res) {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
notify.success(res.msg, "topRight");
|
||||
} else {
|
||||
notify.error(res.msg, "topRight");
|
||||
@ -183,7 +200,7 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
if (event === "config") {
|
||||
$.post(url,{name:data.name},function (res){
|
||||
// 无配置项拦截
|
||||
if (res.code == -1) {
|
||||
if (res.code === -1) {
|
||||
notify.alert(res.msg);
|
||||
return false;
|
||||
}
|
||||
@ -195,9 +212,7 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
area: ["780px", "90%"],
|
||||
btn: ["确定", "取消"],
|
||||
yes: function (index, layero) {
|
||||
var iframeWindow = window["layui-layer-iframe" + index],
|
||||
submitID = "LAY-addons-config-submit",
|
||||
submit = layero.find("iframe").contents().find("#" + submitID);
|
||||
var iframeWindow = window["layui-layer-iframe" + index], submitID = "LAY-addons-config-submit", submit = layero.find("iframe").contents().find("#" + submitID);
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on("submit(" + submitID + ")",
|
||||
function (data) {
|
||||
@ -208,7 +223,7 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
data: field,
|
||||
daType: "json",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
if (res.code === 0) {
|
||||
notify.success(res.msg, "topRight");
|
||||
} else {
|
||||
notify.error(res.msg, "topRight");
|
||||
@ -251,60 +266,6 @@ layui.define(["table", "form", "upload","notify","hxNav"], function (exports) {
|
||||
|
||||
}
|
||||
|
||||
if (event === "edit") {
|
||||
var tr = $(obj.tr);
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: "编辑插件",
|
||||
content: addonsEdit + "?id=" + data.id,
|
||||
maxmin: true,
|
||||
area: ["400px", "620px"],
|
||||
btn: ["确定", "取消"],
|
||||
yes: function (index, layero) {
|
||||
var iframeWindow = window["layui-layer-iframe" + index],
|
||||
submitID = "LAY-addons-submit",
|
||||
submit = layero
|
||||
.find("iframe")
|
||||
.contents()
|
||||
.find("#" + submitID);
|
||||
|
||||
//监听提交
|
||||
iframeWindow.layui.form.on(
|
||||
"submit(" + submitID + ")",
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
//提交 Ajax 成功后,静态更新表格中的数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: addonsEdit,
|
||||
data: field,
|
||||
daType: "json",
|
||||
success: function (res) {
|
||||
if (res.code == 0) {
|
||||
layer.msg(res.msg, { icon: 6, time: 2000 });
|
||||
} else {
|
||||
layer.open({
|
||||
tiele: "修改失败",
|
||||
content: res.msg,
|
||||
icon: 5,
|
||||
anim: 6,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
table.reload("addons-list"); //数据刷新
|
||||
layer.close(index); //关闭弹层
|
||||
}
|
||||
);
|
||||
|
||||
submit.trigger("click");
|
||||
},
|
||||
success: function (layero, index) {},
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
exports("addons", {});
|
||||
|
BIN
public/static/res/images/alipay-logo.png
Normal file
BIN
public/static/res/images/alipay-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
BIN
public/static/res/images/alipay.jpg
Normal file
BIN
public/static/res/images/alipay.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
2
vendor/composer/autoload_psr4.php
vendored
2
vendor/composer/autoload_psr4.php
vendored
@ -15,7 +15,7 @@ return array(
|
||||
'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
|
||||
'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'),
|
||||
'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'),
|
||||
'taoser\\' => array($vendorDir . '/taoser/think-addons/src', $vendorDir . '/taoser/think-setarr/src'),
|
||||
'taoser\\' => array($vendorDir . '/taoser/think-setarr/src', $vendorDir . '/taoser/think-addons/src'),
|
||||
'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'),
|
||||
'liliuwei\\social\\' => array($vendorDir . '/liliuwei/thinkphp-social/src'),
|
||||
'app\\' => array($baseDir . '/app'),
|
||||
|
4
vendor/composer/autoload_static.php
vendored
4
vendor/composer/autoload_static.php
vendored
@ -184,8 +184,8 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
),
|
||||
'taoser\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/taoser/think-addons/src',
|
||||
1 => __DIR__ . '/..' . '/taoser/think-setarr/src',
|
||||
0 => __DIR__ . '/..' . '/taoser/think-setarr/src',
|
||||
1 => __DIR__ . '/..' . '/taoser/think-addons/src',
|
||||
),
|
||||
'phpspirit\\databackup\\' =>
|
||||
array (
|
||||
|
28
vendor/composer/installed.json
vendored
28
vendor/composer/installed.json
vendored
@ -2264,17 +2264,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.46",
|
||||
"version_normalized": "4.4.46.0",
|
||||
"version": "v4.4.47",
|
||||
"version_normalized": "4.4.47.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15"
|
||||
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/90425fd98d1ecad98e4b2dca9f54f62069193b15",
|
||||
"reference": "90425fd98d1ecad98e4b2dca9f54f62069193b15",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63",
|
||||
"reference": "1069c7a3fca74578022fab6f81643248d02f8e63",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2298,7 +2298,7 @@
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
|
||||
},
|
||||
"time": "2022-09-03T23:07:25+00:00",
|
||||
"time": "2022-10-03T15:15:11+00:00",
|
||||
"bin": [
|
||||
"Resources/bin/var-dump-server"
|
||||
],
|
||||
@ -2336,7 +2336,7 @@
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.46"
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v4.4.47"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2432,17 +2432,17 @@
|
||||
},
|
||||
{
|
||||
"name": "taoser/think-addons",
|
||||
"version": "v1.0.6",
|
||||
"version_normalized": "1.0.6.0",
|
||||
"version": "v1.0.8",
|
||||
"version_normalized": "1.0.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/taoser/think-addons.git",
|
||||
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541"
|
||||
"reference": "570367e8d4904842625427f132d23c93f5edfc68"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/taoser/think-addons/zipball/e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
|
||||
"reference": "e6e35bfd8b93dc469ebb5c5530ba350131bd7541",
|
||||
"url": "https://api.github.com/repos/taoser/think-addons/zipball/570367e8d4904842625427f132d23c93f5edfc68",
|
||||
"reference": "570367e8d4904842625427f132d23c93f5edfc68",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2452,7 +2452,7 @@
|
||||
"topthink/think-helper": "^3.0.0",
|
||||
"topthink/think-view": "^1.0"
|
||||
},
|
||||
"time": "2022-10-06T13:11:38+00:00",
|
||||
"time": "2022-10-15T06:21:17+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
@ -2486,7 +2486,7 @@
|
||||
"description": "The ThinkPHP6 Addons Package",
|
||||
"support": {
|
||||
"issues": "https://github.com/taoser/think-addons/issues",
|
||||
"source": "https://github.com/taoser/think-addons/tree/v1.0.6"
|
||||
"source": "https://github.com/taoser/think-addons/tree/v1.0.8"
|
||||
},
|
||||
"install-path": "../taoser/think-addons"
|
||||
},
|
||||
|
16
vendor/composer/installed.php
vendored
16
vendor/composer/installed.php
vendored
@ -3,7 +3,7 @@
|
||||
'name' => 'taoser/taoler',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '0c44db5a5d56d4f62656d0fdad68f82c27235469',
|
||||
'reference' => 'ad4f215470c0da087a55d6ee63199988a4d216bd',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -347,9 +347,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/var-dumper' => array(
|
||||
'pretty_version' => 'v4.4.46',
|
||||
'version' => '4.4.46.0',
|
||||
'reference' => '90425fd98d1ecad98e4b2dca9f54f62069193b15',
|
||||
'pretty_version' => 'v4.4.47',
|
||||
'version' => '4.4.47.0',
|
||||
'reference' => '1069c7a3fca74578022fab6f81643248d02f8e63',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/var-dumper',
|
||||
'aliases' => array(),
|
||||
@ -367,16 +367,16 @@
|
||||
'taoser/taoler' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '0c44db5a5d56d4f62656d0fdad68f82c27235469',
|
||||
'reference' => 'ad4f215470c0da087a55d6ee63199988a4d216bd',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'taoser/think-addons' => array(
|
||||
'pretty_version' => 'v1.0.6',
|
||||
'version' => '1.0.6.0',
|
||||
'reference' => 'e6e35bfd8b93dc469ebb5c5530ba350131bd7541',
|
||||
'pretty_version' => 'v1.0.8',
|
||||
'version' => '1.0.8.0',
|
||||
'reference' => '570367e8d4904842625427f132d23c93f5edfc68',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../taoser/think-addons',
|
||||
'aliases' => array(),
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2022-10-10 16:42:53
|
||||
// This file is automatically generated at:2022-10-15 14:22:33
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'taoser\\addons\\Service',
|
||||
|
@ -10,6 +10,10 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if ('cli' !== PHP_SAPI) {
|
||||
throw new Exception('This script must be run from the command line.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a dump server to collect and output dumps on a single place with multiple formats support.
|
||||
*
|
||||
|
5
vendor/taoser/think-addons/src/helper.php
vendored
5
vendor/taoser/think-addons/src/helper.php
vendored
@ -317,7 +317,4 @@ if (!function_exists('get_addons_list')) {
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}发表帖子{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="{$Request.domain}/static/res/css/plyr.css" charset="utf-8"/>{/block}
|
||||
{block name="link"} {/block}
|
||||
{block name="column"}{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container fly-marginTop">
|
||||
@ -149,13 +149,12 @@
|
||||
{:hook('taonyeditor')}
|
||||
<script src="/static/xm-select.js"></script>
|
||||
<script>
|
||||
layui.use(["fly", "plyr"], function () {
|
||||
layui.use(["fly"], function () {
|
||||
var $ = layui.jquery,
|
||||
fly = layui.fly,
|
||||
form = layui.form,
|
||||
colorpicker = layui.colorpicker,
|
||||
upload = layui.upload,
|
||||
plyr = layui.plyr;
|
||||
upload = layui.upload;
|
||||
|
||||
//获取百度标签标志,tag或者word;
|
||||
var flag = 'word';
|
||||
@ -323,12 +322,12 @@
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg, { icon: 6, time: 2000 }, function () {
|
||||
notify.success(data.msg, function () {
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({ title: "发布失败", content: data.msg, icon: 5, anim: 6 });
|
||||
l$("#captcha").attr("src", "{:captcha_src()}?" + Math.random());
|
||||
notify.error(data.msg);
|
||||
$("#captcha").attr("src", "{:captcha_src()}?" + Math.random());
|
||||
}
|
||||
layer.close(index);
|
||||
},
|
||||
@ -364,9 +363,6 @@
|
||||
},
|
||||
});
|
||||
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" />
|
||||
<meta property="bytedance:updated_time" content="{$article.update_time|date='c'}" />
|
||||
{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="{$Request.domain}/static/res/css/plyr.css" charset="utf-8"/>{/block}
|
||||
{block name="link"} {/block}
|
||||
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
@ -183,8 +183,11 @@
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
@ -198,12 +201,11 @@
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
|
||||
layui.use(["fly", "face", "colorpicker", "plyr", "laypage"], function () {
|
||||
layui.use(["fly", "face", "colorpicker", "laypage"], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
fly = layui.fly,
|
||||
colorpicker = layui.colorpicker,
|
||||
plyr = layui.plyr,
|
||||
laytpl = layui.laytpl,
|
||||
uid = layui.cache.user.uid,
|
||||
laypage = layui.laypage;
|
||||
@ -334,11 +336,11 @@
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taoplyr')}
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
{:hook('markdownhook')}
|
||||
|
@ -15,7 +15,6 @@
|
||||
<meta name="mobile-agent" content="format=html5;url={$Request.domain}{$Request.url}">
|
||||
{/block}
|
||||
{block name="link"}
|
||||
<link rel="stylesheet" href="{$Request.domain}/static/res/css/plyr.css" charset="utf-8">
|
||||
<!-- 谷歌JavaScript结构化 -->
|
||||
<script type="application/ld+json">{"@context": "https://schema.org","@type": "NewsArticle","headline": "{$article.title}","image" : "{:getOnepic($article.content)}","datePublished" : "{$article.create_time|date='c'}","dateModified": "{$article.update_time|date='c'}","author" : {"@type" : "Person","name" : "用户投稿","url": "{$Request.domain}"}},</script>
|
||||
<!-- 百度JavaScript结构化 -->
|
||||
@ -287,7 +286,9 @@
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
<script type='text/javascript' src="{$Request.domain}/view/common/blog/js/theme.js"></script>
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
@ -302,12 +303,11 @@ var collectionFind = "{:url('Collection/find')}",
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
|
||||
layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
|
||||
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
var $ = layui.jquery
|
||||
,form = layui.form
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,plyr = layui.plyr
|
||||
,laytpl = layui.laytpl
|
||||
,uid = layui.cache.user.uid
|
||||
,laypage = layui.laypage;
|
||||
@ -445,14 +445,13 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
|
||||
});
|
||||
});
|
||||
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taoplyr')}
|
||||
|
||||
{:hook('markdownhook')}
|
||||
|
||||
{include file="/public/qr-read" /}
|
||||
|
||||
{volist name="push_js" id="vo"}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}编辑帖子{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="/static/res/css/plyr.css" charset="utf-8">{/block}
|
||||
{block name="link"} {/block}
|
||||
{block name="column"}{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container fly-marginTop">
|
||||
@ -140,7 +140,9 @@
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
<script src="/static/xm-select.js"></script>
|
||||
<script>
|
||||
var cateId = "{$article.cate.id}";
|
||||
@ -211,13 +213,12 @@ $(function(){
|
||||
|
||||
</script>
|
||||
<script>
|
||||
layui.use(['fly','plyr'], function(){
|
||||
layui.use(['fly'], function(){
|
||||
var $ = layui.jquery
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,form = layui.form
|
||||
,upload = layui.upload
|
||||
,plyr = layui.plyr;
|
||||
,upload = layui.upload;
|
||||
|
||||
//获取百度标签标志,tag或者word;
|
||||
var flag = 'word';
|
||||
@ -258,15 +259,14 @@ $(function(){
|
||||
|
||||
// 获取百度分词接口的关键词
|
||||
function getBdiduWords(flag,title,content) {
|
||||
console.log(flag,title,content)
|
||||
$.post("{:url('article/keywords')}",{ keywords: title, content:content, flag: flag }, function (res) {
|
||||
if (res.code == 0) {
|
||||
console.log(res.data)
|
||||
$("input[name='keywords']").val(res.data.join(','));
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
$.post("{:url('article/keywords')}",{ keywords: title, content:content, flag: flag }, function (res) {
|
||||
if (res.code == 0) {
|
||||
console.log(res.data)
|
||||
$("input[name='keywords']").val(res.data.join(','));
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// 百度词条
|
||||
(function(){
|
||||
@ -326,13 +326,13 @@ $(function(){
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{icon:6,time:2000}, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
notify.success(data.msg, function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.open({title:'编辑失败',content:data.msg,icon:5,anim:6});
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
};
|
||||
notify.error(data.msg);
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
@ -344,7 +344,6 @@ $(function(){
|
||||
,color: "{$article.title_color ?? '#333'}"
|
||||
,predefine: true // 开启预定义颜色
|
||||
,done: function(color){
|
||||
//console.log(color);
|
||||
//譬如你可以在回调中把得到的 color 赋值给表单
|
||||
$('#L_title_color').val(color);
|
||||
//改变标题颜色
|
||||
@ -354,22 +353,19 @@ $(function(){
|
||||
|
||||
//指定允许上传的文件类型
|
||||
upload.render({
|
||||
elem: '#zip-button'
|
||||
,url: "{:url('article/uploads')}" //改成您自己的上传接口
|
||||
,data: {type:'zip'}
|
||||
,accept: 'file' //普通文件
|
||||
,done: function(res){
|
||||
if(res.status == 0){
|
||||
$('input[name="upzip"]').val(res.url);
|
||||
layer.msg('上传成功');
|
||||
} else {
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
elem: '#zip-button'
|
||||
,url: "{:url('article/uploads')}" //改成您自己的上传接口
|
||||
,data: {type:'zip'}
|
||||
,accept: 'file' //普通文件
|
||||
,done: function(res){
|
||||
if(res.status == 0){
|
||||
$('input[name="upzip"]').val(res.url);
|
||||
notify.success(res.msg);
|
||||
} else {
|
||||
notify.error(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<meta property="bytedance:published_time" content="{$article.create_time|date='c'}" />
|
||||
<meta property="bytedance:updated_time" content="{$article.update_time|date='c'}" />
|
||||
{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="{$Request.domain}/static/res/css/plyr.css" charset="utf-8">{/block}
|
||||
{block name="link"} {/block}
|
||||
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
@ -64,7 +64,9 @@
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
@ -78,13 +80,12 @@
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
|
||||
layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
|
||||
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
var $ = layui.jquery
|
||||
,form = layui.form
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,plyr = layui.plyr
|
||||
,laytpl = layui.laytpl
|
||||
,laytpl = layui.laytpl
|
||||
,uid = layui.cache.user.uid
|
||||
,laypage = layui.laypage;
|
||||
|
||||
@ -201,12 +202,11 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taoplyr')}
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
{:hook('markdownhook')}
|
||||
|
@ -12,7 +12,7 @@
|
||||
<meta property="bytedance:lrDate_time" content="{$lrDate_time|date='c'}" />
|
||||
<meta property="bytedance:updated_time" content="{$article.update_time|date='c'}" />
|
||||
{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="{$Request.domain}/static/res/css/plyr.css" charset="utf-8">{/block}
|
||||
{block name="link"} {/block}
|
||||
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
@ -203,7 +203,11 @@
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
||||
{:hook('taonyeditor')}
|
||||
|
||||
{:hook('taoplayer')}
|
||||
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
collection = "{:url('collection/')}",
|
||||
@ -217,12 +221,11 @@ var collectionFind = "{:url('Collection/find')}",
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
|
||||
layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
|
||||
layui.use(['fly', 'face','colorpicker', 'laypage'], function(){
|
||||
var $ = layui.jquery
|
||||
,form = layui.form
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,plyr = layui.plyr
|
||||
,laytpl = layui.laytpl
|
||||
,uid = layui.cache.user.uid
|
||||
,laypage = layui.laypage;
|
||||
@ -354,13 +357,11 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{:hook('taoplyr')}
|
||||
|
||||
{//图片点击放大}
|
||||
{include file="/public/images-click" /}
|
||||
{:hook('markdownhook')}
|
||||
|
@ -81,16 +81,16 @@
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{icon:6,time:2000}, function(){
|
||||
notify.success(data.msg,function(){
|
||||
location.href = data.url;
|
||||
});
|
||||
})
|
||||
} else {
|
||||
layer.open({title:'登陆失败',content:data.msg,icon:5,anim:6});
|
||||
notify.error(data.msg);
|
||||
layui.jquery('#captcha').attr('src', '{:captcha_src()}?'+Math.random());
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -30,6 +30,7 @@
|
||||
{block name="meta"}{/block}
|
||||
<script src="/static/jquery-3.6.0.min.js"></script>
|
||||
<script src="{$Request.domain}/static/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="/static/notify.js"></script>
|
||||
<!-- 样式 -->
|
||||
<link rel="canonical" href="{$Request.domain}{$Request.url}">
|
||||
<link rel="stylesheet" href="https://at.alicdn.com/t/font_24081_qs69ykjbea.css" />
|
||||
@ -53,6 +54,8 @@
|
||||
{include file="public/footer" /}
|
||||
{include file="public/js" /}
|
||||
<script>
|
||||
var element = layui.element;
|
||||
var notify = layui.notify;
|
||||
layui.cache.page = "{$jspage}";
|
||||
layui.cache.user = {
|
||||
username: "{$user.name ?? '游客'}"
|
||||
@ -67,7 +70,6 @@
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use('fly');
|
||||
var element = layui.element;
|
||||
</script>
|
||||
{block name="script"}{/block}
|
||||
</body>
|
||||
|
@ -20,6 +20,7 @@
|
||||
<link rel="stylesheet" href="{$Request.domain}/static/res/css/global.css">
|
||||
{block name="css"}{/block}
|
||||
<script src="{$Request.domain}/static/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="/static/notify.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{include file="public/header" /}
|
||||
@ -32,6 +33,7 @@
|
||||
</div>
|
||||
{include file="public/footer" /}
|
||||
<script>
|
||||
var notify = layui.notify;
|
||||
layui.cache.page = 'user';
|
||||
layui.cache.user = {
|
||||
username: "{$user.name ??'游客'}"
|
||||
|
Loading…
Reference in New Issue
Block a user