update swagger api
This commit is contained in:
1 parent
0c72b4c53e
commit
86402f5f3c
3 files changed
+877
-7
No files matched your search
@@ -80,7 +80,9 @@
|
||||
{{ service?.introduction }}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('service.button.apis')" name="apis">Config</el-tab-pane>
|
||||
<el-tab-pane :label="$t('service.button.apis')" name="apis">
|
||||
<div id="document"></div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -102,6 +104,7 @@ import { ERROR_CODE_DUPLICATION } from '@/constants';
|
||||
import { ElForm, ElMessage } from 'element-plus';
|
||||
import { apiOperator } from '@/operators/api/operator';
|
||||
import { IApi, IApiListResponse } from '@/operators/api/models';
|
||||
import SwaggerUI from 'swagger-ui';
|
||||
|
||||
interface IData {
|
||||
service: IService | undefined;
|
||||
@@ -146,6 +149,10 @@ export default defineComponent({
|
||||
this.loading = true;
|
||||
apiOperator.getAllForService(this.id).then(({ data: data }: { data: IApiListResponse }) => {
|
||||
this.apis = data.items;
|
||||
SwaggerUI({
|
||||
url: 'https://petstore.swagger.io/v2/swagger.json',
|
||||
dom_id: '#document'
|
||||
});
|
||||
});
|
||||
},
|
||||
onApply() {
|
||||
@@ -177,6 +184,10 @@ export default defineComponent({
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="css">
|
||||
@import 'swagger-ui/dist/swagger-ui.css';
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.preview {
|
||||
overflow: hidden;
|
||||
|
||||
Reference in new issue
Block a user