feat(miniapp): add privacy consent and legal pages
Show privacy popup on launch, gate login on legal consent, and link user agreement and privacy policy pages in the mini program. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-1
@@ -1,12 +1,14 @@
|
||||
const { getStoredSession, setApiBaseUrl, getMiniProgramAppId, isTouristMode, getApiBaseUrl } = require('./utils/api');
|
||||
const { API_BASE_URL } = require('./utils/config');
|
||||
const { getPrivacySetting } = require('./utils/privacy');
|
||||
|
||||
App({
|
||||
globalData: {
|
||||
user: null,
|
||||
privacySetting: null,
|
||||
},
|
||||
|
||||
onLaunch() {
|
||||
async onLaunch() {
|
||||
setApiBaseUrl(API_BASE_URL);
|
||||
const appId = getMiniProgramAppId();
|
||||
console.info('[TKMind miniapp] API_BASE_URL =', getApiBaseUrl() || API_BASE_URL);
|
||||
@@ -18,5 +20,6 @@ App({
|
||||
if (session?.user) {
|
||||
this.globalData.user = session.user;
|
||||
}
|
||||
this.globalData.privacySetting = await getPrivacySetting();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user