小编Luc*_*ero的帖子

如何在 Firebase 中将用户更新为管理员

我有一个web应用程序,我想,作为管理员用户,才能够更新信息,如displayNamephotoURL其他用户的Firebase身份验证。

通常,如果我们想更新我们使用的用户信息,firebase.User.updateProfile() 但这仅适用于当前用户,而且,正如我之前提到的,我使用管理员帐户登录,我想更新其他用户的个人资料。

我的问题是:是否有一个函数可以将 uid用户的信息给要更新的信息?

谢谢。

web firebase firebase-authentication

7
推荐指数
1
解决办法
2832
查看次数

如何从 CommonJS 模块导入 ESM Javascript 文件?咕噜咕噜。错误:[ERR_REQUIRE_ESM]

我的项目完全是作为 CommonJS模块编写的,我不打算更改它。问题是我在使用gulp.

出现这种情况的文件:

const { dest, src } = require('gulp')
const imagemin = require('gulp-imagemin') // This is a ESM. Compiler gives error [ERR_REQUIRE_ESM]


const images = () => {
    // We have specific configs for jpeg and png files to try
    // to really pull down asset sizes
    return src('./src/images/**/*')
        .pipe(
            imagemin(
                [
                    imagemin.mozjpeg({ quality: 60, progressive: true }),
                    imagemin.optipng({ optimizationLevel: 5, interlaced: null })
                ],
                {
                    silent: true
                }
            )
        ) …
Run Code Online (Sandbox Code Playgroud)

javascript node.js gulp

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

如何设置 OrbitControls 随后使用的摄像机的初始水平和垂直旋转(方位角和极角)

我想设置随后使用的初始水平和垂直PerspectiveCamera旋转OrbitControl。我尝试拨打.rotateX(X) .rotateY(Y)电话,PerspectiveCamera但似乎不起作用。

在 OrbitControl 示例的 Threejs 文档中,他们说

//controls.update() must be called after any manual changes to the camera's transform
camera.position.set( 0, 20, 100 );
controls.update();
Run Code Online (Sandbox Code Playgroud)

https://trijs.org/docs/#examples/en/controls/OrbitControls

我想做同样的事情,但水平和垂直旋转。

这是相关代码:

相机.js

import { PerspectiveCamera } from 'three'
import { tweakParams } from 'src/World/utils/twekParams'

function createCamera () {
  const camera = new PerspectiveCamera(
    35,
    1,
    0.1,
    100
  )

  camera.userData.setInitialTransform = () => {
    // Grab the initial position and rotation values from a Singleton (tweakParams) …
Run Code Online (Sandbox Code Playgroud)

javascript three.js

5
推荐指数
1
解决办法
895
查看次数

使用客户端 SDK 时,Firebase AppCheck 给出“appCheck 不是函数”

当我在项目中初始化 AppCheck 时,出现错误。

Firebase 版本:“^8.8.1”。

这是我的配置文件:

import firebase from "firebase/app";
import "firebase/functions";

const firebaseConfig = {
    apiKey: "--",
    authDomain: "--",
    projectId: "--",
    storageBucket: "--",
    messagingSenderId: "--",
    appId: "--"
};

const check = firebase.appCheck() // here is the error
check.activate('appCheckKey', true)

const app = firebase.initializeApp(firebaseConfig)
const functions = firebase.functions()

export {
    app,
    functions
}
Run Code Online (Sandbox Code Playgroud)

请注意,我在这里使用虚拟数据,因为键是敏感信息。

这是我从 Webpack 收到的错误:

firebase.js?dc59:13 Uncaught TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_0__.default.appCheck is not a function
    at eval (firebase.js?dc59:13)
    at Module../src/firebase.js (app.js:1173)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)
    at eval (SorteoForm.vue?0e40:55) …
Run Code Online (Sandbox Code Playgroud)

firebase webpack firebase-app-check

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