Compare commits
7 Commits
1baef251ab
...
feature/wo
| Author | SHA1 | Date | |
|---|---|---|---|
| 10519e7500 | |||
| 79d0a2a9fe | |||
| 20bf8138a8 | |||
| 1c0e966b7a | |||
| 57ca523b5a | |||
| f72508aa83 | |||
| 61577be41f |
@@ -1,16 +0,0 @@
|
||||
FROM node:18-alpine
|
||||
|
||||
# 配置Alpine国内镜像源(加速apk)
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install --registry=https://registry.npmmirror.com
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
30
ngnix.conf
30
ngnix.conf
@@ -7,6 +7,13 @@ server {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# MinIO 域名转发(HTTP)
|
||||
server {
|
||||
listen 80;
|
||||
server_name minio.redpowerfuture.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
# HTTP 重定向到 HTTPS(其他域名)
|
||||
server {
|
||||
listen 80;
|
||||
@@ -106,3 +113,26 @@ server {
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
# MinIO 域名转发(HTTPS)
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name minio.redpowerfuture.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/minio.redpowerfuture.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/minio.redpowerfuture.com.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
location / {
|
||||
proxy_pass http://minio.redpowerfuture.com:9000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface ApiInterfaceQueryParams {
|
||||
|
||||
// 创建接口参数
|
||||
export interface CreateApiInterfaceParams {
|
||||
platformId: string | number;
|
||||
platformId: number;
|
||||
name: string;
|
||||
code: string;
|
||||
url: string;
|
||||
@@ -22,6 +22,7 @@ export interface CreateApiInterfaceParams {
|
||||
requestConfig?: Record<string, any>;
|
||||
responseConfig?: Record<string, any>;
|
||||
limitConfig?: Record<string, any>;
|
||||
tableDefinition?: Record<string, any>;
|
||||
}
|
||||
|
||||
// 更新接口参数
|
||||
@@ -50,6 +51,7 @@ export interface ApiInterfaceInfo {
|
||||
requestConfig?: Record<string, any>;
|
||||
responseConfig?: Record<string, any>;
|
||||
limitConfig?: Record<string, any>;
|
||||
tableDefinition?: Record<string, any>;
|
||||
createdBy?: string;
|
||||
createdAt?: number;
|
||||
updatedBy?: string;
|
||||
@@ -59,7 +61,7 @@ export interface ApiInterfaceInfo {
|
||||
// 获取接口列表
|
||||
export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/listApiInterfaces',
|
||||
url: '/data-engine/api/interface/controller/listApiInterfaces',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
@@ -68,7 +70,7 @@ export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||
// 获取接口详情
|
||||
export function getApiInterface(id: string) {
|
||||
return request({
|
||||
url: '/api/interface/controller/getApiInterface',
|
||||
url: '/data-engine/api/interface/controller/getApiInterface',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
@@ -77,7 +79,7 @@ export function getApiInterface(id: string) {
|
||||
// 创建接口
|
||||
export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/createApiInterface',
|
||||
url: '/data-engine/api/interface/controller/createApiInterface',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@@ -86,7 +88,7 @@ export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||
// 修改接口
|
||||
export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/updateApiInterface',
|
||||
url: '/data-engine/api/interface/controller/updateApiInterface',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -95,7 +97,7 @@ export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||
// 更新接口状态
|
||||
export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/updateApiInterfaceStatus',
|
||||
url: '/data-engine/api/interface/controller/updateApiInterfaceStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -104,7 +106,7 @@ export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||
// 删除接口
|
||||
export function deleteApiInterface(id: string) {
|
||||
return request({
|
||||
url: '/api/interface/controller/deleteApiInterface',
|
||||
url: '/data-engine/api/interface/controller/deleteApiInterface',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
|
||||
@@ -26,8 +26,7 @@ export interface CreateDatasourcePlatformParams {
|
||||
requestTimeoutMs?: number;
|
||||
maxRetries?: number;
|
||||
retryDelayMs?: number;
|
||||
createdBy?: string;
|
||||
updatedBy?: string;
|
||||
authConfig?: Record<string, any>;
|
||||
}
|
||||
|
||||
// 更新平台参数
|
||||
@@ -40,7 +39,6 @@ export interface UpdateDatasourcePlatformParams extends Partial<CreateDatasource
|
||||
export interface UpdateDatasourcePlatformStatusParams {
|
||||
id: string;
|
||||
Status: string;
|
||||
updatedBy?: string;
|
||||
}
|
||||
|
||||
// 平台信息
|
||||
@@ -54,22 +52,25 @@ export interface DatasourcePlatformInfo {
|
||||
apiBaseUrl: string;
|
||||
authType: string;
|
||||
authTypeName: string;
|
||||
token?: string;
|
||||
apiKey?: string;
|
||||
clientId?: string;
|
||||
clientSecret?: string;
|
||||
authConfig?: Record<string, any>;
|
||||
rateLimitPerMinute?: number;
|
||||
rateLimitPerHour?: number;
|
||||
concurrencyLimit?: number;
|
||||
requestTimeoutMs?: number;
|
||||
maxRetries?: number;
|
||||
retryDelayMs?: number;
|
||||
createdBy?: string;
|
||||
createdAt?: number;
|
||||
updatedBy?: string;
|
||||
updatedAt?: number;
|
||||
}
|
||||
|
||||
// 获取平台列表
|
||||
export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/listDatasourcePlatforms',
|
||||
url: '/data-engine/datasource/platform/controller/listDatasourcePlatforms',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
@@ -78,7 +79,7 @@ export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||
// 创建平台
|
||||
export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/createDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/createDatasourcePlatform',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@@ -87,7 +88,7 @@ export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||
// 更新平台
|
||||
export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/updateDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatform',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -96,7 +97,7 @@ export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||
// 删除平台
|
||||
export function deleteDatasourcePlatform(id: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/deleteDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/deleteDatasourcePlatform',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
@@ -105,7 +106,7 @@ export function deleteDatasourcePlatform(id: string) {
|
||||
// 获取平台详情
|
||||
export function getDatasourcePlatform(id: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/getDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/getDatasourcePlatform',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
@@ -114,7 +115,7 @@ export function getDatasourcePlatform(id: string) {
|
||||
// 根据编码获取平台信息
|
||||
export function getPlatformByCode(platformCode: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/getPlatformByCode',
|
||||
url: '/data-engine/datasource/platform/controller/getPlatformByCode',
|
||||
method: 'get',
|
||||
params: { platformCode },
|
||||
});
|
||||
@@ -123,7 +124,7 @@ export function getPlatformByCode(platformCode: string) {
|
||||
// 更新平台状态
|
||||
export function updateDatasourcePlatformStatus(data: UpdateDatasourcePlatformStatusParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
|
||||
@@ -87,7 +87,7 @@ export default defineComponent({
|
||||
isShowPassword: false,
|
||||
ruleForm: {
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
password: 'Tongli686^*^',
|
||||
verifyCode: '',
|
||||
verifyKey: '',
|
||||
},
|
||||
|
||||
@@ -1,221 +1,540 @@
|
||||
<template>
|
||||
<template>
|
||||
<div class="cid-apis-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="关键字" prop="keyword">
|
||||
<el-input
|
||||
v-model="tableData.param.keyword"
|
||||
placeholder="请输入接口名称"
|
||||
<el-card shadow="hover"
|
||||
><el-tabs v-model="tab" @tab-change="onTab"
|
||||
><el-tab-pane label="平台管理" name="platform"
|
||||
><el-form ref="pqf" :model="pq" :inline="true" label-width="68px" class="mb15"
|
||||
><el-form-item label="关键字" prop="keyword"
|
||||
><el-input
|
||||
v-model="pq.keyword"
|
||||
placeholder="请输入平台名称/编码"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="getList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="default" type="primary" @click="getList">
|
||||
<el-icon><ele-Search /></el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default" @click="resetQuery(queryRef)">
|
||||
<el-icon><ele-Refresh /></el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button size="default" type="success" @click="onOpenAdd">
|
||||
<el-icon><ele-FolderAdd /></el-icon>
|
||||
新增接口
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" @click="onRowDel(null)">
|
||||
<el-icon><ele-Delete /></el-icon>
|
||||
删除
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="name" label="接口名称" show-overflow-tooltip />
|
||||
<el-table-column prop="path" label="接口路径" show-overflow-tooltip />
|
||||
<el-table-column prop="method" label="请求方式" width="100" align="center" />
|
||||
<el-table-column prop="datasourceName" label="所属平台" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.status === 1 ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onOpenEdit(scope.row)">修改</el-button>
|
||||
<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="tableData.total > 0"
|
||||
:total="tableData.total"
|
||||
v-model:page="tableData.param.pageNum"
|
||||
v-model:limit="tableData.param.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" :close-on-click-modal="false">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="接口名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入接口名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接口路径" prop="path">
|
||||
<el-input v-model="form.path" placeholder="请输入接口路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请求方式" prop="method">
|
||||
<el-select v-model="form.method" style="width: 100%">
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台" prop="datasourceId">
|
||||
<el-input v-model="form.datasourceId" placeholder="请输入所属平台ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" style="width: 100%">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :loading="dialog.saving">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@keyup.enter.native="searchPlatform" /></el-form-item
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="pq.status" placeholder="平台状态" clearable style="width: 160px"
|
||||
><el-option label="启用" value="ACTIVE" /><el-option label="禁用" value="INACTIVE" /></el-select></el-form-item
|
||||
><el-form-item
|
||||
><el-button type="primary" @click="searchPlatform"
|
||||
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||
><el-button @click="resetPlatformQuery"
|
||||
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||
><el-button type="success" @click="openPlatform()"
|
||||
><el-icon><ele-FolderAdd /></el-icon>新增平台</el-button
|
||||
></el-form-item
|
||||
></el-form
|
||||
><el-table :data="platformRows" row-key="id" v-loading="platformLoading"
|
||||
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||
prop="platformCode"
|
||||
label="平台编码"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="platformName" label="平台名称" min-width="160" show-overflow-tooltip /><el-table-column
|
||||
prop="apiBaseUrl"
|
||||
label="API地址"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="authType" label="认证" width="100" align="center" /><el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
width="90"
|
||||
align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="s.row.status === 'ACTIVE' ? 'success' : 'danger'">{{
|
||||
s.row.status === 'ACTIVE' ? '启用' : '禁用'
|
||||
}}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="rateLimitPerMinute" label="限流/分钟" width="110" align="center" /><el-table-column
|
||||
prop="requestTimeoutMs"
|
||||
label="超时(ms)"
|
||||
width="110"
|
||||
align="center"
|
||||
/><el-table-column label="创建时间" width="170"
|
||||
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||
><el-table-column label="操作" width="150" fixed="right"
|
||||
><template #default="s"
|
||||
><el-button size="small" text type="primary" @click="openPlatform(s.row)">修改</el-button
|
||||
><el-button size="small" text type="danger" @click="delPlatform(s.row)">删除</el-button></template
|
||||
></el-table-column
|
||||
></el-table
|
||||
><pagination :total="platformTotal" v-model:page="pq.pageNum" v-model:limit="pq.pageSize" @pagination="getPlatforms" /></el-tab-pane
|
||||
><el-tab-pane label="接口管理" name="api"
|
||||
><el-form ref="aqf" :model="aq" :inline="true" label-width="68px" class="mb15"
|
||||
><el-form-item label="关键字" prop="keyword"
|
||||
><el-input
|
||||
v-model="aq.keyword"
|
||||
placeholder="请输入接口名称/编码"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter.native="searchApi" /></el-form-item
|
||||
><el-form-item label="平台" prop="platformId"
|
||||
><el-select v-model="aq.platformId" placeholder="请选择平台" clearable filterable style="width: 180px"
|
||||
><el-option v-for="i in platforms" :key="i.id" :label="i.platformName" :value="String(i.id)" /></el-select></el-form-item
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="aq.status" placeholder="状态" clearable style="width: 130px"
|
||||
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item
|
||||
><el-form-item label="方法" prop="method"
|
||||
><el-select v-model="aq.method" placeholder="请求方式" clearable style="width: 130px"
|
||||
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item
|
||||
><el-form-item
|
||||
><el-button type="primary" @click="searchApi"
|
||||
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||
><el-button @click="resetApiQuery"
|
||||
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||
><el-button type="success" @click="openApi()"
|
||||
><el-icon><ele-FolderAdd /></el-icon>新增接口</el-button
|
||||
></el-form-item
|
||||
></el-form
|
||||
><el-table :data="apiRows" v-loading="apiLoading"
|
||||
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||
prop="code"
|
||||
label="接口编码"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="name" label="接口名称" min-width="150" show-overflow-tooltip /><el-table-column
|
||||
prop="url"
|
||||
label="URL"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="method" label="请求方式" width="100" align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="s.row.method === 'GET' ? 'success' : 'primary'">{{ s.row.method }}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="status" label="状态" width="90" align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="ns(s.row.status) === 'active' ? 'success' : 'danger'">{{
|
||||
ns(s.row.status) === 'active' ? '启用' : '禁用'
|
||||
}}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="platformName" label="所属平台" min-width="140" show-overflow-tooltip /> ><el-table-column
|
||||
label="创建时间"
|
||||
width="170"
|
||||
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||
><el-table-column label="操作" width="160" fixed="right"
|
||||
><template #default="s"
|
||||
><el-button size="small" text type="primary" @click="openApi(String(s.row.id))">修改</el-button
|
||||
><el-button size="small" text type="danger" @click="delApi(s.row)">删除</el-button></template
|
||||
></el-table-column
|
||||
></el-table
|
||||
><pagination :total="apiTotal" v-model:page="aq.pageNum" v-model:limit="aq.pageSize" @pagination="getApis" /></el-tab-pane></el-tabs
|
||||
></el-card>
|
||||
<el-dialog v-model="platformDialog.visible" :title="platformDialog.title" width="720px" :close-on-click-modal="false" destroy-on-close
|
||||
><el-form ref="platformFormRef" :model="platformForm" :rules="platformRules" label-width="120px" v-loading="platformDialog.loading"
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="平台编码" prop="platformCode"><el-input v-model="platformForm.platformCode" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="平台名称" prop="platformName"><el-input v-model="platformForm.platformName" /></el-form-item></el-col></el-row
|
||||
><el-form-item label="平台描述"><el-input v-model="platformForm.description" type="textarea" :rows="3" /></el-form-item
|
||||
><el-form-item label="API地址"><el-input v-model="platformForm.apiBaseUrl" /></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="认证类型" prop="authType"
|
||||
><el-select v-model="platformForm.authType" style="width: 100%"
|
||||
><el-option label="Token" value="TOKEN" /><el-option label="API Key" value="API_KEY" /><el-option
|
||||
label="OAuth2"
|
||||
value="OAUTH2" /><el-option label="Basic" value="BASIC" /></el-select></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="platformForm.status" style="width: 100%"
|
||||
><el-option label="启用" value="ACTIVE" /><el-option label="停用" value="INACTIVE" /></el-select></el-form-item></el-col></el-row
|
||||
><el-form-item label="Token/密钥"><el-input v-model="platformForm.token" show-password /></el-form-item
|
||||
><el-form-item label="API Key"><el-input v-model="platformForm.apiKey" show-password /></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="Client ID"><el-input v-model="platformForm.clientId" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="Client Secret"><el-input v-model="platformForm.clientSecret" show-password /></el-form-item></el-col></el-row
|
||||
><el-form-item label="认证配置 JSON" prop="authConfigText"
|
||||
><el-input v-model="platformForm.authConfigText" type="textarea" :rows="6" /></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="限流/分钟"
|
||||
><el-input-number v-model="platformForm.rateLimitPerMinute" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="限流/小时"
|
||||
><el-input-number v-model="platformForm.rateLimitPerHour" :min="0" style="width: 100%" /></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="并发限制"
|
||||
><el-input-number v-model="platformForm.concurrencyLimit" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="超时(ms)"
|
||||
><el-input-number v-model="platformForm.requestTimeoutMs" :min="0" style="width: 100%" /></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="最大重试"><el-input-number v-model="platformForm.maxRetries" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="重试延迟(ms)"
|
||||
><el-input-number v-model="platformForm.retryDelayMs" :min="0" style="width: 100%" /></el-form-item></el-col></el-row></el-form
|
||||
><template #footer
|
||||
><el-button @click="platformDialog.visible = false">取消</el-button
|
||||
><el-button type="primary" :loading="platformDialog.saving" @click="savePlatform">确定</el-button></template
|
||||
></el-dialog
|
||||
><el-dialog v-model="apiDialog.visible" :title="apiDialog.title" width="780px" :close-on-click-modal="false" destroy-on-close
|
||||
><el-form ref="apiFormRef" :model="apiForm" :rules="apiRules" label-width="110px" v-loading="apiDialog.loading"
|
||||
><el-form-item label="所属平台" prop="platformId"
|
||||
><el-select v-model="apiForm.platformId" style="width: 100%" filterable
|
||||
><el-option v-for="i in platforms" :key="i.id" :label="i.platformName" :value="String(i.id)" /></el-select></el-form-item
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="接口编码" prop="code"><el-input v-model="apiForm.code" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="接口名称" prop="name"><el-input v-model="apiForm.name" /></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="URL" prop="url"><el-input v-model="apiForm.url" /></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="请求方式" prop="method"
|
||||
><el-select v-model="apiForm.method" style="width: 100%"
|
||||
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item></el-col></el-row
|
||||
><el-row :gutter="16"
|
||||
><el-col :span="12"
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="apiForm.status" style="width: 100%"
|
||||
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item></el-col
|
||||
><el-col :span="12"
|
||||
><el-form-item label="认证类型"
|
||||
><el-select v-model="apiForm.authType" style="width: 100%" clearable
|
||||
><el-option label="Token" value="TOKEN" /><el-option label="API Key" value="API_KEY" /><el-option
|
||||
label="OAuth2"
|
||||
value="OAUTH2" /><el-option label="APP_SIGNATURE" value="APP_SIGNATURE" /></el-select></el-form-item></el-col></el-row
|
||||
><el-form-item label="请求配置 JSON" prop="requestConfigText"
|
||||
><el-input v-model="apiForm.requestConfigText" type="textarea" :rows="6" /></el-form-item
|
||||
><el-form-item label="响应配置 JSON" prop="responseConfigText"
|
||||
><el-input v-model="apiForm.responseConfigText" type="textarea" :rows="5" /></el-form-item
|
||||
><el-form-item label="限流配置 JSON" prop="limitConfigText"
|
||||
><el-input v-model="apiForm.limitConfigText" type="textarea" :rows="4" /></el-form-item
|
||||
><el-form-item label="表结构定义 JSON" prop="tableDefinitionText"
|
||||
><el-input v-model="apiForm.tableDefinitionText" type="textarea" :rows="6" /></el-form-item></el-form
|
||||
><template #footer
|
||||
><el-button @click="apiDialog.visible = false">取消</el-button
|
||||
><el-button type="primary" :loading="apiDialog.saving" @click="saveApi">确定</el-button></template
|
||||
></el-dialog
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default { name: 'cidApis' };
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
||||
|
||||
const queryRef = ref<FormInstance>();
|
||||
const formRef = ref<FormInstance>();
|
||||
const ids = ref<string[]>([]);
|
||||
|
||||
const tableData = reactive({
|
||||
data: [] as any[],
|
||||
total: 0,
|
||||
param: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyword: '',
|
||||
},
|
||||
});
|
||||
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
saving: false,
|
||||
});
|
||||
|
||||
const form = reactive({
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { getApiErrorMessage } from '/@/utils/request';
|
||||
import {
|
||||
createDatasourcePlatform,
|
||||
deleteDatasourcePlatform,
|
||||
getDatasourcePlatform,
|
||||
listDatasourcePlatforms,
|
||||
updateDatasourcePlatform,
|
||||
} from '/@/api/cid/datasource';
|
||||
import {
|
||||
createApiInterface,
|
||||
deleteApiInterface,
|
||||
getApiInterface,
|
||||
listApiInterfaces,
|
||||
updateApiInterface,
|
||||
type ApiInterfaceInfo,
|
||||
} from '/@/api/cid/apis';
|
||||
defineOptions({ name: 'cidApis' });
|
||||
const tab = ref('platform'),
|
||||
methods = ['GET', 'POST', 'PUT', 'DELETE'],
|
||||
platforms = ref<any[]>([]),
|
||||
platformRows = ref<any[]>([]),
|
||||
apiRows = ref<ApiInterfaceInfo[]>([]),
|
||||
platformTotal = ref(0),
|
||||
apiTotal = ref(0),
|
||||
platformLoading = ref(false),
|
||||
apiLoading = ref(false);
|
||||
const pqf = ref<FormInstance>(),
|
||||
aqf = ref<FormInstance>(),
|
||||
platformFormRef = ref<FormInstance>(),
|
||||
apiFormRef = ref<FormInstance>();
|
||||
const pq = reactive({ pageNum: 1, pageSize: 10, keyword: '', status: '' }),
|
||||
aq = reactive({ pageNum: 1, pageSize: 10, keyword: '', platformId: '', status: '', method: '' });
|
||||
const platformDialog = reactive({ visible: false, title: '', loading: false, saving: false }),
|
||||
apiDialog = reactive({ visible: false, title: '', loading: false, saving: false });
|
||||
const dpf = () => ({
|
||||
id: '',
|
||||
name: '',
|
||||
path: '',
|
||||
method: 'GET',
|
||||
datasourceId: '',
|
||||
platformCode: '',
|
||||
platformName: '',
|
||||
description: '',
|
||||
status: 1,
|
||||
apiBaseUrl: '',
|
||||
authType: 'TOKEN',
|
||||
status: 'ACTIVE',
|
||||
token: '',
|
||||
apiKey: '',
|
||||
clientId: '',
|
||||
clientSecret: '',
|
||||
authConfigText: '{}',
|
||||
rateLimitPerMinute: 60,
|
||||
rateLimitPerHour: 1000,
|
||||
concurrencyLimit: 10,
|
||||
requestTimeoutMs: 30000,
|
||||
maxRetries: 3,
|
||||
retryDelayMs: 1000,
|
||||
});
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
||||
path: [{ required: true, message: '请输入接口路径', trigger: 'blur' }],
|
||||
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
// TODO: 调用列表接口
|
||||
};
|
||||
|
||||
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
};
|
||||
|
||||
const onOpenAdd = () => {
|
||||
dialog.title = '新增接口';
|
||||
dialog.visible = true;
|
||||
form.id = '';
|
||||
form.name = '';
|
||||
form.path = '';
|
||||
form.method = 'GET';
|
||||
form.datasourceId = '';
|
||||
form.description = '';
|
||||
form.status = 1;
|
||||
};
|
||||
|
||||
const onOpenEdit = (row: any) => {
|
||||
dialog.title = '修改接口';
|
||||
dialog.visible = true;
|
||||
form.id = row.id;
|
||||
form.name = row.name;
|
||||
form.path = row.path;
|
||||
form.method = row.method;
|
||||
form.datasourceId = row.datasourceId;
|
||||
form.description = row.description;
|
||||
form.status = row.status;
|
||||
};
|
||||
|
||||
const onSubmit = () => {
|
||||
if (!formRef.value) return;
|
||||
formRef.value.validate((valid) => {
|
||||
if (!valid) return;
|
||||
dialog.saving = true;
|
||||
// TODO: 调用新增/编辑接口
|
||||
dialog.saving = false;
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
const daf = () => ({
|
||||
id: '',
|
||||
platformId: '',
|
||||
code: '',
|
||||
name: '',
|
||||
url: '',
|
||||
method: 'GET',
|
||||
status: 'active',
|
||||
authType: '',
|
||||
requestConfigText: '{}',
|
||||
responseConfigText: '{}',
|
||||
limitConfigText: '{}',
|
||||
tableDefinitionText: '{}',
|
||||
});
|
||||
};
|
||||
|
||||
const onRowDel = (row: any) => {
|
||||
const delIds = row ? [row.id] : ids.value;
|
||||
if (delIds.length === 0) {
|
||||
ElMessage.error('请选择要删除的数据');
|
||||
return;
|
||||
const platformForm = reactive(dpf()),
|
||||
apiForm = reactive(daf());
|
||||
const jv = (v: string, cb: (e?: Error) => void, l: string) => {
|
||||
if (!v) return cb();
|
||||
try {
|
||||
JSON.parse(v);
|
||||
cb();
|
||||
} catch {
|
||||
cb(new Error(`${l} 格式错误`));
|
||||
}
|
||||
ElMessageBox.confirm(`确定要删除选中的接口吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
// TODO: 调用删除接口
|
||||
ElMessage.success('删除成功');
|
||||
getList();
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
const platformRules: FormRules = {
|
||||
platformCode: [{ required: true, message: '请输入平台编码', trigger: 'blur' }],
|
||||
platformName: [{ required: true, message: '请输入平台名称', trigger: 'blur' }],
|
||||
authType: [{ required: true, message: '请选择认证类型', trigger: 'change' }],
|
||||
authConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '认证配置 JSON'), trigger: 'blur' }],
|
||||
};
|
||||
const apiRules: FormRules = {
|
||||
platformId: [{ required: true, message: '请选择所属平台', trigger: 'change' }],
|
||||
code: [{ required: true, message: '请输入接口编码', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
||||
url: [{ required: true, message: '请输入接口 URL', trigger: 'blur' }],
|
||||
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
||||
requestConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '请求配置 JSON'), trigger: 'blur' }],
|
||||
responseConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '响应配置 JSON'), trigger: 'blur' }],
|
||||
limitConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '接口独立限流配置 JSON'), trigger: 'blur' }],
|
||||
tableDefinitionText: [{ validator: (_r, v, cb) => jv(v, cb, '表结构定义 JSON'), trigger: 'blur' }],
|
||||
};
|
||||
const ft = (t?: number) => (!t ? '' : new Date(String(t).length === 10 ? t * 1000 : t).toLocaleString('zh-CN', { hour12: false })),
|
||||
ns = (s?: string) => (String(s || '').toLowerCase() === 'active' ? 'active' : 'inactive');
|
||||
const loadPlatforms = async () => {
|
||||
const r = await listDatasourcePlatforms({ pageNum: 1, pageSize: 100 });
|
||||
platforms.value = r.data?.list || [];
|
||||
};
|
||||
const getPlatforms = async () => {
|
||||
platformLoading.value = true;
|
||||
try {
|
||||
const r = await listDatasourcePlatforms({
|
||||
pageNum: pq.pageNum,
|
||||
pageSize: pq.pageSize,
|
||||
...(pq.keyword ? { keyword: pq.keyword } : {}),
|
||||
...(pq.status ? { status: pq.status } : {}),
|
||||
});
|
||||
platformRows.value = r.data?.list || [];
|
||||
platformTotal.value = r.data?.total || 0;
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取平台列表失败');
|
||||
} finally {
|
||||
platformLoading.value = false;
|
||||
}
|
||||
};
|
||||
const getApis = async () => {
|
||||
apiLoading.value = true;
|
||||
try {
|
||||
const r = await listApiInterfaces({
|
||||
pageNum: aq.pageNum,
|
||||
pageSize: aq.pageSize,
|
||||
...(aq.keyword ? { keyword: aq.keyword } : {}),
|
||||
...(aq.platformId ? { platformId: aq.platformId } : {}),
|
||||
...(aq.status ? { status: aq.status } : {}),
|
||||
...(aq.method ? { method: aq.method } : {}),
|
||||
});
|
||||
apiRows.value = r.data?.list || [];
|
||||
apiTotal.value = r.data?.total || 0;
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取接口列表失败');
|
||||
} finally {
|
||||
apiLoading.value = false;
|
||||
}
|
||||
};
|
||||
const onTab = () => (tab.value === 'platform' ? getPlatforms() : getApis());
|
||||
const searchPlatform = () => {
|
||||
pq.pageNum = 1;
|
||||
getPlatforms();
|
||||
};
|
||||
const searchApi = () => {
|
||||
aq.pageNum = 1;
|
||||
getApis();
|
||||
};
|
||||
const resetPlatformQuery = () => {
|
||||
pqf.value?.resetFields();
|
||||
searchPlatform();
|
||||
};
|
||||
const resetApiQuery: any = () => {
|
||||
aqf.value?.resetFields();
|
||||
searchApi();
|
||||
};
|
||||
const openPlatform = async (row?: any) => {
|
||||
Object.assign(platformForm, dpf());
|
||||
platformFormRef.value?.clearValidate();
|
||||
platformDialog.title = row ? '编辑平台' : '新建平台';
|
||||
platformDialog.visible = true;
|
||||
if (!row) return;
|
||||
platformDialog.loading = true;
|
||||
try {
|
||||
const r = await getDatasourcePlatform(row.id);
|
||||
const d = r.data || {};
|
||||
Object.assign(platformForm, {
|
||||
id: String(d.id || row.id),
|
||||
platformCode: d.platformCode || '',
|
||||
platformName: d.platformName || '',
|
||||
description: d.description || '',
|
||||
apiBaseUrl: d.apiBaseUrl || '',
|
||||
authType: d.authType || 'TOKEN',
|
||||
status: d.status || 'ACTIVE',
|
||||
token: d.token || '',
|
||||
apiKey: d.apiKey || '',
|
||||
clientId: d.clientId || '',
|
||||
clientSecret: d.clientSecret || '',
|
||||
authConfigText: JSON.stringify(d.authConfig ?? {}, null, 2),
|
||||
rateLimitPerMinute: d.rateLimitPerMinute ?? 60,
|
||||
rateLimitPerHour: d.rateLimitPerHour ?? 1000,
|
||||
concurrencyLimit: d.concurrencyLimit ?? 10,
|
||||
requestTimeoutMs: d.requestTimeoutMs ?? 30000,
|
||||
maxRetries: d.maxRetries ?? 3,
|
||||
retryDelayMs: d.retryDelayMs ?? 1000,
|
||||
});
|
||||
} catch (e) {
|
||||
platformDialog.visible = false;
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取平台详情失败');
|
||||
} finally {
|
||||
platformDialog.loading = false;
|
||||
}
|
||||
};
|
||||
const savePlatform = async () => {
|
||||
if (!platformFormRef.value) return;
|
||||
const ok = await platformFormRef.value.validate().catch(() => false);
|
||||
if (!ok) return;
|
||||
platformDialog.saving = true;
|
||||
try {
|
||||
const p = {
|
||||
platformCode: platformForm.platformCode,
|
||||
platformName: platformForm.platformName,
|
||||
description: platformForm.description,
|
||||
apiBaseUrl: platformForm.apiBaseUrl,
|
||||
authType: platformForm.authType,
|
||||
status: platformForm.status,
|
||||
token: platformForm.token,
|
||||
apiKey: platformForm.apiKey,
|
||||
clientId: platformForm.clientId,
|
||||
clientSecret: platformForm.clientSecret,
|
||||
authConfig: JSON.parse(platformForm.authConfigText || '{}'),
|
||||
rateLimitPerMinute: platformForm.rateLimitPerMinute || 60,
|
||||
rateLimitPerHour: platformForm.rateLimitPerHour || 1000,
|
||||
concurrencyLimit: platformForm.concurrencyLimit || 10,
|
||||
requestTimeoutMs: platformForm.requestTimeoutMs || 30000,
|
||||
maxRetries: platformForm.maxRetries || 3,
|
||||
retryDelayMs: platformForm.retryDelayMs || 1000,
|
||||
};
|
||||
platformForm.id ? await updateDatasourcePlatform({ id: platformForm.id, ...p }) : await createDatasourcePlatform(p);
|
||||
ElMessage.success(platformForm.id ? '更新成功' : '创建成功');
|
||||
platformDialog.visible = false;
|
||||
await Promise.all([getPlatforms(), loadPlatforms()]);
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || (platformForm.id ? '更新失败' : '创建失败'));
|
||||
} finally {
|
||||
platformDialog.saving = false;
|
||||
}
|
||||
};
|
||||
const delPlatform = (row: any) => {
|
||||
const ids = [row.id];
|
||||
ElMessageBox.confirm(`确定删除平台「${row.platformName}」吗?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
try {
|
||||
for (const id of ids) await deleteDatasourcePlatform(id);
|
||||
ElMessage.success('删除成功');
|
||||
await Promise.all([getPlatforms(), loadPlatforms()]);
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '删除失败');
|
||||
}
|
||||
})
|
||||
.catch(() => undefined);
|
||||
};
|
||||
const openApi = async (id = '', platformId = '') => {
|
||||
Object.assign(apiForm, daf(), platformId ? { platformId } : {});
|
||||
apiFormRef.value?.clearValidate();
|
||||
if (!platforms.value.length) await loadPlatforms();
|
||||
apiDialog.title = id ? '编辑接口' : '新建接口';
|
||||
apiDialog.visible = true;
|
||||
if (!id) return;
|
||||
apiDialog.loading = true;
|
||||
try {
|
||||
const r = await getApiInterface(id);
|
||||
const d = r.data || {};
|
||||
Object.assign(apiForm, {
|
||||
id: String(d.id || id),
|
||||
platformId: String(d.platformId || platformId || ''),
|
||||
code: d.code || '',
|
||||
name: d.name || '',
|
||||
url: d.url || '',
|
||||
method: d.method || 'GET',
|
||||
status: ns(d.status),
|
||||
authType: d.authType || '',
|
||||
requestConfigText: JSON.stringify(d.requestConfig ?? {}, null, 2),
|
||||
responseConfigText: JSON.stringify(d.responseConfig ?? {}, null, 2),
|
||||
limitConfigText: JSON.stringify(d.limitConfig ?? {}, null, 2),
|
||||
tableDefinitionText: JSON.stringify(d.tableDefinition ?? {}, null, 2),
|
||||
});
|
||||
} catch (e) {
|
||||
apiDialog.visible = false;
|
||||
ElMessage.error(getApiErrorMessage(e) || '获取接口详情失败');
|
||||
} finally {
|
||||
apiDialog.loading = false;
|
||||
}
|
||||
};
|
||||
const saveApi = async () => {
|
||||
if (!apiFormRef.value) return;
|
||||
const ok = await apiFormRef.value.validate().catch(() => false);
|
||||
if (!ok) return;
|
||||
apiDialog.saving = true;
|
||||
try {
|
||||
const p = {
|
||||
platformId: Number(apiForm.platformId),
|
||||
code: apiForm.code,
|
||||
name: apiForm.name,
|
||||
url: apiForm.url,
|
||||
method: apiForm.method,
|
||||
status: apiForm.status,
|
||||
authType: apiForm.authType || undefined,
|
||||
requestConfig: JSON.parse(apiForm.requestConfigText || '{}'),
|
||||
responseConfig: JSON.parse(apiForm.responseConfigText || '{}'),
|
||||
limitConfig: JSON.parse(apiForm.limitConfigText || '{}'),
|
||||
tableDefinition: JSON.parse(apiForm.tableDefinitionText || '{}'),
|
||||
};
|
||||
apiForm.id ? await updateApiInterface({ id: apiForm.id, ...p }) : await createApiInterface(p);
|
||||
ElMessage.success(apiForm.id ? '更新成功' : '创建成功');
|
||||
apiDialog.visible = false;
|
||||
await getApis();
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || (apiForm.id ? '更新失败' : '创建失败'));
|
||||
} finally {
|
||||
apiDialog.saving = false;
|
||||
}
|
||||
};
|
||||
const delApi = (row: any) => {
|
||||
ElMessageBox.confirm(`确定删除接口「${row.name}」吗?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
try {
|
||||
await deleteApiInterface(String(row.id));
|
||||
ElMessage.success('删除成功');
|
||||
await getApis();
|
||||
} catch (e) {
|
||||
ElMessage.error(getApiErrorMessage(e) || '删除失败');
|
||||
}
|
||||
})
|
||||
.catch(() => undefined);
|
||||
};
|
||||
onMounted(async () => {
|
||||
await loadPlatforms();
|
||||
await Promise.all([getPlatforms(), getApis()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
27
ssl/minio.redpowerfuture.com.key
Normal file
27
ssl/minio.redpowerfuture.com.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAvoMUrxhR2vYC/tyGZlplkANptmFfqcglnd+ETk1ppE/tMyrI
|
||||
PxBLvjN1BIcbBFkHthuv/Ut/dSgtS0hbI52Z1bMACbJ5SdPLTBZzNpXgHWXUHf/S
|
||||
OsQB8s7gsCekcVly3Tf1emsXxcyeXQ7u8/ZrNEAKGZwT3xkAvtte01NqJeaIMddY
|
||||
1o/nrlVhgV6CvDtCAFLRVvw2p5zc/Vejc/MLEXV4l9g3VIODfcIbLsczUmsT98zO
|
||||
LOwwgVssCQcdnA12T1X3U4s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+va29
|
||||
MnLXmff/oed1rkj64NDGMtstO82xXORN+u0AeAgdm8zOkJk+31bbtRakdLYxOA2S
|
||||
xds7sCgEDtmI8DBT7djCOMsUkyOj3la7w/fZ0gT9RpS575RaB2RM0RMs/b+862cr
|
||||
BIcF0QKBgQCrO6f1zj9vr4h3nWohSjgpAkZHpeUxDf6s39U960JU5Dvz/bhCHr51
|
||||
uuVO183cFmx9W8IW6BI4dwEKk5MrXD2hdM8uGAIi+ip/SwBqej072HuY1xD2Elp9
|
||||
mWXLESLAedhWvp9QhNQbHib1RzaPV8TUgCDN/QLGQE+jdVqfk/Smfw==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
62
ssl/minio.redpowerfuture.com.pem
Normal file
62
ssl/minio.redpowerfuture.com.pem
Normal file
@@ -0,0 +1,62 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIGJTCCBQ2gAwIBAgIQAWng8l3t5rBYcCmLpCDdJTANBgkqhkiG9w0BAQsFADBu
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
|
||||
RFYgVExTIENBIC0gRzIwHhcNMjYwNjEyMDAwMDAwWhcNMjYwOTA5MjM1OTU5WjAj
|
||||
MSEwHwYDVQQDExhtaW5pby5yZWRwb3dlcmZ1dHVyZS5jb20wggEiMA0GCSqGSIb3
|
||||
DQEBAQUAA4IBDwAwggEKAoIBAQC+gxSvGFHa9gL+3IZmWmWQA2m2YV+pyCWd34RO
|
||||
TWmkT+0zKsg/EEu+M3UEhxsEWQe2G6/9S391KC1LSFsjnZnVswAJsnlJ08tMFnM2
|
||||
leAdZdQd/9I6xAHyzuCwJ6RxWXLdN/V6axfFzJ5dDu7z9ms0QAoZnBPfGQC+217T
|
||||
U2ol5ogx11jWj+euVWGBXoK8O0IAUtFW/DannNz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xIi
|
||||
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
|
||||
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
|
||||
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
|
||||
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
|
||||
-----END CERTIFICATE-----
|
||||
Reference in New Issue
Block a user