// import axios from 'axios';
// axios.defaults.timeout = 15000
// export const request = axios.create({
//   baseURL: 'http://52.83.230.236:9001/yszh/1/api/',
// });
import axios from "axios";
// import { bind } from "file-loader";
axios.defaults.timeout = 15000
console.log(window.localStorage.getItem('token'));
//设置请求得基准地址
axios.defaults.baseURL = 'http://69.235.144.91:8048/'
const request = axios.create();
//设置请求头
// document.onkeydown = function () {
//     var e = window.event || arguments[0]
//     if (e.keyCode == 123) {
//       return false
//     } else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
//       return false
//     }
//   }
//   document.oncontextmenu = function () {
//     return false
//   }


axios.defaults.headers['content-type'] ='application/json';
request.interceptors.request.use(config => {
    // 给请求头加token的字段,值为token

    config.headers.token = window.localStorage.getItem('token')
   

    return config
})
  
//导出
export default request;
