This commit is contained in:
Xu Chang 2024-12-23 16:19:23 +08:00
parent 0f16f22aa7
commit cbe80c0eab
4 changed files with 4 additions and 4 deletions

View File

@ -312,7 +312,7 @@ export class WechatPublicInstance {
const { access_token, expires_in } = result; const { access_token, expires_in } = result;
this.accessToken = access_token; this.accessToken = access_token;
// 生成下次刷新的定时器 // 生成下次刷新的定时器
console.log((expires_in - 10) * 1000); // console.log((expires_in - 10) * 1000);
this.refreshAccessTokenHandler = setTimeout(() => { this.refreshAccessTokenHandler = setTimeout(() => {
this.refreshAccessToken(); this.refreshAccessToken();
}, (expires_in - 10) * 1000); }, (expires_in - 10) * 1000);

View File

@ -316,7 +316,7 @@ class WechatPublicInstance {
const { access_token, expires_in } = result; const { access_token, expires_in } = result;
this.accessToken = access_token; this.accessToken = access_token;
// 生成下次刷新的定时器 // 生成下次刷新的定时器
console.log((expires_in - 10) * 1000); // console.log((expires_in - 10) * 1000);
this.refreshAccessTokenHandler = setTimeout(() => { this.refreshAccessTokenHandler = setTimeout(() => {
this.refreshAccessToken(); this.refreshAccessToken();
}, (expires_in - 10) * 1000); }, (expires_in - 10) * 1000);

View File

@ -1 +1 @@
import './testTrans'; import './testTianDitu';

View File

@ -1,4 +1,4 @@
fetch(encodeURI('http://api.tianditu.gov.cn/v2/search?postStr={"keyWord":"浙江大学","queryType":12,"start":0,"count":10,"specify":"156330100","show":"2"}&type=query&tk=')) fetch(encodeURI(`http://api.tianditu.gov.cn/geocoder?postStr={"lon":116.37304,"lat":39.92594,"ver":1}&type=geocode&tk=`))
.then( .then(
(result) => { (result) => {
console.log(result.status); console.log(result.status);