wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
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
import request from '@/config/axios'
 
export interface Font {
  id: string
  name: string
  fileName: string
  isDefault: boolean
  isBuiltin?: boolean
}
 
export const list = () => {
  return request.get({ url: '/typeface/listFont' }).then(res => {
    return res?.data
  })
}
 
export const create = (data = {}) => {
  return request.post({ url: '/typeface/create', data }).then(res => {
    return res?.data
  })
}
 
export const edit = (data = {}) => {
  return request.post({ url: '/typeface/edit', data }).then(res => {
    return res?.data
  })
}
 
export const deleteById = id => {
  return request.post({ url: '/typeface/delete/' + id, data: {} }).then(res => {
    return res?.data
  })
}
 
export const defaultFont = () => {
  return request.get({ url: '/typeface/defaultFont' }).then(res => {
    return res?.data
  })
}
 
export const uploadFontFile = async (data): Promise<IResponse> => {
  return request
    .post({
      url: '/typeface/uploadFile',
      data,
      loading: true,
      headersType: 'multipart/form-data;'
    })
    .then(res => {
      return res
    })
}