添加了富文本编辑器上传图片的功能,上传路径在setting_loacl和server里暂时在static/src/upload_image/
This commit is contained in:
@@ -143,6 +143,16 @@ Uploader = (function(superClass) {
|
||||
processData: false,
|
||||
contentType: false,
|
||||
type: 'POST',
|
||||
beforeSend: function(){
|
||||
var name = "csrftoken=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1);
|
||||
if (c.indexOf(name) != -1) name = c.substring(name.length, c.length);
|
||||
}
|
||||
arguments[0].setRequestHeader("X-CSRFToken", name);
|
||||
},
|
||||
headers: {
|
||||
'X-File-Name': encodeURIComponent(file.name)
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ define("editor", ["simditor"], function(Simditor){
|
||||
toolbarFloat: false,
|
||||
defaultImage: null,
|
||||
upload: {
|
||||
url: "",
|
||||
url: "/api/admin/up_load_image/",
|
||||
params: null,
|
||||
fileKey: "image",
|
||||
connectionCount: 3,
|
||||
|
||||
Reference in New Issue
Block a user