wyyl/resources/beike/admin/js/app.js

22 lines
641 B
JavaScript

import http from "../../../js/http";
window.$http = http;
function randomString(length) {
let str = '';
for (; str.length < length; str += Math.random().toString(36).substr(2));
return str.substr(0, length);
}
$(document).ready(function ($) {
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
beforeSend: function() { layer.load(2, {shade: [0.3,'#fff'] }); },
complete: function() { layer.closeAll('loading'); },
error: function(xhr, ajaxOptions, thrownError) {
if (xhr.responseJSON.message) {
layer.msg(xhr.responseJSON.message,() => {})
}
},
});
});