移动端V1.0
This commit is contained in:
41
api/common/wechat.js
Normal file
41
api/common/wechat.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 新增学生退学申请记录
|
||||
export function getWxConfig(type) {
|
||||
//获取当前的url
|
||||
let url = window.location.href.split('#')[0];
|
||||
return request({
|
||||
url: '/api/wechat/getWxConfig/' + type,
|
||||
method: 'get',
|
||||
params: {
|
||||
url: url
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getAddressByLocation(latitude, longitude) {
|
||||
let key = "你的腾讯地图API Key";
|
||||
let url = `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=${key}&get_poi=1`;
|
||||
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status === 0) {
|
||||
console.log("地址信息:", data.result.formatted_addresses.recommend);
|
||||
} else {
|
||||
console.error("获取地址失败:", data);
|
||||
}
|
||||
})
|
||||
.catch(error => console.error("请求失败", error));
|
||||
}
|
||||
|
||||
// 获取企业微信签名配置
|
||||
// const getWxConfig = (type) => {
|
||||
// // 获取当前页面的 URL(去掉 hash 部分)
|
||||
|
||||
// return axios.get(`/api/wechat/getWxConfig/${type}`, {
|
||||
// params: {
|
||||
// url: url
|
||||
// } // 传递 URL
|
||||
// }).then(response => response.data);
|
||||
// };
|
Reference in New Issue
Block a user