-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
326 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ build | |
|
||
.vercel | ||
.dumi | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
crossOrigin: 'anonymous', | ||
transpilePackages: ['@lobehub/ui'], | ||
async headers() { | ||
return [ | ||
{ | ||
// matching all API routes | ||
source: '/api/:path*', | ||
headers: [ | ||
{ key: 'Access-Control-Allow-Credentials', value: 'true' }, | ||
{ key: 'Access-Control-Allow-Origin', value: '*' }, | ||
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' }, | ||
{ | ||
key: 'Access-Control-Allow-Headers', | ||
value: | ||
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version', | ||
}, | ||
], | ||
}, | ||
{ | ||
// matching all API routes | ||
source: '/:path*', | ||
headers: [ | ||
{ key: 'Access-Control-Allow-Credentials', value: 'true' }, | ||
{ key: 'Access-Control-Allow-Origin', value: '*' }, | ||
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' }, | ||
{ | ||
key: 'Access-Control-Allow-Headers', | ||
value: | ||
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version', | ||
}, | ||
], | ||
}, | ||
]; | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"api": [ | ||
{ | ||
"url": "http://localhost:3410/api/v1", | ||
"name": "fetchCurrentWeather", | ||
"description": "获取当前天气情况", | ||
"parameters": { | ||
"properties": { | ||
"city": { | ||
"description": "城市名称", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"city" | ||
], | ||
"type": "object" | ||
} | ||
} | ||
], | ||
"gateway": "http://localhost:3410/api/gateway", | ||
"identifier": "realtime-weather-dev", | ||
"ui": { | ||
"mode": "iframe", | ||
"url": "http://localhost:3410", | ||
"height": 310 | ||
}, | ||
"version": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "LobeChat Plugins", | ||
"description": "", | ||
"version": "1.0.0" | ||
}, | ||
"tags": [ | ||
{ | ||
"name": "官方插件" | ||
}, | ||
{ | ||
"name": "官方插件/天气插件(RealTime Weather)" | ||
} | ||
], | ||
"paths": { | ||
"/api/v1": { | ||
"post": { | ||
"summary": "查询天气", | ||
"x-apifox-folder": "官方插件/天气插件(RealTime Weather)", | ||
"x-apifox-status": "released", | ||
"deprecated": false, | ||
"description": "", | ||
"tags": [ | ||
"官方插件/天气插件(RealTime Weather)" | ||
], | ||
"parameters": [], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"city": { | ||
"type": "string", | ||
"title": "城市" | ||
} | ||
}, | ||
"required": [ | ||
"city" | ||
], | ||
"x-apifox-orders": [ | ||
"city" | ||
], | ||
"x-apifox-ignore-properties": [] | ||
}, | ||
"example": { | ||
"city": "杭州" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "成功", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": {}, | ||
"x-apifox-orders": [], | ||
"x-apifox-ignore-properties": [] | ||
}, | ||
"title": "天气" | ||
}, | ||
"examples": { | ||
"1": { | ||
"summary": "成功示例", | ||
"value": [ | ||
{ | ||
"city": "杭州市", | ||
"adcode": "330100", | ||
"province": "浙江", | ||
"reporttime": "2023-08-17 23:01:56", | ||
"casts": [ | ||
{ | ||
"date": "2023-08-17", | ||
"week": "4", | ||
"dayweather": "小雨", | ||
"nightweather": "小雨", | ||
"daytemp": "33", | ||
"nighttemp": "24", | ||
"daywind": "东", | ||
"nightwind": "东", | ||
"daypower": "≤3", | ||
"nightpower": "≤3", | ||
"daytemp_float": "33.0", | ||
"nighttemp_float": "24.0" | ||
}, | ||
{ | ||
"date": "2023-08-18", | ||
"week": "5", | ||
"dayweather": "小雨", | ||
"nightweather": "小雨", | ||
"daytemp": "32", | ||
"nighttemp": "23", | ||
"daywind": "东北", | ||
"nightwind": "东北", | ||
"daypower": "4", | ||
"nightpower": "4", | ||
"daytemp_float": "32.0", | ||
"nighttemp_float": "23.0" | ||
}, | ||
{ | ||
"date": "2023-08-19", | ||
"week": "6", | ||
"dayweather": "小雨", | ||
"nightweather": "雷阵雨", | ||
"daytemp": "32", | ||
"nighttemp": "24", | ||
"daywind": "东", | ||
"nightwind": "东", | ||
"daypower": "4", | ||
"nightpower": "4", | ||
"daytemp_float": "32.0", | ||
"nighttemp_float": "24.0" | ||
}, | ||
{ | ||
"date": "2023-08-20", | ||
"week": "7", | ||
"dayweather": "雷阵雨", | ||
"nightweather": "多云", | ||
"daytemp": "33", | ||
"nighttemp": "25", | ||
"daywind": "东", | ||
"nightwind": "东", | ||
"daypower": "≤3", | ||
"nightpower": "≤3", | ||
"daytemp_float": "33.0", | ||
"nighttemp_float": "25.0" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"x-run-in-apifox": "https://apifox.com/web/project/3171264/apis/api-103858950-run" | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": {} | ||
}, | ||
"servers": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ThemeProvider } from '@lobehub/ui'; | ||
import 'antd/dist/reset.css'; | ||
import { PropsWithChildren, memo } from 'react'; | ||
|
||
const Layout = memo<PropsWithChildren>(({ children }) => { | ||
return <ThemeProvider themeMode={'auto'}>{children}</ThemeProvider>; | ||
}); | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { AppProps } from 'next/app'; | ||
|
||
import Layout from '@/layout'; | ||
|
||
import './global.css'; | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return ( | ||
<Layout> | ||
<Component {...pageProps} /> | ||
</Layout> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Head, Html, Main, NextScript } from 'next/document'; | ||
|
||
export default function Document() { | ||
return ( | ||
<Html lang="en"> | ||
<Head /> | ||
<body> | ||
<Main /> | ||
<NextScript /> | ||
</body> | ||
</Html> | ||
); | ||
} |
Oops, something went wrong.