mirror of
https://gitee.com/ineo6/homebrew-install.git
synced 2025-06-25 05:49:15 +08:00
feat: ts定义
This commit is contained in:
parent
27cc7c4d21
commit
f38a1a806e
@ -72,7 +72,7 @@ const AppDetail = ({}) => {
|
|||||||
|
|
||||||
const getCaskDetail = id => {
|
const getCaskDetail = id => {
|
||||||
fetch(
|
fetch(
|
||||||
'http://localhost:8000/homebrew/cask-detail?' +
|
AVALON_SERVER + '/homebrew/cask-detail?' +
|
||||||
queryString.stringify({
|
queryString.stringify({
|
||||||
id,
|
id,
|
||||||
}),
|
}),
|
||||||
@ -92,7 +92,7 @@ const AppDetail = ({}) => {
|
|||||||
|
|
||||||
const getFormulaDetail = id => {
|
const getFormulaDetail = id => {
|
||||||
fetch(
|
fetch(
|
||||||
'http://localhost:8000/homebrew/formula-detail?' +
|
AVALON_SERVER + '/homebrew/formula-detail?' +
|
||||||
queryString.stringify({
|
queryString.stringify({
|
||||||
id,
|
id,
|
||||||
}),
|
}),
|
||||||
|
@ -47,7 +47,7 @@ const CaskAndFormula = ({}) => {
|
|||||||
|
|
||||||
const getCaskList = () => {
|
const getCaskList = () => {
|
||||||
fetch(
|
fetch(
|
||||||
'http://localhost:8000/homebrew/cask-list?' +
|
AVALON_SERVER + '/homebrew/cask-list?' +
|
||||||
queryString.stringify(listParams),
|
queryString.stringify(listParams),
|
||||||
)
|
)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
@ -60,7 +60,7 @@ const CaskAndFormula = ({}) => {
|
|||||||
|
|
||||||
const getFormula = () => {
|
const getFormula = () => {
|
||||||
fetch(
|
fetch(
|
||||||
'http://localhost:8000/homebrew/formula-list?' +
|
AVALON_SERVER + '/homebrew/formula-list?' +
|
||||||
queryString.stringify(listParams),
|
queryString.stringify(listParams),
|
||||||
)
|
)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
|
@ -4,6 +4,9 @@ export default defineConfig({
|
|||||||
title: 'Homebrew 中文网',
|
title: 'Homebrew 中文网',
|
||||||
mode: 'site',
|
mode: 'site',
|
||||||
logo: '/images/homebrew-256x256.png',
|
logo: '/images/homebrew-256x256.png',
|
||||||
|
define: {
|
||||||
|
'AVALON_SERVER': process.env.NODE_ENV === 'production' ? 'https://avalon.idayer.com' : 'http://localhost:8000',
|
||||||
|
},
|
||||||
favicon: '/favicon.ico',
|
favicon: '/favicon.ico',
|
||||||
locales: [['zh-CN', '中文']],
|
locales: [['zh-CN', '中文']],
|
||||||
metas: [],
|
metas: [],
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
},
|
},
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true
|
||||||
},
|
},
|
||||||
|
"include": ["./global.d.ts"],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"lib",
|
"lib",
|
||||||
|
8
typings.d.ts
vendored
8
typings.d.ts
vendored
@ -1,2 +1,10 @@
|
|||||||
declare module '*.css';
|
declare module '*.css';
|
||||||
declare module '*.less';
|
declare module '*.less';
|
||||||
|
|
||||||
|
declare var AVALON_SERVER: string
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
var AVALON_SERVER: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user