
modified: app_sb/src/main/resources/application.yml new file: app_vue/.env.development modified: app_vue/src/components/GetToken_1.vue modified: app_vue/vue.config.js
40 lines
1000 B
Vue
40 lines
1000 B
Vue
<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> |