25 lines
475 B
TypeScript
25 lines
475 B
TypeScript
// app.ts
|
|
import Permission from "./utils/Permission";
|
|
|
|
const originPage = Page;
|
|
|
|
(globalThis as any).Page = function (options: WechatMiniprogram.Page.Options) {
|
|
const originalOnShow = options.onShow;
|
|
return originPage({
|
|
...options,
|
|
async onShow(...args: any[]) {
|
|
await Permission.checkAndCacheUploadPermission();
|
|
if (originalOnShow) {
|
|
return await originalOnShow.apply(this, args);
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
App<IAppOption>({
|
|
globalData: {
|
|
},
|
|
onLaunch() {
|
|
},
|
|
})
|