|
1 | 1 | // .vitepress/theme/index.js |
2 | 2 | import DefaultTheme from "vitepress/theme"; |
3 | 3 | import "./style/custom.css"; |
4 | | -// Import the functions you need from the SDKs you need |
5 | | -import { initializeApp } from "firebase/app"; |
6 | | -import { getAnalytics } from "firebase/analytics"; |
7 | | -import { getPerformance } from "firebase/performance"; |
8 | 4 | import NotFound from "../theme/NotFound.vue"; |
9 | 5 |
|
10 | | -/** |
11 | | - * 初始化 Firebase |
12 | | - * @returns {Promise<string>} 初始化结果 |
13 | | - */ |
14 | | -const initializeFirebase = () => { |
15 | | - const firebaseConfig = { |
16 | | - apiKey: "AIzaSyANVvapu0ihi1cM8ZzuXTkwjx9lM_J1RyQ", |
17 | | - authDomain: "rw-api-code-d0779.firebaseapp.com", |
18 | | - projectId: "rw-api-code-d0779", |
19 | | - storageBucket: "rw-api-code-d0779.appspot.com", |
20 | | - messagingSenderId: "363611843335", |
21 | | - appId: "1:363611843335:web:f15aef7ab427f52b4033a2", |
22 | | - measurementId: "G-XJH5TKP5VL", |
23 | | - }; |
24 | | - |
25 | | - // Initialize Firebase |
26 | | - const app = initializeApp(firebaseConfig); |
27 | | - const analytics = getAnalytics(app); |
28 | | - const perf = getPerformance(app); |
29 | | - |
30 | | - return "Firebase initialized successfully"; |
31 | | -}; |
32 | | - |
33 | | -(async function () { |
34 | | - try { |
35 | | - const result = await initializeFirebase(); |
36 | | - console.log(result); |
37 | | - } catch (error) { |
38 | | - console.error(error); |
39 | | - } |
40 | | -})(); |
41 | | - |
42 | 6 | /** |
43 | 7 | * 等待指定时间 |
44 | 8 | * @param {number} timeout 等待时间,单位:毫秒 |
|
0 commit comments