UNPKG

xlb-main-login

Version:

``` yarn install ```

67 lines (59 loc) 1.76 kB
import { locality } from './config' import { axios } from '@/utils/request' import state from '../store/index' const token2 = state.getters.token // 新增二维码 export function addCode(eventId, data, token, type) { return axios({ headers: { 'Content-Type': 'application/json;charset=UTF-8' }, url: locality + '/v1/' + eventId + '/spread/?' + 'type=' + type, method: 'post', data, }) } // 列表 export function codeList(eventId, params, type) { return axios({ url: locality + '/v1/' + eventId + '/spread/list/?' + 'type=' + type, method: 'get', params, }) } // 修改二维码 export function amendCode(eventId, data) { return axios({ headers: { 'Content-Type': 'application/json;charset=UTF-8' }, url: locality + '/v1' + eventId + '/spread/', method: 'put', data, }) } // 删除二维码 export function removeCode(eventId, id, token) { return axios({ url: locality + '/v1/' + eventId + '/spread/' + id + '/?access_token=' + token, method: 'delete', }) } // 获取二维码 export function acquireCode(eventId, id, type) { return axios({ url: locality + '/v1/' + eventId + '/spread/' + id + '/qr/?' + 'type=' + type, method: 'get', }) } // 刷新二维码 export function refreshCode(eventId, id) { return axios({ headers: { 'Content-Type': 'application/json;charset=UTF-8' }, url: locality + '/v1/' + eventId + '/spread/' + id + '/qr/?access_token=' + token2, method: 'put', }) } // 获取二维码链接 export function codeUrl(eventId, id, type) { return axios({ url: locality + '/v1/' + eventId + '/spread/' + id + '/url?' + 'type=' + type, method: 'get', }) }