后台:
header('Content-Type:text/html; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE');
header('Access-Control-Max-Age: 3600');
header('Access-Control-Allow-Headers: Content-Type,x-requested-with,Authorization');
header('Access-Control-Allow-Credentials: true');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
header('HTTP/1.1 200 OK');
exit;
}
Sender:
if (fetchType === 'CORS'){
return axios.post(url, qs.stringify(Data))//如果是跨域接口 发送表单请求 否则 发送json
}else {
return axios.post(url, Data)
}
@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
posted on 2017-09-03 18:03
聂文龙 阅读(306)
评论(0) 编辑 收藏 引用