提交 53016f82 编写于 作者: 雪洛's avatar 雪洛

fix: get h5 weixin config

上级 499e5a71
{
"schedule": {
"__UNI__xxxxxx": {
"enable": true,
"h5-weixin": {
"enable": false,
"tasks": ["ticket"]
}
}
},
"ipWhitelist": ["0.0.0.0"]
}
\ No newline at end of file
......@@ -488,6 +488,8 @@ module.exports = {
/**
* 获取微信公众号config参数
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-h5-weixin-config
* @param {object} params
* @param {string} params.url 当前页面url不带hash部分
* @returns
*/
getH5WeixinConfig
......
......@@ -11,6 +11,8 @@ const {
/**
* 获取微信公众号config参数
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-h5-weixin-config
* @param {object} params
* @param {string} params.url 当前页面url不带hash部分
* @returns
*/
module.exports = async function (params) {
......@@ -28,8 +30,8 @@ module.exports = async function (params) {
appId
} = this.getClientInfo()
const weixinPlatform = getWeixinPlatform.call(this)
const getTicketRes = await this.getTicket.getTicket({
appId,
const getTicketRes = await this.uniOpenBridge.getTicket({
dcloudAppid: appId,
platform: weixinPlatform + '-weixin'
})
if (!getTicketRes) {
......
......@@ -3,8 +3,8 @@
const configCenter = require('uni-config-center')
const OauthConfig = {
'mp-weixin': ['oauth', 'weixin'],
'h5-weixin': ['oauth', 'weixin']
'mp-weixin': ['mp-weixin', 'oauth', 'weixin'],
'h5-weixin': ['web', 'oauth', 'h5-weixin']
}
class ConfigBase {
......@@ -28,12 +28,7 @@ class ConfigBase {
return (item.dcloudAppid === appid)
})
}
if (this._uniId.dcloudAppid === appid) {
return this._uniId
}
return null
return this._uniId
}
get ready() {
......@@ -73,13 +68,8 @@ class AppConfig extends ConfigBase {
}
getOauthConfig(appConfig, platformName) {
const platformConfig = appConfig[platformName]
if (!platformConfig) {
return null
}
let tree = OauthConfig[platformName]
let node = platformConfig
let node = appConfig
for (let i = 0; i < tree.length; i++) {
let nodeName = tree[i]
if (node[nodeName]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册