Skip to content

Commit

Permalink
Update env
Browse files Browse the repository at this point in the history
  • Loading branch information
erich2s committed Sep 22, 2024
1 parent db46380 commit 32682dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ WEB_PUSH_CONTACT="mailto:[email protected]"
# VAPID_KEY
NEXT_PUBLIC_VAPID_KEY="BDeQByhHcxy084_JFou3rHlqiSpFvPZhUWjQKb1QlU6TjXL8mJd3usKDsQDzEeZ1HJOuultQgtPRlGOqgrrLnQA"
PRIVATE_VAPID_KEY="rZpj98WVatLMqzgWkC_mQgAbzG3WAZAtiw9hiMW3taY"
# 填入高德地图的key
NEXT_PUBLIC_AMAP_JSCODE=""
NEXT_PUBLIC_AMAP_KEY=""
2 changes: 1 addition & 1 deletion src/app/admin/locations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function page() {

function loadMap() {
AMapLoader.load({
key: "4f77082b3a2e028ff3c03d0fe2742b78",
key: process.env.NEXT_PUBLIC_AMAP_KEY,
version: "2.0",
})
.then((AMap) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export default function Map() {
// 加载地图函数,在这里可以设置地图
async function loadMap() {
(window as any)._AMapSecurityConfig = {
securityJsCode: "3741a106252939f5dbc7076539dc79fb",
securityJsCode: process.env.NEXT_PUBLIC_AMAP_JSCODE,
};
window.AMap = await AMapLoader.load({
key: "4f77082b3a2e028ff3c03d0fe2742b78",
key: process.env.NEXT_PUBLIC_AMAP_KEY,
version: "2.0",
});
const mapOptions: AMap.MapOptions = {
Expand Down

0 comments on commit 32682dd

Please sign in to comment.