Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hunter-ht.cn
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘莹莹
hunter-ht.cn
Commits
e58e548e
Commit
e58e548e
authored
May 21, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajax添加跨域处理
parent
92b6bce3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
0 deletions
+27
-0
admin.html
hunter/templates/admin.html
+7
-0
editArticle.html
hunter/templates/editArticle.html
+4
-0
profile.html
hunter/templates/profile.html
+1
-0
user.html
hunter/templates/user.html
+10
-0
write.html
hunter/templates/write.html
+5
-0
No files found.
hunter/templates/admin.html
View file @
e58e548e
...
...
@@ -247,6 +247,7 @@
type
:
'get'
,
data
:{
"articleID"
:
articleID
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
){
{
#
var
result
=
$
.
parseJSON
(
response
);
#
}
...
...
@@ -276,6 +277,7 @@
type
:
'post'
,
data
:{
"title"
:
title
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
){
if
(
response
[
"warning"
]
==
"文章删除成功"
){
...
...
@@ -373,6 +375,7 @@
data
:
{
"delname"
:
delname
,
"actiontype"
:
'1'
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
dataType
:
'json'
,
success
:
function
(
message
)
{
...
...
@@ -401,6 +404,7 @@
"delpub"
:
delpub
,
"pubFileName"
:
pubFileName
,
"actiontype"
:
'4'
,
//删除论文
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
dataType
:
'json'
,
success
:
function
(
message
)
{
...
...
@@ -428,6 +432,7 @@
"username"
:
username
,
"identity"
:
identity
,
"actiontype"
:
'3'
,
//更换用户身份
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
dataType
:
'json'
,
success
:
function
(
message
)
{
...
...
@@ -457,6 +462,7 @@
"resetPwd"
:
resetPwd
,
"actiontype"
:
'2'
,
"resetname"
:
resetname
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
dataType
:
'json'
,
success
:
function
(
message
)
{
...
...
@@ -480,6 +486,7 @@
"username"
:
enData
[
"username"
],
"password"
:
enData
[
"password"
],
"actiontype"
:
data
[
"actiontype"
],
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
dataType
:
'json'
,
success
:
function
(
message
)
{
...
...
hunter/templates/editArticle.html
View file @
e58e548e
...
...
@@ -74,6 +74,8 @@
console
.
log
(
fileList
[
0
].
name
);
var
formData
=
new
FormData
();
formData
.
append
(
'image'
,
fileList
[
0
]);
formData
.
append
(
'csrfmiddlewaretoken'
,
{{
csrf_token
}});
$
.
ajax
({
type
:
"post"
,
url
:
'/uploadImg/'
,
//ajaxurl
...
...
@@ -124,6 +126,8 @@
formdata
.
append
(
"title"
,
title
);
formdata
.
append
(
"content"
,
content
);
formdata
.
append
(
"articleID"
,
articleID
);
formdata
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
url
:
'/save/edit/article/'
,
type
:
'post'
,
...
...
hunter/templates/profile.html
View file @
e58e548e
...
...
@@ -375,6 +375,7 @@
"profile"
:
profile
,
"length"
:
length
,
"edu_arr"
:
edu_arr
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
){
console
.
log
(
response
);
...
...
hunter/templates/user.html
View file @
e58e548e
...
...
@@ -299,6 +299,7 @@
formatData
.
append
(
"type"
,
type
);
formatData
.
append
(
"username"
,
username
);
formatData
.
append
(
"isPublish"
,
isPublish
);
formatData
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
url
:
"{% url 'hunter:add_publication' %}"
,
...
...
@@ -371,6 +372,7 @@
formatData
.
append
(
"type"
,
type
);
formatData
.
append
(
"username"
,
username
);
formatData
.
append
(
"isPublish"
,
isPublish
);
formatData
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
...
...
@@ -402,6 +404,7 @@
type
:
'post'
,
data
:{
"pub_id"
:
pubid
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
)
{
if
(
response
[
'message'
]){
...
...
@@ -439,6 +442,7 @@
"userID"
:
userID
,
"title"
:
title
,
"url"
:
url
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
)
{
if
(
response
[
'message'
]){
...
...
@@ -463,6 +467,7 @@
type
:
'post'
,
data
:{
"article_id"
:
artid
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
)
{
if
(
response
[
'message'
]){
...
...
@@ -501,6 +506,7 @@
formatData
.
append
(
"software"
,
software
);
formatData
.
append
(
"date"
,
date
);
formatData
.
append
(
"url"
,
url_cve
);
formatData
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
...
...
@@ -556,6 +562,7 @@
type
:
'post'
,
data
:{
"cve_id"
:
cveid
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
)
{
if
(
response
[
'message'
]){
...
...
@@ -688,6 +695,7 @@
formatData
.
append
(
"bugType"
,
bugtype
);
formatData
.
append
(
"software"
,
software
);
formatData
.
append
(
"url"
,
url_cve
);
formatData
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
url
:
"{% url 'hunter:edit_cve' %} "
,
...
...
@@ -786,6 +794,7 @@
data
:{
'pubID'
:
pubID
,
'isOpen'
:
isOpen
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
){
if
(
response
[
'message'
]){
...
...
@@ -820,6 +829,7 @@
data
:{
'art_id'
:
art_id
,
'publish'
:
publish
,
'csrfmiddlewaretoken'
:
'{{ csrf_token }}'
},
success
:
function
(
response
){
if
(
response
[
'message'
]){
...
...
hunter/templates/write.html
View file @
e58e548e
...
...
@@ -74,6 +74,8 @@
console
.
log
(
fileList
[
0
].
name
);
var
formData
=
new
FormData
();
formData
.
append
(
'image'
,
fileList
[
0
]);
formData
.
append
(
'csrfmiddlewaretoken'
,{{
csrf_token
}});
$
.
ajax
({
type
:
"post"
,
url
:
'/uploadImg/'
,
//ajaxurl
...
...
@@ -122,6 +124,7 @@
formdata
.
append
(
"userID"
,
userID
);
formdata
.
append
(
"title"
,
title
);
formdata
.
append
(
"content"
,
content
);
formdata
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
url
:
'/save/article/'
,
type
:
'post'
,
...
...
@@ -164,6 +167,8 @@
formdata
.
append
(
"userID"
,
userID
);
formdata
.
append
(
"title"
,
title
);
formdata
.
append
(
"content"
,
content
);
formdata
.
append
(
"csrfmiddlewaretoken"
,{{
csrf_token
}});
$
.
ajax
({
url
:
'/save/private'
,
type
:
'post'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment