2022-08-29 11:06:52 +00:00
|
|
|
import request from '@/utils/request'
|
|
|
|
|
|
2022-08-30 11:08:17 +00:00
|
|
|
// 微信公众号配置保存
|
2022-08-29 11:06:52 +00:00
|
|
|
export function setOaConfig(params: any) {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.post({ url: '/channel.official_account_setting/setConfig', params })
|
2022-08-29 11:06:52 +00:00
|
|
|
}
|
|
|
|
|
|
2022-08-30 11:08:17 +00:00
|
|
|
// 微信公众号配置详情
|
2022-08-29 11:06:52 +00:00
|
|
|
export function getOaConfig() {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.get({ url: '/channel.official_account_setting/getConfig' })
|
2022-08-29 11:06:52 +00:00
|
|
|
}
|
2022-09-14 09:29:57 +00:00
|
|
|
|
|
|
|
|
export interface Menu {
|
2022-09-16 08:31:24 +00:00
|
|
|
name: string
|
2024-08-28 16:24:01 +00:00
|
|
|
has_menu?: boolean
|
|
|
|
|
type?: string
|
2022-09-16 08:31:24 +00:00
|
|
|
url?: string
|
2024-08-28 16:24:01 +00:00
|
|
|
appid?: string
|
|
|
|
|
pagepath?: string
|
|
|
|
|
sub_button: Menu[] | any
|
2022-09-14 09:29:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2022-09-14 09:29:57 +00:00
|
|
|
* @description 获取菜单
|
|
|
|
|
*/
|
2022-09-16 08:31:24 +00:00
|
|
|
export function getOaMenu() {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.get({ url: '/channel.official_account_menu/detail' })
|
2022-09-14 09:29:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2022-09-14 09:29:57 +00:00
|
|
|
* @param { Menu } Menu
|
|
|
|
|
* @description 菜单保存
|
|
|
|
|
*/
|
2022-09-16 08:31:24 +00:00
|
|
|
export function setOaMenuSave(params: Menu | any) {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.post({ url: '/channel.official_account_menu/save', params })
|
2022-09-14 09:29:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2022-09-14 09:29:57 +00:00
|
|
|
* @param { Menu } Menu
|
|
|
|
|
* @description 菜单发布
|
|
|
|
|
*/
|
|
|
|
|
export function setOaMenuPublish(params: Menu | any) {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.post({ url: '/channel.official_account_menu/saveAndPublish', params })
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2024-08-28 16:24:01 +00:00
|
|
|
* @return { Promise }
|
|
|
|
|
* @param { string } reply_type
|
|
|
|
|
* @description 获取回复列表
|
2022-09-15 01:38:04 +00:00
|
|
|
*/
|
2024-08-28 16:24:01 +00:00
|
|
|
export function getOaReplyList(params: { reply_type: string }) {
|
|
|
|
|
return request.get({ url: '/channel.official_account_reply/lists', params })
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2022-09-15 01:38:04 +00:00
|
|
|
* @param { number } id
|
|
|
|
|
* @description 回复列表删除
|
|
|
|
|
*/
|
2024-08-28 16:24:01 +00:00
|
|
|
export function oaReplyDel(params: { id: number }) {
|
|
|
|
|
return request.post({ url: '/channel.official_account_reply/delete', params })
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2022-09-15 01:38:04 +00:00
|
|
|
* @param { number } id
|
|
|
|
|
* @description 回复状态修改
|
|
|
|
|
*/
|
2024-08-28 16:24:01 +00:00
|
|
|
export function changeOaReplyStatus(params: { id: number }) {
|
|
|
|
|
return request.post({ url: '/channel.official_account_reply/status', params })
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Reply {
|
2022-09-16 08:31:24 +00:00
|
|
|
content: string // 内容
|
2024-08-28 16:24:01 +00:00
|
|
|
content_type: number // 内容类型: 1=文本
|
2022-09-16 08:31:24 +00:00
|
|
|
keyword?: string // 关键词
|
2024-08-28 16:24:01 +00:00
|
|
|
matching_type?: number // 匹配方式: [1=全匹配, 2=模糊匹配]
|
2022-09-16 08:31:24 +00:00
|
|
|
name: string // 规则名称
|
|
|
|
|
status: number // 状态: 1=开启, 0=关闭
|
2024-08-28 16:24:01 +00:00
|
|
|
reply_type: number // 类型: 回复类型 1-关注回复 2-关键词回复 3-默认回复
|
|
|
|
|
reply_num: number // 回复数量`
|
2022-09-16 08:31:24 +00:00
|
|
|
sort: number // 排序
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2024-08-28 16:24:01 +00:00
|
|
|
* @description 回复添加
|
2022-09-15 01:38:04 +00:00
|
|
|
*/
|
2022-09-16 08:31:24 +00:00
|
|
|
export function oaReplyAdd(params: Reply) {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.post({ url: '/channel.official_account_reply/add', params })
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-09-16 08:31:24 +00:00
|
|
|
* @return { Promise }
|
2024-08-28 16:24:01 +00:00
|
|
|
* @description 回复编辑
|
2022-09-15 01:38:04 +00:00
|
|
|
*/
|
2022-09-16 08:31:24 +00:00
|
|
|
export function oaReplyEdit(params: Reply) {
|
2024-08-28 16:24:01 +00:00
|
|
|
return request.post({ url: '/channel.official_account_reply/edit', params })
|
2022-09-15 01:38:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2024-08-28 16:24:01 +00:00
|
|
|
* @return { Promise }
|
|
|
|
|
* @param { string } type
|
|
|
|
|
* @description 获取回复详情
|
2022-09-15 01:38:04 +00:00
|
|
|
*/
|
2024-08-28 16:24:01 +00:00
|
|
|
export function getOaReplyDetail(params: { id: number }) {
|
|
|
|
|
return request.get({ url: '/channel.official_account_reply/detail', params })
|
2022-09-16 08:31:24 +00:00
|
|
|
}
|