

/**
 * 分享相关接口
 */
import qs from 'qs'
import request from '@/utils/request'
const baseUrl = '/v1/api'

export const share = data => {
    return request({
        url: baseUrl + '/doc/share',
        method: 'post',
        data
    })
}

export const getShare = params => {
    return request({
        url: baseUrl + '/user/todolist/mine',
        method: 'get',
        params
    })
}

// 获取我的分享的列表(个人使用)
export const getMyShareList = params => {
    return request({
        url: baseUrl + '/folder/share/shareList',
        // url: baseUrl + '/folder/share/searchShareList',
        method: 'get',
        params
    })
}

// 取消分享（个人使用）
export const removeShare = params => {
    return request({
        url: baseUrl + '/folder/share/removeShare',
        method: 'get',
        params
    })
}


// 分享管理列表（管理员使用）
export const getAdminShareList = params => {
    return request({
        url: baseUrl + '/folder/share/searchShareList',
        method: 'get',
        params
    })
}


// 分享审核（管理员使用）
export const verifyShare = data => {
    return request({
        url: baseUrl + '/folder/share/verifyShare',
        method: 'post',
        data: qs.stringify(data),
        headers: { 'content-type': 'application/x-www-form-urlencoded' }
    })
}

