完善通道创建功能,添加参数验证与格式化输出

This commit is contained in:
2025-04-14 16:00:46 +08:00
parent e928b5a270
commit 4315c8eba9
5 changed files with 233 additions and 36 deletions

24
src/actions/channel.ts Normal file
View File

@@ -0,0 +1,24 @@
import {callByUser} from '@/actions/base'
async function createChannels(params: {
resource_id: number
protocol: number
auth_type: number
count: number
prov?: string
city?: string
isp?: string
}) {
return callByUser<CreateChannelsResp[]>('/api/channel/create', params)
}
type CreateChannelsResp = {
host: string
port: string
username?: string
password?: string
}
export {
createChannels,
}