gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import type { PageParam, PageResult } from '..\..\..\packages\effects\request\src';
 
import { requestClient } from '#/api/request';
 
export namespace MpAccountApi {
  /** 公众号账号信息 */
  export interface Account {
    id: number;
    name: string;
    account?: string;
    appId?: string;
    appSecret?: string;
    token?: string;
    aesKey?: string;
    qrCodeUrl?: string;
    remark?: string;
    createTime?: Date;
  }
}
 
/** 查询公众号账号列表 */
export function getAccountPage(params: PageParam) {
  return requestClient.get<PageResult<MpAccountApi.Account>>(
    '/mp/account/page',
    {
      params,
    },
  );
}
 
/** 查询公众号账号详情 */
export function getAccount(id: number) {
  return requestClient.get<MpAccountApi.Account>(`/mp/account/get?id=${id}`);
}
 
/** 查询公众号账号列表 */
export function getSimpleAccountList() {
  return requestClient.get<MpAccountApi.Account[]>(
    '/mp/account/list-all-simple',
  );
}
 
/** 新增公众号账号 */
export function createAccount(data: MpAccountApi.Account) {
  return requestClient.post('/mp/account/create', data);
}
 
/** 修改公众号账号 */
export function updateAccount(data: MpAccountApi.Account) {
  return requestClient.put('/mp/account/update', data);
}
 
/** 删除公众号账号 */
export function deleteAccount(id: number) {
  return requestClient.delete(`/mp/account/delete?id=${id}`);
}
 
/** 生成公众号账号二维码 */
export function generateAccountQrCode(id: number) {
  return requestClient.put(`/mp/account/generate-qr-code?id=${id}`);
}
 
/** 清空公众号账号 API 配额 */
export function clearAccountQuota(id: number) {
  return requestClient.put(`/mp/account/clear-quota?id=${id}`);
}