<template>
    <div style="height:100%;background-color:#FAFAFA;">
        <div style="text-align:center;">
            <Button style="margin:40px;" @click="Click_3">Token</Button>
            <Button style="margin:40px;" @click="Click_1">待办</Button>
            <Button style="margin:40px;" @click="Click_5">更新待办</Button>
            <Button style="margin:40px;" @click="Click_2">绑定用户</Button>
            <Button style="margin:40px;" @click="Click_4">消息</Button>
        </div>
    </div>
</template>

<script>
import qs from 'qs';

export default {
    data() {
        return {
            token:'',
        }
    },
    created() {

    },
    methods: {
        Click_5(){
            let token = JSON.parse(sessionStorage.getItem('token'));
                       //OA更新待办接口数据参数
            
            let b = JSON.stringify(shuzu);//转字符
            this.$axios({
                url:'/donglong/seeyon/rest/thirdpartyPending/updatePendingState?token='+token,
                method:'post',
                data:b.toString(),
                headers:{
                    'Content-Type':'application/json'
                }
            }).then(r=>{
                console.log(r.data);
            })
        },
        Click_4(){
            let token = JSON.parse(sessionStorage.getItem('token'));
            let shuzu ={
                thirdpartyMessageId:'3211',
                thirdpartyRegisterCode:'3002',
                messageContent:'测试消息内容，处理消息意见',
                thirdpartySenderId:'8888',
                thirdpartyReceiverId:'1111',
                creation_date:'2018-11-21 11:01:23',
                messageType:'4',
                downloadUrl:'',
                messageURL:'www.baidu.com',
                messageH5URL:'www.baidu.com',
                appParam:''
            }
            let b = JSON.stringify(shuzu);//转字符
            this.$axios({
                url:'/donglong/seeyon/rest/thirdpartyMessage/receive/singleMessage?token='+token,
                method:'post',
                data:b.toString(),
                headers:{
                    'Content-Type': 'application/json'
                   }
            }).then(r=>{
                console.log(r);
            })
        },
        Click_3(){
            // this.$axios.get('/donglong/seeyon/rest/token/rest/c568f2a8-66c0-40b0-ae87-392410b4d473').then(r=>{
            this.$axios({
                url: 'http://192.168.1.102:8080/seeyon/rest/token/rest/908343e7-a435-4053-95c1-8aebb1014ba2',
                method:'get',
                headers:{
                    'Content-Type': 'application/json'
                   }
            }).then(r=>{
                console.log(r)
                this.token = r.data.id;
                sessionStorage.setItem('token',JSON.stringify(r.data.id));
            })
        },
        Click_1(){
            let token = JSON.parse(sessionStorage.getItem('token'));
            var nowDate = new Date();
            //当前日期
            let date = nowDate.getFullYear()+'-'+(nowDate.getMonth()+1)+'-'+nowDate.getDate()+' '+nowDate.getHours()+':'+nowDate.getMinutes()+':'+nowDate.getSeconds();
            let shuzu ={
                registerCode: "3002",
                taskId: "11113",
                title: "新年快乐3",
                senderName: "ceshi2",
                state: "0",
                thirdSenderId: "1111",
                thirdReceiverId: "1111",
                creationDate: "2019-12-24 13:11:11",
                url: "http://www.xinlang.com",
                h5url: ""
            }
            console.log(JSON.stringify(shuzu));
            this.$axios({
                url: 'http://192.168.1.102:8080/seeyon/rest/thirdpartyPending/receive?token='+token,
                method:'post',
                //发送格式为json
                data:JSON.stringify(shuzu),
                headers:{
                    'Content-Type': 'application/json'
                   }
            }).then(r=>{
                console.log(r);
            })
        },
        Click_2(){
            let token = JSON.parse(sessionStorage.getItem('token'));
            let a ={
           
                    registerCode: "3001",
                    thirdUserId: "100048",
                    thirdLoginName: "xiaocaixia",
                    thirdName: "肖彩霞",
                    thirdCode: "100048",
                    }
                // 邓换换	denghuanhuan   100036
                // 赵学云	zhaoxueyun	123654	100035
                // 丁元	dingyuan	123654	100034
                // 陈瑞秀	chenruixiu	123654	100027
                // 王淑霞	wangshuxia	123654	100087
                // 测试2    ceshi2  1   100016
            let b = JSON.stringify(a);//转字符
            console.log(b)
            this.$axios({
                url: '/donglong/'+'seeyon/rest/thirdpartyUserMapper/binding/singleUser?token='+token,
                method:'post',
                //发送格式为json
                data:b.toString(),
                headers:{
                    'Content-Type': 'application/json'
                   }
            }).then(r=>{
                console.log(r);
            })
        }
    },
}
</script>

<style>

</style>
