Jfinal整合百度富文字編輯器ueditor

2022-03-02 13:06:29 字數 1338 閱讀 8883

ueditor配置檔案ueditor.config.js修改引數serverurl:(改為要呼叫的action)

後台**

package com.sandu.mega.admin.ueditor;

import com.jfinal.aop.clear;

import com.jfinal.core.controller;

import com.jfinal.kit.ret;

import com.jfinal.upload.uploadfile;

import com.sandu.mega.common.kit.uploadosskit;/**

* * @classname: ueditorcontroller

* @author suruozhong

* @date 2023年3月7日*

*/@clear

public

class

ueditorcontroller extends controller

uploadfile file = getfile("

upfile

"); //獲取檔案

string filename =file.getfilename();

string typearr = filename.split("

\\."

); string orig =file.getoriginalfilename();

long size =file.getfile().length();

string url =uploadosskit.uploadimage(file);

ret ret = ret.create("

state

", "

success

") //下面這幾個都是必須返回給ueditor的資料

.set("

url"

, url) //檔案上傳後的路徑

.set("

title

", filename) //檔名稱

.set("

original

", orig)

.set("

type

", "

."+typearr[1

]) .

set("

size

", size);

renderjson(ret);}}

vue整合百度富文字編輯器

utf 8版 有圖有真相,看圖 注意的點 有人會問為什麼,不放在src的下面,非要和index.html平級?值得說的是你不知道,後面操作上傳等上傳按鈕的時候,載入的是ue下html檔案,vue框架只有乙個index.html模板,其他都是路由載入模組,放在src的下面 經 過壓縮後,上傳後再次嵌入...

百度UEditor富文字編輯器

修改上傳的路徑 解壓出來 ueditor php config.json 中修改 二 模板中呼叫 1 html 2 js var ue ue.geteditor container 注意這個要一對一 三,讓自適應100 開啟 ueditor ueditor.config.js 找到initialfr...

vue ueditor百度富文字編輯器

前言 無需main.js或頁面全域性或區域性引入,直接使用cdn將ueditor作為vue元件 使用 import editor from 你的component路徑 editor.vue 使用 import editor from 你的component路徑 editor.vue export d...