小编lor*_*max的帖子

Google Apps 脚本日志(网络应用程序)未显示在新界面中

Apps Script 最近将 StackDriver 日志移至Apps Script 仪表板的“执行”页面。

问题是,日志不会显示在 Apps Script Web 应用程序的仪表板中。当我向 Apps Script Web 应用程序发出请求时,我可以看到新的执行行,但该行不会展开以显示日志。

我正在使用 Stackdriver Logging:

function doPost(e) {
  console.info('my log');
}
Run Code Online (Sandbox Code Playgroud)

奇怪的是,当我调用 dev url 时它起作用(部署列被标记为“头部”),当我单击它时该行确实会消耗并且我可以看到日志,但是对于完全相同的应用程序,它在我调用时不起作用以 /exec 结尾的生产 url(部署列被标记为“版本 2”)。

此外,它适用于 GET 请求,但不适用于 POST 请求。

使用以下权限部署 Web 应用程序:

  • 以“我”的身份执行应用程序
  • 谁可以访问该应用程序:任何人,甚至匿名
  • 驱动器共享设置:只有特定的人可以访问

在此处输入图片说明

这是他们新界面中的错误还是我遗漏了什么?

logging web-applications google-apps-script stackdriver

9
推荐指数
1
解决办法
1622
查看次数

apiKeyRequired 在 Google Cloud Endpoints 项目中不起作用

我有一个配置了 Cloud Endpoints Framework 的 java 8 项目。

我遵循了这里的文档:https : //cloud.google.com/endpoints/docs/frameworks/java/get-started-frameworks-java

我尝试使用 API 密钥保护 API。我遵循了这里的文档:https : //cloud.google.com/endpoints/docs/frameworks/java/restricting-api-access-with-api-keys-frameworks

问题是我总是可以访问端点,无论我是否设置了 API 密钥。

这是API:

@Api(
        name = "myApi",
        title = "My API",
        version = "v1",
        description = "My API description",
        apiKeyRequired = AnnotationBoolean.TRUE
)
public class MyApiEndpoint {
    @ApiMethod(httpMethod = GET, path = "list", apiKeyRequired = AnnotationBoolean.TRUE)
    public ApiEntityList list() throws Exception {
        return new ApiEntityList();
    }
}
Run Code Online (Sandbox Code Playgroud)

这是 web.xml:

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
<filter>
    <filter-name>endpoints-api-controller</filter-name> …
Run Code Online (Sandbox Code Playgroud)

java api-key google-cloud-platform google-cloud-endpoints-v2

6
推荐指数
1
解决办法
564
查看次数

Angular Material:创建自定义表单字段控件时,mat-form-field 必须包含 MatFormFieldControl

我想按照本指南实现 Angular Material 自定义表单字段: https: //material.angular.io/guide/creating-a-custom-form-field-control

但我一直遇到此错误:错误错误:mat-form-field 必须包含 MatFormFieldControl。

根据文档

当您尚未将表单字段控件添加到表单字段时,会出现此错误。如果您的表单字段包含本机或元素,请确保已向其中添加 matInput 指令并导入 MatInputModule。其他可以充当表单字段控件的组件包括 、 和您创建的任何自定义表单字段控件。

但是向标签添加 matInput 指令不会改变任何内容。就像它是盲目的,因为标签嵌入在这个新组件中<example-tel-input>

垫子形式字段:

<mat-form-field>
  <example-tel-input placeholder="Phone number" required></example-tel-input>
  <mat-icon matSuffix>phone</mat-icon>
  <mat-hint>Include area code</mat-hint>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)

具有输入的组件:

<div [formGroup]="parts" class="example-tel-input-container">
  <input class="example-tel-input-element" formControlName="area" size="3" aria-label="Area code" (input)="_handleInput()">
  <span class="example-tel-input-spacer">&ndash;</span>
  <input class="example-tel-input-element" formControlName="exchange" size="3" aria-label="Exchange code" (input)="_handleInput()">
  <span class="example-tel-input-spacer">&ndash;</span>
  <input class="example-tel-input-element" formControlName="subscriber" size="4" aria-label="Subscriber number" (input)="_handleInput()">
</div>
Run Code Online (Sandbox Code Playgroud)

Stackblitz: https: //stackblitz.com/edit/angular-9fyeha

我缺少什么?

angular-material angular

4
推荐指数
1
解决办法
2万
查看次数