riku
2023-05-09 0959c095ad9715633d6ccdf10eb3b3d52f0bede1
src/api/fysp/sceneApi.js
文件名从 src/api/sceneApi.js 修改
@@ -1,4 +1,4 @@
import { $fysp } from './index';
import { $fysp } from '../index';
export default {
  /**
@@ -7,7 +7,7 @@
   */
  searchScene(area, page = 1, perPage = 20) {
    const params = `page=${page}&per_page=${perPage}`;
    return $fysp.post(`scense/find?${params}`, area);
    return $fysp.post(`scense/find?${params}`, area).then((res) => res.data);
  },
  /**
@@ -16,11 +16,13 @@
   * @returns 鍦烘櫙璇︽儏
   */
  getSceneDetail(sId) {
    return $fysp.get(`scense/detail`, {
    return $fysp
      .get(`scense/detail`, {
      params: {
        sceneId: sId,
      },
    });
      })
      .then((res) => res.data);
  },
  /**
@@ -33,21 +35,27 @@
      subScene: subScene ? JSON.stringify(subScene) : null,
      sceneDevice: sceneDevice ? sceneDevice : null,
    };
    return $fysp.post(`scense/detail/update?${params}`, rb);
    return $fysp
      .post(`scense/detail/update?${params}`, rb)
      .then((res) => res.data);
  },
  /**
   * 鏇存柊鍦烘櫙棰濆淇℃伅
   */
  updateSubScene(typeId, subScene) {
    return this.updateSceneDetail(typeId, { subScene: subScene });
    return this.updateSceneDetail(typeId, { subScene: subScene }).then(
      (res) => res.data
    );
  },
  /**
   * 鏇存柊鍦烘櫙璁惧淇℃伅
   */
  updateSceneDevice(typeId, sceneDevice) {
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice });
    return this.updateSceneDetail(typeId, { sceneDevice: sceneDevice }).then(
      (res) => res.data
    );
  },
  /**
@@ -55,7 +63,7 @@
   * @param {Object} scene
   */
  createScene(scene) {
    return $fysp.put('scense', scene);
    return $fysp.put('scense', scene).then((res) => res.data);
  },
  /**
@@ -63,6 +71,6 @@
   * @param {Object} scene
   */
  updateScene(scene) {
    return $fysp.post('scense', scene);
    return $fysp.post('scense', scene).then((res) => res.data);
  },
};