<template>
  <div class="app-container home">
    <el-row :gutter="20">
      <el-col :sm="24" style="padding: 20px">
          <el-button
            type="primary"
            plain
            @click="goTarget('test2', '1')"
            >TEST2-邢保振</el-button
          >
        <el-button
            type="primary"
            plain
            @click="goTarget('test2', '2')"
        >TEST2-张猛</el-button
        >
      </el-col>
      <el-col :sm="24" style="padding: 20px">
        <el-button
            type="primary"
            plain
            @click="goTarget('pre', '1')"
        >PRE-邢保振</el-button
        >
        <el-button
            type="primary"
            plain
            @click="goTarget('pre', '2')"
        >PRE-张猛</el-button
        >
      </el-col>
    </el-row>
    <el-divider />
  </div>
</template>

<script setup name="Index">
const version = ref('3.8.6')

function goTarget(env, user) {
  let token = '';
  if(env === 'test2') {
    token = user === '1' ? 'ZXlKaGJHY2lPaUpJVXpVeE1pSjkuZXlKemRXSWlPaUl5TWprMElpd2ljbTlzWlNJNklrMUJUa0ZIUlZJaUxDSm5jbTkxY0Vsa0lqb2lNVEUxTWlJc0ltTjFjM1J2YldWeVNXUWlPakV3TURJMUxDSmxibVJVYVcxbElqcDdJbmxsWVhJaU9qSXdPVGtzSW0xdmJuUm9WbUZzZFdVaU9qRXlMQ0p0YjI1MGFDSTZJa1JGUTBWTlFrVlNJaXdpWkdGNVQyWk5iMjUwYUNJNk16RXNJbVJoZVU5bVdXVmhjaUk2TXpZMUxDSmtZWGxQWmxkbFpXc2lPaUpVU0ZWU1UwUkJXU0lzSW1odmRYSWlPakFzSW0xcGJuVjBaU0k2TUN3aWMyVmpiMjVrSWpvd0xDSnVZVzV2SWpvd0xDSmphSEp2Ym05c2IyZDVJanA3SW1OaGJHVnVaR0Z5Vkhsd1pTSTZJbWx6YnpnMk1ERWlMQ0pwWkNJNklrbFRUeUo5ZlN3aWRYTmxja2xrSWpveU1qazBMQ0oxZFdsa0lqb2lNREpGTWpFNE1VWkRRa0pHTkVZM09FRkVOREEzTmtRd09UZEJOakpHTkRJaUxDSmxiV0ZwYkNJNkluaGllakZBY21WNWRXNHVZMjl0SW4wLmtxX2xMdHp0TjU1emRsM2QtX2Y5TnQ1ZWV6TFBLZkhqaERyaTFZTGJqWEsyaVhEa1k0OEhkQUJBSjQwOGd4cE1XdWdGNWRXQ2dHaEhlZ21WY09KeWZB'
        : 'ZXlKaGJHY2lPaUpJVXpVeE1pSjkuZXlKemRXSWlPaUl5TWpZNElpd2ljbTlzWlNJNklrMUJUa0ZIUlZJaUxDSm5jbTkxY0Vsa0lqb2lNVEUxTWlJc0ltTjFjM1J2YldWeVNXUWlPakV3TURJMUxDSmxibVJVYVcxbElqcDdJbmxsWVhJaU9qSXdPVGtzSW0xdmJuUm9WbUZzZFdVaU9qRXlMQ0p0YjI1MGFDSTZJa1JGUTBWTlFrVlNJaXdpWkdGNVQyWk5iMjUwYUNJNk16RXNJbVJoZVU5bVdXVmhjaUk2TXpZMUxDSmtZWGxQWmxkbFpXc2lPaUpVU0ZWU1UwUkJXU0lzSW1odmRYSWlPakFzSW0xcGJuVjBaU0k2TUN3aWMyVmpiMjVrSWpvd0xDSnVZVzV2SWpvd0xDSmphSEp2Ym05c2IyZDVJanA3SW1OaGJHVnVaR0Z5Vkhsd1pTSTZJbWx6YnpnMk1ERWlMQ0pwWkNJNklrbFRUeUo5ZlN3aWRYTmxja2xrSWpveU1qWTRMQ0oxZFdsa0lqb2lNMFEwT1VNMk0wRXhSRE0xTkRVNU5rRkNNVFkyTWpjMU1VSTVSRVpDTmpNaUxDSmxiV0ZwYkNJNklucG9ZVzVuYldWdVowQnlaWGwxYmk1amIyMGlmUS43N1FVMndBN3ozbGRGdXVNbHc2a1V0a1JqOGFvUHN1eFBiUngtMGlKOG9uLTk4ajZnRDFqbVRGYnczUWdoV3RERk1HQVFHTi0xNTM0Vm1IV2pLUWR4dw=='
  }else {

  }
  let authCode = {
    user: 'admin',
    uniqueCode: "c_" + new Date().getTime(),
    token: token
  }
  const url = "https://" + env + ".adsdesk.cn?authToken=" + JSON.stringify(authCode)
  console.log(url)
  // alert(url)
  window.open(url, '__blank')
}
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
</style>

