Login.vue 857 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <h3 />
  3. </template>
  4. <script setup>
  5. import Common from '../common/Common';
  6. import { useRouter } from 'vue-router';
  7. import { onMounted,getCurrentInstance } from 'vue';
  8. import TokenClientResource from '../api/base/TokenClientResource';
  9. const router = useRouter();
  10. const { proxy } = getCurrentInstance();
  11. onMounted(() => {
  12. getVerification();
  13. });
  14. const getVerification = () => {
  15. TokenClientResource.getVerificationMethod().then(
  16. successData => {
  17. if (successData.errorCode === 0) {
  18. if(successData.data === 'graphic') {
  19. router.push('/loginGraphic');
  20. } else{
  21. router.push('/loginNode');
  22. }
  23. } else {
  24. Notify.error(proxy.$t('lang.Notify.fail'), successData.errorMessage);
  25. }
  26. }, error => {
  27. Common.processException(error);
  28. });
  29. };
  30. </script>
  31. <style scoped></style>