fix: 新手教程修改地址,注册表单修改form传值

This commit is contained in:
2025-09-01 05:16:23 -07:00
parent 36bbcbc4f9
commit 2862629516
12 changed files with 82 additions and 46 deletions
+12 -14
View File
@@ -1,7 +1,6 @@
import { NEXT_PUBLIC_CDN_URL } from '@/config/constants';
import matter from 'gray-matter';
const BASE_URL = `${NEXT_PUBLIC_CDN_URL}/gh/perfect-panel/ppanel-tutorial`;
const BASE_URL = `https://airoport.co/md`;
// async function getVersion() {
// // API rate limit: 60 requests per hour
@@ -11,24 +10,23 @@ const BASE_URL = `${NEXT_PUBLIC_CDN_URL}/gh/perfect-panel/ppanel-tutorial`;
// const json = await response.json();
// return json[0].version;
// }
async function getVersionPath() {
// return getVersion()
// .then((version) => `${BASE_URL}@${version}`)
// .catch((error) => {
// console.warn('Error fetching the version:', error);
// return `${BASE_URL}@latest`;
// });
return `${BASE_URL}@latest`;
}
//
// async function getVersionPath() {
// // return getVersion()
// // .then((version) => `${BASE_URL}@${version}`)
// // .catch((error) => {
// // console.warn('Error fetching the version:', error);
// // return `${BASE_URL}@latest`;
// // });
// return `${BASE_URL}@latest`;
// }
export async function getTutorial(path: string): Promise<{
config?: Record<string, unknown>;
content: string;
}> {
const versionPath = await getVersionPath();
try {
const url = `${versionPath}/${path}`;
const url = `${BASE_URL}/${path}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);