在conf的service里添加
#允許跨域請求的域,*代表所有
add_ header ' Access-Control-Allow-0rigin' *;
#允許帶上cookie請求
add_ header ' Access-Control-Allow-Credentials' 'true';
#允許請求的方法,比如GET/POST/PUT/DELETE
add_ header ' Access-Control-Allow-Methods' *;
#允許請求的header
add_ header ' Access-Control-Allow-Headers' *;