update: 接口域名作为环境变量

main
fadeaway 5 months ago
parent 149ee5cff0
commit 64cd56a2ec

@ -0,0 +1,2 @@
# NEXT_PUBLIC_HOST = 'http://39.103.180.196:9012'
NEXT_PUBLIC_HOST = 'http://api.indie.cn:9012'

@ -0,0 +1 @@
NEXT_PUBLIC_HOST = 'http://api.indie.cn:9012'

@ -11,8 +11,7 @@ import InviteBanner from '@/components/InviteBanner';
// 获取文章信息
async function getArticleInfo(journalId: string) {
const res = await fetch(`http://api.indie.cn:9012/luoo-music/article/${journalId}`);
// const res = await fetch(`http://39.103.180.196:9012/luoo-music/article/${journalId}`);
const res = await fetch(`${process.env.NEXT_PUBLIC_HOST}/luoo-music/article/${journalId}`);
return res.json();
}

@ -17,13 +17,13 @@ export const metadata: Metadata = { title: '雀乐期刊' };
// 获取期刊信息
async function getJournalInfo(journalId: string) {
const res = await fetch(`http://api.indie.cn:9012/luoo-music/journal/${journalId}`);
const res = await fetch(`${process.env.NEXT_PUBLIC_HOST}/luoo-music/journal/${journalId}`);
return res.json();
}
// 获取期刊歌曲列表
async function getSongList(journalId: string) {
const res = await fetch(`http://api.indie.cn:9012/luoo-music/song/journalId/${journalId}`);
const res = await fetch(`${process.env.NEXT_PUBLIC_HOST}/luoo-music/song/journalId/${journalId}`);
return res.json();
}

@ -9,7 +9,7 @@ import type { IAudioPlayerRef } from '@/components/AudioPlayer';
import ImageWithBasePath from '@/components/ImageWithBasePath';
async function getMusic(songId: string) {
const res = await fetch(`http://api.indie.cn:9012/luoo-music/song/${songId}`);
const res = await fetch(`${process.env.NEXT_PUBLIC_HOST}/luoo-music/song/${songId}`);
return res.json();
}

@ -11,8 +11,7 @@ import useUA from '@/hooks/useUA';
// 分享获取微信token
async function getShareAccessToken(url: string) {
const res = await fetch('http://api.indie.cn:9012/user/wechat/getShareAccessToken', {
// const res = await fetch('http://39.103.180.196:9012/user/wechat/getShareAccessToken', {
const res = await fetch(`${process.env.NEXT_PUBLIC_HOST}/user/wechat/getShareAccessToken`, {
method: 'post',
body: JSON.stringify({ url }),
headers: { 'Content-Type': 'application/json' },

@ -48,7 +48,7 @@ export const download = () => {
// }
const iosLinkUrl = 'https://apps.apple.com/app/%E9%9B%80%E4%B9%90/id6478897923';
// const iosLinkUrl = 'itms-apps://itunes.apple.com/app/id6478897923';
const androidLinkurl = '//cdn.indie.cn/release/queyue.apk';
const androidLinkurl = 'http://cdn.indie.cn/release/queyue.apk';
// const huaweiUrl = `appmarket://details?id=${APK_NAME}`;
// const oppoUrl = `oppomarket://details?packagename=${APK_NAME}`;
// const vivoUrl = `vivomarket://details?id=${APK_NAME}`;
@ -75,11 +75,13 @@ export const download = () => {
// }
switch (verifyBrand()) {
case 'iphone':
window.location.href = iosLinkUrl;
// window.location.href = iosLinkUrl;
window.open(iosLinkUrl, '_blank');
break;
default:
if (!isBuiltIn()) {
window.location.href = androidLinkurl;
// window.location.href = androidLinkurl;
window.open(androidLinkurl, '_blank');
}
break;
}

Loading…
Cancel
Save