import httpRequest from '@/utils/axios'
/**
 * 操作日志
 */
export function operateLog(params) {
  const logMsg = `操作人：${params.user.nickname}，操作：${params.type}`
  const data = {
    detail: logMsg
  }
  httpRequest.post('/api/live/admin/v2/system/log/write', data).then(res => {
  }).catch(() => {})
}
/**
 * 模糊搜索
 */
export function searchUserList(params) {
  return httpRequest.get('/api/cms/admin/v1/common/user-search', { params })
}
/**
 * 获取当前用户的角色和权限
 */
export function getUserRolesPermissions() {
  return httpRequest.get('/api/cms/admin/v1/common/user-detail')
}
/**
 * 文件上传
 */
export function fileUpload(formData) {
  return httpRequest({
    url: 'https://webapp-pub.oss-cn-beijing.aliyuncs.com',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    timeout: 900000,
    data: formData,
    withCredentials: false
  })
}
// 获取oss signature
export function getSignature() {
  return httpRequest.get('/api/usercenter/aliyun/get-signature')
}
