CloudBaseAuth constructor

CloudBaseAuth(
  1. CloudBaseCore core
)

Implementation

factory CloudBaseAuth(CloudBaseCore core) {
  String? envId = core.config.env;
  if (envId == null) {
    throw new CloudBaseException(
        code: CloudBaseExceptionCode.INVALID_PARAM,
        message: '环境 $envId 未初始化 CloudBaseCore 实例,请传入 envId');
  }
  return _cache.putIfAbsent(envId, () {
    return CloudBaseAuth._internal(core);
  });
}