feat: check version
This commit is contained in:
@@ -11,7 +11,7 @@ const versionInfo = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await writeFile('./public/version.json', JSON.stringify(versionInfo, null, 2));
|
await writeFile('./public/manifest.json', JSON.stringify(versionInfo, null, 2));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('写入版本信息失败:', error);
|
console.error('写入manifest失败:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function useVersionCheckQuery() {
|
|||||||
const { data: remoteVersionInfo, dataUpdatedAt } = useQuery({
|
const { data: remoteVersionInfo, dataUpdatedAt } = useQuery({
|
||||||
queryKey: ['version-check'],
|
queryKey: ['version-check'],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data } = await axios.get<VersionInfo>(`/version.json?t=${Date.now()}`);
|
const { data } = await axios.get<VersionInfo>(`/manifest.json?t=${Date.now()}`);
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
refetchInterval: 10 * 1000,
|
refetchInterval: 10 * 1000,
|
||||||
|
|||||||
Reference in New Issue
Block a user