qq浏览器和夸克浏览器支持复制当前网址到safari打开
This commit is contained in:
parent
2efb38dcdf
commit
58e80b0ea7
|
@ -6,11 +6,23 @@ import { Toast } from "antd-mobile";
|
||||||
import { save } from "@/utils/storeInfo";
|
import { save } from "@/utils/storeInfo";
|
||||||
import { removeUserInfo } from "@/utils/storeInfo";
|
import { removeUserInfo } from "@/utils/storeInfo";
|
||||||
import { Dialog } from "antd-mobile";
|
import { Dialog } from "antd-mobile";
|
||||||
|
import clipboard from "copy-to-clipboard";
|
||||||
|
|
||||||
export default function WithAuth(WrappedComponent) {
|
export default function WithAuth(WrappedComponent) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
|
|
||||||
|
//保存内容到剪贴板
|
||||||
|
const copy = (_data) => {
|
||||||
|
clipboard(_data);
|
||||||
|
Toast.show({
|
||||||
|
icon: "success",
|
||||||
|
content: "已复制到剪贴板,请前往Safari打开",
|
||||||
|
position: "top",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const ua = navigator.userAgent.toLowerCase();
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
if (
|
if (
|
||||||
|
@ -20,8 +32,17 @@ export default function WithAuth(WrappedComponent) {
|
||||||
// 夸克浏览器
|
// 夸克浏览器
|
||||||
Dialog.show({
|
Dialog.show({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "暂时不支持此浏览器,请使用Safari访问铁粉空间!",
|
actions: [
|
||||||
// buttonText: "确认",
|
{
|
||||||
|
key: "redirect",
|
||||||
|
text: "复制网址",
|
||||||
|
onClick: () => {
|
||||||
|
const currentUrl = window.location.href;
|
||||||
|
copy(currentUrl);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
content: "暂时不支持此浏览器,请使用Safari访问!",
|
||||||
bodyStyle: {
|
bodyStyle: {
|
||||||
maxHeight: "none",
|
maxHeight: "none",
|
||||||
width: "80vw",
|
width: "80vw",
|
||||||
|
@ -31,8 +52,6 @@ export default function WithAuth(WrappedComponent) {
|
||||||
"--text-color": "#fff",
|
"--text-color": "#fff",
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
},
|
},
|
||||||
// cancelText:"确认",
|
|
||||||
// confirmText:"取消",
|
|
||||||
style: {
|
style: {
|
||||||
"--text-color": "#fff",
|
"--text-color": "#fff",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue