index.js 458 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const success = {
  3. success: true
  4. }
  5. const fail = {
  6. success: false
  7. }
  8. const createPublishHtml = require('./createPublishHtml')
  9. exports.main = async (event, context) => {
  10. //event为客户端上传的参数
  11. console.log('event : ', event)
  12. let res = {};
  13. let params = event.data || event.params;
  14. switch (event.action) {
  15. case 'createPublishHtml':
  16. res = createPublishHtml(params.id)
  17. break;
  18. }
  19. //返回数据给客户端
  20. return res
  21. };