<template>
    <div id="token">{{token}}</div>
    <input type="button" id="getToken" @click="getToken" value="getToken">
</template>

<script>
    export default {
        name: "GetToken_1",
        data(){
            return{
                proxy:"/examServer",
                url:"/public_api/v1/api_for_vue_exam_1?student_id=",
                token:"no token",
                student_id: process.env.VUE_APP_STUDENT_ID
            }
        },
        methods:{
            getToken(){
                let url=this.proxy+this.url+this.student_id;
                let that=this;
                this.axios.get(url).then(
                    function (response) {
                        that.token=response.data;
                    },
                    function (error) {
                        console.log(error.data);
                    }

                )
            }
        },
        mounted() {
            window.myVue=this;
        }
    }
</script>

<style scoped>

</style>