// 初始化 cloud
cloud.init({
// API 调用都保持和云函数当前所在环境一致
env: cloud.DYNAMIC_CURRENT_ENV
})
可是官方例子的cloud.DYNAMIC_CURRENT_ENV却是Symbol,建议以下改法:
// node_modules/wx-server-sdk/index.d.ts 文件的15行
export interface ICloudConfig {
env?: string | {
database?: string
functions?: string
storage?: string
} | Symbol
traceUser?: boolean
database: {
realtime: {
// max reconnect retries
maxReconnect: number
// interval between reconnection attempt, does not apply to the case of network offline, unit: ms
reconnectInterval: number
// maximum tolerance on the duration of websocket connection lost, unit: s
totalConnectionTimeout: number
}
}
}
题外话,建议考虑开源`wx-server-sdk`,因为反正代码都完全看得到,不如开源让大家补充不足。
感谢,我们会考虑的,有进展随时同步