935090232@qq.com
2021-03-18 5d43370b99a03391c9271d04d3f351f0fd734dae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
 * 
 */
package com.matrix.system.common.actions;
 
import com.matrix.component.ueditor.ActionEnter;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.tools.LogUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
 
/**
 * 百度编辑器控制器
 * 
 * @author jiangyouyao
 *
 */
@Controller
@RequestMapping(value = "admin/beditor")
public class UeditorController {
 
    /**
     * 百度编辑器主入口方法
     * 
     * @author jiangyouyao
     * @email 512061637@qq.com
     * @date 2019年1月8日
     * @param request
     * @param response
     */
    @RequestMapping(value = "/config")
    public void config(HttpServletRequest request, HttpServletResponse response) {
        response.setContentType("application/json");
        String rootPath = request.getSession().getServletContext().getRealPath("/");
        try {
            String exec = new ActionEnter(request, rootPath).exec();
            PrintWriter writer = response.getWriter();
            writer.write(exec);
            writer.flush();
            writer.close();
        } catch (IOException e) {
            LogUtil.error("百度编辑器错误", e);
            throw new GlobleException("系统繁忙,请稍后再试");
        }
 
    }
 
}