本质为buffer转base64 let bytes = new Uint8Array(imageBuffer.data); let data = ""; let len = bytes.byteLength; for (let i = 0; i < len; i++) { data += String.fromCharCode(bytes[i]); } image.src = "data:image/png;base64," + window.btoa(da
$(function(){ var sex=$("#sex").val(); var marriageStatus=$("#marriageStatus").val(); var education=$("#education").val(); if(!isnull(sex)){ $("input:radio[name='sex'][value="+sex+"]").attr('checked','true
核心代码: @accept_websocket def get_log(req): if req.is_websocket(): print('收到websocket请求') with open(settings.LOG_FILE, 'r', encoding='UTF-8') as f: log_length = len(f.readlines()) time.sleep(1) while True: with open(settings.LOG_FILE, 'r', encoding='UT
两种方法从SpringBoot的方向解决跨域问题 今天搭建博客的时候,尝试性的传递数据,发现浏览器报了这个错误 -blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the r