You've already forked go-url-shortener
update assets use
This commit is contained in:
17
assets/css/home.css
Normal file
17
assets/css/home.css
Normal file
@@ -0,0 +1,17 @@
|
||||
.my_table {
|
||||
display: block;
|
||||
max-width: 1280px;
|
||||
}
|
||||
|
||||
.my_table tr {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
border: 1px solid #eee;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.my_table tr td {
|
||||
display: inline-block;
|
||||
word-wrap: break-word;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
22
assets/js/home.js
Normal file
22
assets/js/home.js
Normal file
@@ -0,0 +1,22 @@
|
||||
$('.deleteShortUrl').click(function () {
|
||||
let csrfToken = $('input[name="csrf_token"]').val()
|
||||
let u = $(this).attr('data-short-url')
|
||||
$.ajax({
|
||||
url: '/delete-short-url/' + u,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
"X-CSRF-Token": csrfToken
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.success) {
|
||||
alert('删除成功');
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert('删除失败');
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user