Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
binhai-people
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
binhai-jiaoguan
binhai-people
Commits
61cb728d
Commit
61cb728d
authored
Nov 21, 2023
by
YangAo
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新配置文件百度地图api真实地址注释
parent
16469e4a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
4 deletions
+16
-4
.env.development
.env.development
+2
-0
.env.production
.env.production
+2
-0
.env.test
.env.test
+2
-0
baidu.js
src/api/baidu.js
+8
-2
header.vue
src/views/Home/components/SearchHome/components/header.vue
+2
-2
No files found.
.env.development
View file @
61cb728d
...
...
@@ -2,9 +2,11 @@
VUE_APP_BASE_API='/dev-api'
# 百度地图api
# https://api.map.baidu.com/
VUE_APP_BAIDU_API=/baidu-api
# 百度地图 交通api
# https://jiaotong.baidu.com/
VUE_APP_BAIDU_TRAFFIC_API=/baidu-traffic-api
# 资源访问前缀
...
...
.env.production
View file @
61cb728d
...
...
@@ -8,9 +8,11 @@ ENV = 'production'
VUE_APP_BASE_API = 'http://49.232.167.247:22000'
# 百度地图api
# https://api.map.baidu.com/
VUE_APP_BAIDU_API=/baidu-api
# 百度地图 交通api
# https://jiaotong.baidu.com/
VUE_APP_BAIDU_TRAFFIC_API=/baidu-traffic-api
...
...
.env.test
View file @
61cb728d
...
...
@@ -8,9 +8,11 @@ NODE_ENV = 'production'
VUE_APP_BASE_API
=
'http://49.232.167.247:22000'
# 百度地图api
# https://api.map.baidu.com/
VUE_APP_BAIDU_API
=/
baidu
-
api
# 百度地图 交通api
# https://jiaotong.baidu.com/
VUE_APP_BAIDU_TRAFFIC_API
=/
baidu
-
traffic
-
api
# 资源访问前缀
...
...
src/api/baidu.js
View file @
61cb728d
import
request
from
'@/utils/request-baidu'
export
function
getWeather
()
{
/**
* 获取天气
* @param params 参数
*/
export
function
getWeather
(
params
)
{
return
request
({
url
:
'/weather/v1/?district_id=120116&data_type=all&ak=bSlMW0ziNWrg8TjNzUKZpLE9iGcS3jc2'
url
:
'/weather/v1'
,
method
:
'get'
,
params
})
}
...
...
src/views/Home/components/SearchHome/components/header.vue
View file @
61cb728d
...
...
@@ -33,6 +33,7 @@
import
Cookies
from
'js-cookie'
import
logo
from
'@/assets/image/logo.png'
import
axios
from
'axios'
import
{
getWeather
}
from
"@/api/baidu"
;
export
default
{
name
:
'Head'
,
...
...
@@ -63,9 +64,8 @@ export default {
data_type
:
'all'
,
ak
:
'bSlMW0ziNWrg8TjNzUKZpLE9iGcS3jc2'
}
// 将 params 对象传递给 GET 请求
axios
.
get
(
`
${
process
.
env
.
VUE_APP_BAIDU_API
}
weather/v1/`
,
{
params
}
)
getWeather
(
params
)
.
then
(
response
=>
{
console
.
log
(
'11111'
,
response
)
this
.
weatherCondition
=
response
.
data
.
result
.
forecasts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment