xuxu.gao
- xuxu.gao 回复了话题 Yii2 和 vue 之间的跨域问题
在控制器上面增加
header("Access-Control-Allow-Origin: *"); //如果需要设置允许所有域名发起的跨域请求,可以使用通配符 * ,如果限制自己的域名的话写自己的域名就行了。 // 响应类型 *代表通配符,可以指出POST,GET等固定类型 header('Access-Control-Allow-Methods:* '); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type');
- xuxu.gao 回答了问题 翻页时候怎么样让新页面定位在原位置?
window.onbeforeunload = function(){ var scrollPos; if (typeof window.pageYOffset != 'undefined') { scrollPos = window.pageYOffset; } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPos = document.documentElement.scrollTop; } else if (typeof document.body != 'undefined') { scrollPos = document.body.scrollTop; } document.cookie="scrollTop="+scrollPos; //存储滚动条位置到cookies中 } window.onload = function() { if(document.cookie.match(/scrollTop=([^;]+)(;|$)/)!=null){ var arr=document.cookie.match(/scrollTop=([^;]+)(;|$)/); //cookies中不为空,则读取滚动条位置 document.documentElement.scrollTop=parseInt(arr[1]); document.body.scrollTop=parseInt(arr[1]); } }
- xuxu.gao 2018-05-04 已签到连续签到1天,获得了5个金钱
- xuxu.gao 2018-04-28 已签到连续签到1天,获得了5个金钱
直播直接走rtmp协议结合ffmpeg转码,根本就跟swoole没关系咧,swoole就是做通讯