const {request} = require("../request/index")
/**
 * 获取openId
 */
export const getOpenId = function (code) {
    return request({
        url: `/wx/openIdAndUnionId/${code}`,
        method: 'GET',
    })
}
/**
 * 获取用户信息
 */
export const getUserData = function (params) {
    return request({
        url: '/westreamUser/userInfo',
        method: 'GET',
        data: params
    })
}
/**
 * 查询省市区对应城市代码
 */
export const getCityNameCode = function (data) {
    return request({
        url: '/city/cityNameAndCode',
        method: 'GET',
        data
    })
}
/**
 * 查询省市区对应租户数据
 */
export const getTenantData = function (data) {
    return request({
        url: '/index/tenants/areaCode',
        method: 'GET',
        data
    })
}

/**
 * 进入小程序，记录次数
 */
export const enterMini = function (data) {
    return request({
        url: '/westreamUser/login',
        method: 'POST',
        data
    })
}


/**
 * 在线心跳
 */
export const IsOnlive = function (data) {
    return request({
        url: '/index/westreamUser/edit',
        method: 'PUT',
        data
    })
}
