gaosp
2024-01-29 a359332dbd9fbedee6db289a8dfcf1986d8639b1
src/api/Api.js
@@ -1,7 +1,7 @@
/*
 * @Date: 2024-01-10 20:37:45
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-18 23:37:37
 * @LastEditTime: 2024-01-29 20:33:21
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/api/Api.js
 */
import ajax from '@/utils/ajax'
@@ -105,7 +105,12 @@
    userList: {
        url: '/user/list',
        method: 'GET'
    }
    },
    getbyid: {
        url: '/machinedata/getbyid',
        method: 'POST'
    },
}
// 正式环境配置地址
export const URL_CFG = {
@@ -132,6 +137,9 @@
 */
function sendRequest(method, params) {
    return ajax.postJson(URL_CFG.BASE_URL + method, params)
}
function sendFormRequest(method, params) {
    return ajax.post(URL_CFG.BASE_URL + method, params)
}
/*
* @param method
@@ -183,6 +191,14 @@
        
    }
}
export function getFormRequest (key,params) {
    if (getFnObj[key].method === 'GET') {
        // return getData(getFnObj[key].url,params || {})
    } else {
        return sendFormRequest(getFnObj[key].url, params || {})
    }
}
export function getUrl (key) {
    return getFnObj[key].url
}