|
@@ -7,7 +7,7 @@ import {
|
|
import {LOGIN_ID_STORAGE_KEY } from '@/xiaolanbenlib/constant'
|
|
import {LOGIN_ID_STORAGE_KEY } from '@/xiaolanbenlib/constant'
|
|
|
|
|
|
import Taro, { FileSystemManager } from "@tarojs/taro";
|
|
import Taro, { FileSystemManager } from "@tarojs/taro";
|
|
-import { useRef, useCallback } from "react";
|
|
|
|
|
|
+import { useRef, useCallback, useEffect } from "react";
|
|
|
|
|
|
const appTokenKey = `${APP_NAME}+${APP_VERSION}token`;
|
|
const appTokenKey = `${APP_NAME}+${APP_VERSION}token`;
|
|
|
|
|
|
@@ -525,4 +525,22 @@ export function addOssProcessLowQualityParam(url: string): string {
|
|
// // 输出: https://example.com/image.png?width=200&height=200&x-oss-process=image/quality,Q_60/format,jpg
|
|
// // 输出: https://example.com/image.png?width=200&height=200&x-oss-process=image/quality,Q_60/format,jpg
|
|
|
|
|
|
// console.log(addOssProcessParam(exampleUrl3));
|
|
// console.log(addOssProcessParam(exampleUrl3));
|
|
-// // 输出: https://example.com/image.webp?x-oss-process=image/resize,w_300 (保持不变,因为已包含OSS参数)
|
|
|
|
|
|
+// // 输出: https://example.com/image.webp?x-oss-process=image/resize,w_300 (保持不变,因为已包含OSS参数)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+export function restrictedPage() {
|
|
|
|
+ // 方式一:不定义分享相关函数,默认就是禁止分享
|
|
|
|
+ // 方式二:显式返回不允许分享(两种分享方式都要处理)
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ // 禁止单页分享
|
|
|
|
+ Taro.showShareMenu({
|
|
|
|
+ withShareTicket: false,
|
|
|
|
+ menus: [] // 不提供任何分享菜单
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // 禁止分享到朋友圈
|
|
|
|
+ Taro.hideShareMenu({
|
|
|
|
+ menus: ['shareAppMessage', 'shareTimeline']
|
|
|
|
+ })
|
|
|
|
+ }, [])
|
|
|
|
+}
|