import $api from './class-api'
import request from '@/utils/request'

export const $version = new $api('/api/tbVersion')
/**
 * 修改当前选中 版本
 * @returns
 */
export function $upSel(data) {
    return request({
        url: 'api/tbVersion/upSel',
        method: "put",
        data: {
            shopId: localStorage.getItem("shopId"),
            ...data
        }
    });
}

/**
 * 上传版本文件
 * @returns
 */
export function $uploadVersionFile(file, par) {
    var data = new FormData()
    data.append('file', file)
    for(let i in par){
        if(i!=='file'){
            data.append(i, par[i])
        }
    }
    return request({
        url: 'api/qiNiuContent/uploadVersionFile',
        method: "post",
        data
    });
}
/**
 * 修改当前选中 版本
 * @returns
 */
export function $getCredentials(data) {
    return request({
        url: 'api/qiNiuContent/getCredentials',
        method: "get",
        data: {
            shopId: localStorage.getItem("shopId"),
            ...data
        }
    });
}

