import OSS from "ali-oss"
async function ossClie(filePath) {
    const client = new OSS({
        region: 'oss-cn-chengdu',
        accessKeyId: 'LTAI4G7HmULgHMF7vxYcVYHr',
        accessKeySecret: 'AblaeUKDZEeBk5RB4KbEYtl2Qihep9',
        bucket: 'go-to-run',
    });
    return await putObject(client, filePath)
}
async function putObject(client, data) {
    try {
        const options = {
            meta: { temp: "demo" },
            mime: "json",
            success_action_status:'200',
            headers: { "Content-Type": "text/plain","content-type":"kuka", },
        };
       return await client.put("banner/"+data.name, data, options);
    } catch (e) {
        console.log(e);
    }
}

export default ossClie