专注web开发10年

LayCenter怎么将插件【LY_讯飞星火认知大模型,自动发布原创文章】的功能适配?

提问者:大头娃娃 问题分类:插件

LayCenter怎么将插件【LY_讯飞星火认知大模型,自动发布原创文章】的功能适配?,LayCenter,第1张

1 个回答
满意答案
花晨月夕
花晨月夕 管理员
程序猿一枚,专注web相关开发,可开发网站、小程序、app、cms系统、erp系统、oa系统等等

在他的插件include.php中加入下面的代码即可,文件完整路径 zb_users/plugin/ly_xfyun/include.php

Add_Filter_Plugin('Filter_Plugin_Html_Js_Add','ly_xfyun_Html_Js_Add');       			 	
function ly_xfyun_Html_Js_Add(){
    if (!isset($_GET['laycenter'])){
        return;
    }
    ?>
    $(function(){
        var name = '讯飞星'
        lcp.editorBarButton(name, {
            icon: bloghost + 'zb_users/plugin/ly_xfyun/logo.png',
            name,
            callback: function(o){
                lcp.confirm(`<p style="display:flex;margin-bottom:10px"><input type="text" class="layui-input text" style="margin-right:10px"><button class="layui-btn layui-btn-normal make">生成</button></p><p><textarea class="layui-textarea"></textarea>

`, { title: name, btns: ['插入'], success(dom){ dom.find('.make').click(function(){ var ipt = dom.find('.text') if (ipt.val() == ''){ ipt.focus() return } var load = lcp.loading('生成中...') lcp.ajax({ url: bloghost + 'zb_users/plugin/ly_xfyun/main.php', data: { ueditor: ipt.val() }, dataType: 'html', success(res){ dom.find('textarea').val(res) }, end(){ load.close() } }) }) }, ok(dom){ o.insert(dom.find('textarea').val()) } }) } }) }) <?php }

发布于:5个月前 (11-16) IP属地:江苏省
我来回答