瀏覽代碼

feat: 调整接口

wll8 5 月之前
父節點
當前提交
2c38a25739
共有 2 個文件被更改,包括 24 次插入10 次删除
  1. 23 9
      mm/mm.config.js
  2. 1 1
      src/views/page3/leftBox.vue

+ 23 - 9
mm/mm.config.js

@@ -23,7 +23,7 @@ module.exports = async (util) => {
     replayPort: 8101,
     watch: [`./api/`],
     proxy: {
-      '/': `http://www.httpbin.org/`, // 后端接口主域
+      '/': `http://192.168.1.70:8080/`, // 后端接口主域
       '/anything/intercept': [`origin`, `127.0.0.1`], // 修改接口返回的数据
     },
     api: {
@@ -234,7 +234,7 @@ module.exports = async (util) => {
         },
       }),
       'get /base': util.side({
-        tags: [`增删改查`],
+        tags: [`增删改查`, `种植分析`, `种值分析详情`],
         summary: `基地 crud`,
         schema: {
           query: joi
@@ -253,8 +253,8 @@ module.exports = async (util) => {
           next()
         },
       }),
-      'get /holePunchingMachine': util.side({
-        tags: [`增删改查`],
+      'get /api/holePunchingMachine': util.side({
+        tags: [`增删改查`, `种值分析详情`],
         summary: `打孔机 crud`,
         schema: {
           query: joi
@@ -268,7 +268,7 @@ module.exports = async (util) => {
           next()
         },
       }),
-      'get /transplantAreaInEachRegion2': util.side({
+      'get /api/transplantAreaInEachRegion2': util.side({
         tags: [`种植分析`],
         summary: `各区域移栽面积`,
         async action(req, res, next) {
@@ -290,9 +290,9 @@ module.exports = async (util) => {
           )
         },
       }),
-      'get /trendOfTransplantQuantityThisMonth': util.side({
+      'get /api/trendOfTransplantQuantityThisMonth': util.side({
         tags: [`种植分析`, `种值分析详情`],
-        summary: `本月移栽数量趋势, 月度移栽面积分析`,
+        summary: `本月移栽数量趋势`,
         async action(req, res, next) {
           res.json(
             wrapApiData(
@@ -316,9 +316,9 @@ module.exports = async (util) => {
           )
         },
       }),
-      'get /thisYearsTransplantingDataTrend': util.side({
+      'get /api/thisYearsTransplantingDataTrend': util.side({
         tags: [`种植分析`, `种值分析详情`],
-        summary: `本年移栽数据趋势, 年度移栽趋势, 年度移栽面积分析`,
+        summary: `本年移栽数据趋势, 年度移栽趋势`,
         async action(req, res, next) {
           res.json(
             wrapApiData(
@@ -342,6 +342,20 @@ module.exports = async (util) => {
           )
         },
       }),
+      'get /api/analysisOfAnnualTransplantArea': util.side({
+        tags: [`种植分析`, `种值分析详情`],
+        summary: `年度移栽面积分析`,
+        async action(req, res, next) {
+          res.redirect(`/api/thisYearsTransplantingDataTrend`)
+        },
+      }),
+      'get /api/monthlyTransplantationAreaAnalysis': util.side({
+        tags: [`种植分析`, `种值分析详情`],
+        summary: `月度移栽面积分析`,
+        async action(req, res, next) {
+          res.redirect(`/api/trendOfTransplantQuantityThisMonth`)
+        },
+      }),
       'get /api/transplantData': util.side({
         tags: [`种值分析详情`],
         summary: `移栽数据`,

+ 1 - 1
src/views/page3/leftBox.vue

@@ -45,7 +45,7 @@ export default {
   methods: {
     async searchFn() {
       console.log(`search`, this.leftBox.input)
-      const data = await this.$http.get(`/holePunchingMachine`, {
+      const data = await this.$http.get(`/api/holePunchingMachine`, {
         params: {
           _sort:
             this.leftBox.sortList[