Browse Source

增加ServiceApi组件框架。

sybotan 4 years ago
parent
commit
3cb0b2b54b
4 changed files with 33 additions and 3 deletions
  1. 28 0
      docs/.vuepress/components/ServiceApi.vue
  2. 1 1
      docs/.vuepress/config.js
  3. 3 1
      docs/README.md
  4. 1 1
      package.json

+ 28 - 0
docs/.vuepress/components/ServiceApi.vue

@@ -0,0 +1,28 @@
+<template>
+    <div>
+        <div v-for="tag in api.tags" :key="tag.name"><h1>{{ tag.name }}</h1> {{ tag.description }}</div>>
+    </div>
+</template>
+
+<script>
+import Axios from "axios";
+
+export default {
+    name: "ServiceApi",
+    data: function() {
+        return {
+            api: {}
+        };
+    },
+    props: ["sys"],
+    created: function() {
+        Axios.get(
+            `${window.location.origin}/${this.sys}/v2/api-docs`,
+            {}
+        ).then(res => {
+            this.api = res.data;
+            console.log(this.api);
+        });
+    }
+}
+</script>

+ 1 - 1
docs/.vuepress/config.js

@@ -157,7 +157,7 @@ module.exports = {
                 }
             },
             '/datacenter': {
-                target: 'http://localhost:8080/',
+                target: 'http://adm.sagacloud.cn:8080/datacenter',
                 changeOrigin: true,
                 secure: false,
                 pathRewrite: {

+ 3 - 1
docs/README.md

@@ -9,4 +9,6 @@ actionLink: /zh/guide/
 footer: MIT Licensed | Copyright © 2009-present 北京博锐尚格科技有限公司
 ---
 
-# 参考文档
+# 参考文档
+
+<ServiceApi sys="datacenter"/>

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "remote": {
     "host": "47.94.89.44",
-    "path": "/opt/tomcat9/webapps/doc/service",
+    "path": "/opt/nginx/doc/service",
     "user": "user1",
     "password": "@)!^sagacloud",
     "local": "docs/.vuepress/dist"