<template>
    <hr>
    <div>{{message}}</div>
    <button id="button_delete" @click='deletePerson'>删除</button>
</template>

<script>
    export default {
        name: "DeletePerson",
        data(){
            return{
                proxy:"/springbootServer",
                urlDelete:"/PersonBaseInfo_881_1/delete",
                message:"如确定删除请点击删除按钮",
                id:this.$route.query.id,

            }
        },
        methods:{
            deletePerson(){
                let url = this.proxy+this.urlDelete+"?id="+this.id;
                console.log(url);
                let that = this;

                this.axios.get(url).then(
                    function (response) {
                        console.log(response)
                        //console.log(response.data.code);
                        that.message="删除成功";
                    },
                    function (error) {
                        that.message="删除失败";
                        console.log(error.data);
                    }
                )
            }
        },
        mounted() {
            //this.delete();
            window.myVue=this;
        }
    }
</script>

<style scoped>

</style>


