Files
zhxg_app_v1.0/api/common/wechat.js
2025-07-16 15:34:34 +08:00

41 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
// };