xlb-main-login
Version:
``` yarn install ```
179 lines (157 loc) • 4.53 kB
JavaScript
import { wei_url } from '@/api/config'
import { axios } from '@/utils/request'
//聊天敏感词列表
export function getSensitivelist(params) {
return axios({
url: wei_url + '/wecom-conversation/sensitive-word-setting/',
method: 'get',
params,
})
}
// 开启检测
export function enableSwitch(data,enable) {
if(!enable){
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/sensitive-word-setting/enable',
method: 'put',
data
})
}else{
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/sensitive-word-setting/disable',
method: 'put',
data
})
}
}
// 删除
export function del(params) {
return axios({
url: wei_url + '/wecom-conversation/sensitive-word-setting/',
method: 'delete',
params
})
}
//**************新增和编辑******************/
//敏感词新增
export function add(data) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/sensitive-word-setting/',
method: 'post',
data,
})
}
//敏感词编辑
export function edit(data) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/sensitive-word-setting/',
method: 'put',
data,
})
}
// 回显
export function getDetailAA(params) {
return axios({
url: wei_url + '/wecom-conversation/sensitive-word-setting/obj',
method: 'get',
params
})
}
//******************* 单聊敏感词 ************************/
export function getSinglelist(params) {
return axios({
url: wei_url + '/wecom-conversation/sensitive-word-record/',
method: 'get',
params,
})
}
//导出
export function getSingleExport(params) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/sensitive-word-record/e',
method: 'get',
params,
responseType: "blob"
})
}
//******************* 群聊敏感词 ************************/
export function getGrouplist(params) {
return axios({
url: wei_url + '/wecom-conversation/sensitive-word-record/',
method: 'get',
params,
})
}
//导出
export function getGroupExport(params) {
return axios({
url: wei_url + '/wecom-conversation/sensitive-word-record/e',
method: 'get',
params,
})
}
//******************* 单聊超时记录 ************************/// 所属成员
export function singleChatTimeoutlist(params) {
return axios({
url: wei_url + '/wecom-conversation/timeout-record/',
method: 'get',
params,
})
}
//导出
export function singleChatTimeoutExport(params) {
return axios({
headers: { 'Content-Type': 'multipart/form-data' },
url: wei_url + '/wecom-conversation/timeout-record/e',
method: 'get',
responseType: 'Blob',
params,
}).then(res => {
const fileName = '导出.xlsx'
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([res]), fileName)
} else {
const url = window.URL.createObjectURL(new Blob([res],{type:"application/vnd.ms-excel"}))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
})
}
//******************* 群聊超时记录 ************************/
//新增
export function groupChatTimeoutAdd(data) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/timeout-setting/',
method: 'post',
data,
})
}
//编辑
export function groupChatTimeoutEdit(data) {
return axios({
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
url: wei_url + '/wecom-conversation/timeout-setting/',
method: 'put',
data,
})
}
// 回显
export function groupChatTimeoutDetail() {
return axios({
url: wei_url + '/wecom-conversation/timeout-setting/obj',
method: 'get',
})
}