api.js 2.19 KB
// export let url = 'http://192.168.9.208:20080/api/v1'
// export let url = 'http://52.1.113.109:20080/api/v1'
const { urls = '', picUrls = '', mapUrls = '' } = window.SECURITY_CONF

export const mapUrl = mapUrls || location.host
export let IP = urls || location.host
if (IP.indexOf('9.102') > -1 || IP.indexOf('localhost') > -1) {
    IP = 'https://store.keliuyun.com/report'
        //  IP="/report"
}
// IP="/report"
export let url = `${IP}` // '/api1/report' //
export let menus = `${url}/auth/api/auth/apps/23660e5593563b27832c2b8f490b458e/menus`

let timer = () => {
    return new Date().getTime()
}
export let auth = {
    login: `${url}/users/login`,
    accountid: `${url}/accounts`,
    user: `${url}/users`,
    edituser(userid) {
        return `${url}/users/${userid}`
    },
    role: `${url}/auth/roles`,
    editrole(roleid) {
        return `${url}/auth/roles/${roleid}`
    },
    menusRole(roleid) {
        return `${url}/auth/roles/${roleid}/apps/23660e5593563b27832c2b8f490b458e/menus`
    },
    userRole(userid) {
        return `${url}/auth/users/${userid}/roles`
    },
    deleteRole(roleid) {
        return `${url}/auth/roles/${roleid}`
    },
    deleteuserRole(userid, roleid) {
        return `${url}/auth/users/${userid}/roles/${roleid}`
    },
    perms(roleid) {
        return `${url}/auth/roles/${roleid}/perms`
    },
    ugrps: `${url}/auth/ugrps`,
    delugrps(ugrp_unid) {
        return `${url}/auth/ugrps/${ugrp_unid}`
    },
    userTogroup(groupid) {
        return `${url}/auth/ugrps/${groupid}/users`
    },
    delUserToGroup(groupid, userid) {
        return `${url}/auth/ugrps/${groupid}/users/${userid}`
    },
    ///-------cyl add
    getRoleUsers(roleid) {
        return `${url}/auth/roles/${roleid}/users`
    },
}
export let org = {
    getorgtree: `${url}/org/tree`,
    getorg: `${url}/org`,
    deleteorg(org_unid) {
        return `${url}/org/${org_unid}`
    },
    getvchan: `${url}/org/vchans`,
    getvchanList: `${url}/org/vchans/list`,
    editvchan(id) {
        return `${url}/org/vchans/${id}`
    }
}

export let faceweb = `${url}/face_web`
export let picUrl = picUrls || "https://vion-retail.oss-cn-beijing.aliyuncs.com/"
    // export let picUrl ="http://192.168.9.239/"