Newer
Older
KaiFengH5 / src / api / publicApi.js
@鲁yixuan 鲁yixuan on 9 Jul 1 KB update
'use strict';
import request from '@/utils/request.js';
// 全局公共api,不属于其他模块
// h5 登录
export function appLogin(data) {
  return request({
    url: '/auth/login',
    headers: { isToken: false },
    method: 'post',
    data: data,
  });
}

// 退出方法
export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post',
  });
}

// 获取登录验证码
export function getCodeImg() {
  return request({
    url: '/code',
    headers: { isToken: false },
    method: 'get',
    timeout: 20000,
  });
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/system/user/getInfo',
    method: 'get',
  });
}

// 根据字典类型查询字典数据信息
export function getDicts(query) {
  return request({
    url: '/system/dict/data/type/' + query,
    method: 'get',
  });
}

// 文件图片上传
export function fileUpload(data) {
  return request({
    url: '/system/upload',
    method: 'post',
    data: data,
    timeout: 60 * 1000,
  });
}
// 文件删除
export function fileDelete(ids) {
  return request({
    url: '/system/' + ids,
    method: 'delete',
  });
}