google-apps-script – 没有使用“state”参数名调用doGet,导致服务器错误

几天后,当我尝试使用参数“state”调用所有脚本作为服务时,我收到一个奇怪的“Google Docs遇到了服务器错误”,方法doGet从未被调用过!

拜托,你能确认一些事情发生了变化吗?

重现问题的步骤:

>仅使用getMethod创建一个简单的应用程序脚本

    function doGet(e) {
      Logger.log("doGet");
      MailApp.sendEmail("xxxxxxxx@gmail.com", "Log", Logger.getLog());


  var app = UiApp.createApplication();

  return app;
}

>发布服务
>从浏览器传递“state”参数调用脚本

https://sites.google.com/macros/exec?service=AKfycbwrrSzd5PM07HgmuOSE1UsXxO9MmGTEOEwvXQC1&state=sample_parameter
>服务器返回错误:

    Google Docs has encountered a server error. If reloading the page doesn't help, please contact us.

To discuss this or other issues, visit the Google Docs Help forum. To see the list of known problems, check the Google Docs Known Issues page.

Sorry, and thanks for your help!
- The Google Docs Team

我也开了issue

谢谢大家,
弗朗切斯科

编辑:Issue已修复!谢谢大家.

最佳答案 创建问题报告是正确的做法.但请注意,这可能不会以您想要的方式“修复”.他们可能只是在文档中包含您不能使用名为“state”的参数.

解决方案只是使用不同的名称,例如myState或其他东西.恕我直言,不是很烦人或很难.

点赞