mHalo / mhalo.kindeditor

kindeditor美化
https://www.npmjs.com/package/mhalo.kindeditor
GNU Lesser General Public License v2.1
3 stars 1 forks source link

有时候了,作者能不能重构图片,文件,等空间。。 #6

Open hulang opened 8 months ago

hulang commented 8 months ago

现在基本都是上传图片和文件是把图片和文件的路径保存到表里面了。。不需要写一大堆的json字段

// 官方的。。。
{
    "moveup_dir_path":"",
    "current_dir_path":"",
    "current_url":"\/ke4\/php\/..\/attached\/",
    "total_count":5,
    "file_list":[
        {
            "is_dir":false,
            "has_file":false,
            "filesize":208736,
            "dir_path":"",
            "is_photo":true,
            "filetype":"jpg",
            "filename":"1241601537255682809.jpg",
            "datetime":"2018-06-06 00:36:39"
        },
        {
            "is_dir":false,
            "has_file":false,
            "filesize":14966,
            "dir_path":"",
            "is_photo":true,
            "filetype":"jpg",
            "filename":"1_192040_1.jpg",
            "datetime":"2018-06-06 00:36:39"
        },
        {
            "is_dir":false,
            "has_file":false,
            "filesize":245132,
            "dir_path":"",
            "is_photo":true,
            "filetype":"jpg",
            "filename":"2009321101428.jpg",
            "datetime":"2018-06-06 00:36:39"
        },
        {
            "is_dir":false,
            "has_file":false,
            "filesize":229316,
            "dir_path":"",
            "is_photo":true,
            "filetype":"jpg",
            "filename":"24000750690483.jpg",
            "datetime":"2018-06-06 00:36:39"
        },
        {
            "is_dir":false,
            "has_file":false,
            "filesize":26094,
            "dir_path":"",
            "is_photo":true,
            "filetype":"jpg",
            "filename":"W020091124524510014093.jpg",
            "datetime":"2018-06-06 00:36:39"
        }
    ]
}

存到数据表中后,可以直接

{
    "error": 0,
    "page": 1,
    "limit": 20,
    "count": 4,
    "data": [
        {
            "size": 139256,
            "name": "123qe.png",
            "type": "png",
            "url": "/static/upload/image/20240112/5a9191d173ff707d5dcfdb12e1b585d8.png",
            "datetime": "2024-01-12 18:23:19",
            "width": 757,
            "height": 930
        },
        {
            "size": 146791,
            "name": "ads.png",
            "type": "png",
            "url": "/static/upload/image/20240112/76d7b92f3a53a387cd6fc76b2a67329d.png",
            "datetime": "2024-01-12 18:23:19",
            "width": 667,
            "height": 951
        },
        {
            "size": 116421,
            "name": "win10_21H2_19044.2130.png",
            "type": "png",
            "url": "/static/upload/image/20240112/9d0d51f5a1293197d8f9cb4305282164.png",
            "datetime": "2024-01-12 18:16:49",
            "width": 667,
            "height": 951
        },
        {
            "size": 106275,
            "name": "444.png",
            "type": "png",
            "url": "/static/upload/image/20210615/6d0965b0eabfb62d77427e0232a4fdc4.png",
            "datetime": "2021-06-15 13:31:21",
            "width": 409,
            "height": 454
        }
    ]
}

error和上传一样,0成功,1失败 page、limit、count、data 这些作者应该都看的明白吧,可能要加一个往下加载的功能了。。图片太多了,卡啊。鼠标经过显示(name+大小+时间),点击就返回url。。 批量上传界面,也可以加入,在:全部插入 按钮的前面加上:图片空间 ,这里就是多选了,我记得哪个改的就是类似。。

hulang commented 8 months ago

微信截图_20240129165651 批量上传的,也可以加入切换