import axios from "axios"
import { useGlobalState } from '../store/index'

const state = useGlobalState()

export default function getToken() {
  return axios.post('http://10.83.68.108:8090/ghjgDataShareApi/dataShare/GetToken', {
    userName: 'ghzx',
    Password: 'R2h6eEAxMjM='
  },{
    headers: {
      "Content-Type": "application/json",
    },
  }).then(res => {
    if(res.data.status==='success' && res.data.data.token) {
      state.token.value = res.data.data.token
    } else {
      state.token.value = null
    }
  }).catch(e => {

  })
}