let selects = document.getElementsByTagName("select");
  if (selects.length !== selectAnswer.length) {
    layer.msg("页面上的题可能已经发生了变化", { icon: 0 });
    return;
  }
  let lastScope = NaN;
  let idx = -1;
  // 获取Angular作用域
  selectAnswer.forEach((answer, index) => {
    let scope = angular.element(selects[index]).scope();
    // console.log(scope.subject.sub_subjects);
    // console.log(lastScope === scope, lastScope);
    if (idx === -1) {
      idx = 0;
    } else if (lastScope === scope) {
      idx += 1;
    } else {
      idx = 0;
    }
    lastScope = scope;

    //angular.element(document.getElementsByTagName("select")[0]).scope().subject.sub_subjects;
    scope.$apply(() => {
      console.log(scope.subject.sub_subjects[idx]);
      let old = scope.subject.sub_subjects[idx].answeredOption;
      scope.subject.sub_subjects[idx].answeredOption = answer;
      scope.onChangeSubmission(scope.subject.sub_subjects[idx]);

      console.log(scope.subject.sub_subjects[idx]);
      console.log(
        `old: ${old},new:${answer}, now:${scope.subject.sub_subjects[idx].answeredOption}`,
      );
    });
    $(selects[index]).multiselect("refresh");
    angular.element(selects[index]).triggerHandler("change");
  });

# 使用scratch作为基础镜像
FROM scratch
WORKDIR /app

# 复制本地编译好的应用程序到容器中
# GOOS=linux GOARCH=amd64 CGO_ENABLED=0  go build -o ./bin/main main.go
COPY ./bin/main /app/main

# 复制配置文件和其他必要的文件到容器中
#COPY ./config.toml /app/config.toml

# 复制时区数据文件到容器中 需要把时区文件先复制到项目下
COPY ./zoneinfo/Asia/Shanghai /etc/localtime

# 设置时区环境变量
ENV TZ=Asia/Shanghai

# 运行应用程序
ENTRYPOINT ["/app/main", "-conf", "/app/config.toml"]

package server

import (    
        "embed"
    "github.com/gin-contrib/static"
    "github.com/gin-gonic/gin"
)

//go:embed static
var static embed.FS

func main() {
    r := gin.Default()
        // 创建一个没有顶层目录的FS
    webFS, err := fs.Sub(static, "static")
    if err != nil {
        panic(err)
    }
    r.NoRoute(gin.WrapH(http.FileServer(http.FS(webFS))))
    log.Fatal(r.Run(":8080")

}

django setting
以下无效

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.TokenAuthentication',
    )
}

正确用法
来自 https://blog.csdn.net/weixin_51098806/article/details/123674186#commentBox

MIDDLEWARE = [
    ...
    "projectname.utils.csrf_middleware.NotUseCsrfTokenMiddlewareMixin"
]

/project/project/utils

from django.utils.deprecation import MiddlewareMixin


class NotUseCsrfTokenMiddlewareMixin(MiddlewareMixin):

    def process_request(self, request):
        setattr(request, '_dont_enforce_csrf_checks', True)