first commit
This commit is contained in:
40
app_vue/src/components/GetToken_1.vue
Normal file
40
app_vue/src/components/GetToken_1.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<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: "202241401015"
|
||||
}
|
||||
},
|
||||
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>
|
Reference in New Issue
Block a user