ehome.js 872 B

123456789101112131415161718192021222324252627282930313233
  1. import request from '@/utils/request'
  2. import constant from '@/constant'
  3. function getXMLConfig(deviceNo,url){
  4. var encUrl = encodeURIComponent(url);
  5. return request.get(constant.serverUrl + `/ehome/getXMLConfig?deviceNo=${deviceNo}&url=${encUrl}`);
  6. }
  7. function putXMLConfig(deviceNo,url,jsonData){
  8. var encUrl = encodeURIComponent(url);
  9. return request.put(constant.serverUrl + `/ehome/setXMLConfig?deviceNo=${deviceNo}&url=${encUrl}`, jsonData,{
  10. headers: {
  11. "Content-Type": "application/json"
  12. }
  13. });
  14. }
  15. function postXMLConfig(deviceNo,url,jsonData){
  16. var encUrl = encodeURIComponent(url);
  17. return request.post(constant.serverUrl + `/ehome/setXMLConfig?deviceNo=${deviceNo}&url=${encUrl}`, jsonData,{
  18. headers: {
  19. "Content-Type": "application/json"
  20. }
  21. });
  22. }
  23. export default {
  24. getXMLConfig,putXMLConfig,postXMLConfig
  25. }