import axios from 'axios';
import qs from 'qs';
let loginForm=JSON.parse(window.localStorage.getItem(`${location.host}loginForm`))
const writeLog=(type,data)=>{
  let log=type+' '+new Date().format('yyyy-MM-dd hh:mm:ss')+' '+loginForm.number+' '+location.host+' '+data
    axios.post("//"+document.location.logServe+"/ht/api/web/log/upload",{log:log}).then(res=>{
      if(res.code!=0){
        console.log('writeLog',res.msg)
      }
    }).catch(err=>{
      console.log(err)
    })
}
export default writeLog
