|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 跳转小程序 |
|
|
// 跳转小程序 |
|
|
function handleTo() { |
|
|
function handleTo() { |
|
|
|
|
|
let getTokenUrl = '' |
|
|
|
|
|
let getUrl = '' |
|
|
|
|
|
|
|
|
|
|
|
if (import.meta.env.ENV === 'production') { |
|
|
|
|
|
getTokenUrl = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx8fba957179c1329a&secret=699c10826113ddb350fbe58a96e2b015' |
|
|
|
|
|
getUrl = 'https://api.weixin.qq.com/wxa/generatescheme?access_token=' |
|
|
|
|
|
} else { |
|
|
|
|
|
getTokenUrl = '/wxApi/cgi-bin/token?grant_type=client_credential&appid=wx8fba957179c1329a&secret=699c10826113ddb350fbe58a96e2b015' |
|
|
|
|
|
getUrl = '/wxApi/wxa/generatescheme?access_token=' |
|
|
|
|
|
} |
|
|
uni.request({ |
|
|
uni.request({ |
|
|
url: '/wxApi/cgi-bin/token?grant_type=client_credential&appid=wx8fba957179c1329a&secret=699c10826113ddb350fbe58a96e2b015', |
|
|
|
|
|
|
|
|
url: getTokenUrl, |
|
|
method: 'GET', //请求方式,必须为大写 |
|
|
method: 'GET', //请求方式,必须为大写 |
|
|
|
|
|
|
|
|
success: (res) => { |
|
|
success: (res) => { |
|
|
// console.log('接口返回------', res); |
|
|
// console.log('接口返回------', res); |
|
|
let token = res.data['access_token'] |
|
|
let token = res.data['access_token'] |
|
|
uni.request({ |
|
|
uni.request({ |
|
|
url: `/wxApi/wxa/generatescheme?access_token=${token}`, |
|
|
|
|
|
|
|
|
url: getUrl + token, |
|
|
method: 'POST', //请求方式,必须为大写 |
|
|
method: 'POST', //请求方式,必须为大写 |
|
|
data: { |
|
|
data: { |
|
|
"jump_wxa": { |
|
|
"jump_wxa": { |