fix: 将“web”平台更改为“browser”,以统一版本配置中的平台命名
This commit is contained in:
@@ -18,7 +18,7 @@ interface Env {
|
|||||||
interface VersionConfig {
|
interface VersionConfig {
|
||||||
ios: VersionInfo;
|
ios: VersionInfo;
|
||||||
android: VersionInfo;
|
android: VersionInfo;
|
||||||
web: VersionInfo;
|
browser: VersionInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 版本配置 - 直接在这里管理版本信息
|
// 版本配置 - 直接在这里管理版本信息
|
||||||
@@ -37,7 +37,7 @@ const versionConfig: VersionConfig = {
|
|||||||
updateUrl: "https://play.google.com/store/apps/details?id=riwa.ionic.app",
|
updateUrl: "https://play.google.com/store/apps/details?id=riwa.ionic.app",
|
||||||
minSupportVersion: "0.9.0",
|
minSupportVersion: "0.9.0",
|
||||||
},
|
},
|
||||||
web: {
|
browser: {
|
||||||
version: "0.0.1",
|
version: "0.0.1",
|
||||||
forceUpdate: false,
|
forceUpdate: false,
|
||||||
updateMessage: "修复了一些问题并优化了性能",
|
updateMessage: "修复了一些问题并优化了性能",
|
||||||
@@ -49,11 +49,11 @@ const versionConfig: VersionConfig = {
|
|||||||
export const onRequestGet: PagesFunction<Env> = async (context) => {
|
export const onRequestGet: PagesFunction<Env> = async (context) => {
|
||||||
try {
|
try {
|
||||||
const { searchParams } = new URL(context.request.url);
|
const { searchParams } = new URL(context.request.url);
|
||||||
const platform = searchParams.get("platform") || "web";
|
const platform = searchParams.get("platform") || "browser";
|
||||||
const currentVersion = searchParams.get("currentVersion") || "0.0.1";
|
const currentVersion = searchParams.get("currentVersion") || "0.0.1";
|
||||||
|
|
||||||
// 验证平台参数
|
// 验证平台参数
|
||||||
if (!["ios", "android", "web"].includes(platform)) {
|
if (!["ios", "android", "browser"].includes(platform)) {
|
||||||
return new Response(
|
return new Response(
|
||||||
JSON.stringify({ error: "Invalid platform parameter" }),
|
JSON.stringify({ error: "Invalid platform parameter" }),
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user