You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.3 KiB
68 lines
2.3 KiB
import { createCURD } from '@/service/base.ts'
|
|
import { WebSite } from '@/types'
|
|
import request from '@/request.ts'
|
|
import { IWebsiteDomain, INameServer } from '@/types/website/domain'
|
|
import { IWebsiteDnsRecords } from '@/types/website/record'
|
|
import { IWebsiteDnsAccount } from '@/types/website/dns_account'
|
|
|
|
const websitesServ = {
|
|
ssl: {
|
|
...createCURD<any, WebSite.ISSL>('/website/ssl'),
|
|
upload: async (params: WebSite.SSLUploadDto) => {
|
|
return request.post<any, WebSite.SSLUploadDto>('/website/ssl/upload', params)
|
|
},
|
|
download: async (params: any) => {
|
|
return request.download('/website/ssl/download', params)
|
|
},
|
|
},
|
|
acme: {
|
|
...createCURD<any, WebSite.IAcmeAccount>('/website/acme')
|
|
},
|
|
dns: {
|
|
...createCURD<any, WebSite.IDnsAccount>('/website/dns_account'),
|
|
sync: async (id: any) => {
|
|
return request.post<any, WebSite.IDnsAccount>('/website/dns_account/sync', { id: id })
|
|
}
|
|
},
|
|
ca: {
|
|
...createCURD<any, WebSite.ICA>('/website/ca'),
|
|
obtainSsl: async (params: WebSite.ISSLObtainByCA) => {
|
|
return request.post<any, WebSite.ISSLObtainByCA>('/website/ca/obtain_ssl', params)
|
|
},
|
|
},
|
|
domain: {
|
|
...createCURD<any, IWebsiteDomain>('/website/domain'),
|
|
//remark
|
|
remark: async (params: { id: string, remark: string }) => {
|
|
return request.post<any, any>('/website/domain/remark', params)
|
|
},
|
|
//tag
|
|
tag: async (params: { id: string, tags: string}) => {
|
|
return request.post<any, any>('/website/domain/tag', params)
|
|
},
|
|
//binding
|
|
binding: async (params: { id:string , user_id: string }) => {
|
|
return request.post<any, any>('/website/domain/binding', params)
|
|
},
|
|
//group
|
|
group: async (params: { id: string[], group_id: string }) => {
|
|
return request.post<any, any>('/website/domain/group', params)
|
|
},
|
|
describeDomainNS: async (params: { id: number }) => {
|
|
return request.post<INameServer, any>('/website/domain/describe_domain_ns', params)
|
|
},
|
|
|
|
},
|
|
record: {
|
|
...createCURD<any, IWebsiteDnsRecords>('/website/dns_records'),
|
|
//
|
|
},
|
|
dnsAccount: {
|
|
...createCURD<any, IWebsiteDnsAccount>('/website/dns_account'),
|
|
sync: async (params: IWebsiteDnsAccount) => {
|
|
return request.post<any, IWebsiteDnsAccount>('/website/dns_account/sync', params)
|
|
}
|
|
},
|
|
}
|
|
|
|
export default websitesServ
|