Initial commit: Client Doc docs Server Tools
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import moduleHelper from './module-helper';
|
||||
import { formatJsonStr } from './utils';
|
||||
let resolveFn = null;
|
||||
export default {
|
||||
WX_OnNeedPrivacyAuthorization() {
|
||||
const callback = (resolve) => {
|
||||
resolveFn = resolve;
|
||||
moduleHelper.send('_OnNeedPrivacyAuthorizationCallback', '{}');
|
||||
};
|
||||
|
||||
wx.onNeedPrivacyAuthorization(callback);
|
||||
},
|
||||
WX_PrivacyAuthorizeResolve(conf) {
|
||||
const config = formatJsonStr(conf);
|
||||
|
||||
config.event = config.eventString;
|
||||
if (resolveFn) {
|
||||
resolveFn(config);
|
||||
if (config.event === 'agree' || config.event === 'disagree') {
|
||||
resolveFn = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user