feat(admin-web): add Vue 3 admin console and deployment configs
- Add admin-web/ with Vite + Vue 3 + Element Plus + Vue Router - Add 8 management pages: dashboard, channel subject/account, conversation, person, tag, send record (with test send), inbound flow - Add API client modules for account/channel/crm/send/flow - Add Dockerfile and nginx config for admin-web - Add Dockerfile for mci-server - Add docker-compose.app.yml for one-command app deployment - Add K8s deployment manifests for backend/admin-web/channel-service - Update scripts/local-up.sh with shared network and --with-apps option
This commit is contained in:
13
admin-web/src/api/account.ts
Normal file
13
admin-web/src/api/account.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import client from './client'
|
||||
|
||||
export function createTenant(data: { tenantCode: string; tenantName: string }) {
|
||||
return client.post('/api/v1/account/tenant', data)
|
||||
}
|
||||
|
||||
export function createUser(data: { username: string; password: string; realName?: string }) {
|
||||
return client.post('/api/v1/account/user', data)
|
||||
}
|
||||
|
||||
export function login(data: { tenantCode: string; username: string; password: string }) {
|
||||
return client.post('/api/v1/account/login', data)
|
||||
}
|
||||
21
admin-web/src/api/channel.ts
Normal file
21
admin-web/src/api/channel.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import client from './client'
|
||||
|
||||
export function createChannelSubject(data: any) {
|
||||
return client.post('/api/v1/channel-subject', data)
|
||||
}
|
||||
|
||||
export function createChannelAccount(data: any) {
|
||||
return client.post('/api/v1/channel-account', data)
|
||||
}
|
||||
|
||||
export function createConversation(data: any) {
|
||||
return client.post('/api/v1/conversation', data)
|
||||
}
|
||||
|
||||
export function bindConversationAccount(conversationId: number, data: any) {
|
||||
return client.post(`/api/v1/conversation/${conversationId}/bind-account`, data)
|
||||
}
|
||||
|
||||
export function bindConversationTags(conversationId: number, data: any) {
|
||||
return client.post(`/api/v1/conversation/${conversationId}/bind-tags`, data)
|
||||
}
|
||||
25
admin-web/src/api/client.ts
Normal file
25
admin-web/src/api/client.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const client = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '/msg-platform',
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
|
||||
client.interceptors.request.use((config) => {
|
||||
const tenantCode = localStorage.getItem('mci-tenant-code') || 'default'
|
||||
config.headers['X-Tenant-Code'] = tenantCode
|
||||
return config
|
||||
})
|
||||
|
||||
client.interceptors.response.use(
|
||||
(response) => response.data,
|
||||
(error) => {
|
||||
const message = error.response?.data?.message || error.message || '请求失败'
|
||||
return Promise.reject(new Error(message))
|
||||
}
|
||||
)
|
||||
|
||||
export default client
|
||||
13
admin-web/src/api/crm.ts
Normal file
13
admin-web/src/api/crm.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import client from './client'
|
||||
|
||||
export function createPerson(data: any) {
|
||||
return client.post('/api/v1/person', data)
|
||||
}
|
||||
|
||||
export function listTags() {
|
||||
return client.get('/api/v1/tag/list')
|
||||
}
|
||||
|
||||
export function createTag(data: any) {
|
||||
return client.post('/api/v1/tag', data)
|
||||
}
|
||||
9
admin-web/src/api/flow.ts
Normal file
9
admin-web/src/api/flow.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import client from './client'
|
||||
|
||||
export function createFlowDefinition(data: any) {
|
||||
return client.post('/api/v1/flow/definition', data)
|
||||
}
|
||||
|
||||
export function listFlowDefinitions() {
|
||||
return client.get('/api/v1/flow/definition/list')
|
||||
}
|
||||
13
admin-web/src/api/send.ts
Normal file
13
admin-web/src/api/send.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import client from './client'
|
||||
|
||||
export function sendMessage(data: any) {
|
||||
return client.post('/api/v1/send', data)
|
||||
}
|
||||
|
||||
export function testSendMessage(data: any) {
|
||||
return client.post('/api/v1/send/test', data)
|
||||
}
|
||||
|
||||
export function listSendRecords(taskId: string) {
|
||||
return client.get(`/api/v1/send/${taskId}/records`)
|
||||
}
|
||||
Reference in New Issue
Block a user