@lark-apaas/client-toolkit 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
|
|
4
4
|
import { getCsrfToken } from "../../utils/getCsrfToken.js";
|
|
5
5
|
import { getAppId } from "../../utils/getAppId.js";
|
|
@@ -7,6 +7,7 @@ const Component = ()=>{
|
|
|
7
7
|
const [open, setOpen] = useState(false);
|
|
8
8
|
const [userinfo, setUserinfo] = useState(null);
|
|
9
9
|
const [isInternetVisible, setIsInternetVisible] = useState(false);
|
|
10
|
+
const timeoutRef = useRef(null);
|
|
10
11
|
useEffect(()=>{
|
|
11
12
|
fetch(`/spark/b/${getAppId(window.location.pathname)}/tenant_info`, {
|
|
12
13
|
headers: {
|
|
@@ -17,6 +18,7 @@ const Component = ()=>{
|
|
|
17
18
|
setIsInternetVisible(data?.data?.is_internet_visible);
|
|
18
19
|
});
|
|
19
20
|
}, []);
|
|
21
|
+
if ('production' !== process.env.NODE_ENV) return null;
|
|
20
22
|
if (!userinfo) return null;
|
|
21
23
|
return /*#__PURE__*/ jsxs(Popover, {
|
|
22
24
|
open: open,
|
|
@@ -25,9 +27,14 @@ const Component = ()=>{
|
|
|
25
27
|
/*#__PURE__*/ jsx(PopoverTrigger, {
|
|
26
28
|
asChild: true,
|
|
27
29
|
children: /*#__PURE__*/ jsxs("div", {
|
|
28
|
-
className: "fixed right-4 bottom-4 inline-flex items-center gap-x-[4px] px-[12px] py-[6px] bg-[#ffffffcc] shadow-[2px_4px_16px_0px_#00000024] rounded-[99px] text-[var(--token-text-title,#1f2329)] font-['PingFang_SC'] text-[14px] leading-[22px] tracking-[0px] cursor-pointer",
|
|
29
|
-
onMouseEnter: ()=>
|
|
30
|
-
|
|
30
|
+
className: "fixed right-4 bottom-4 inline-flex items-center gap-x-[4px] px-[12px] py-[6px] bg-[#ffffffcc] shadow-[2px_4px_16px_0px_#00000024] rounded-[99px] text-[var(--token-text-title,#1f2329)] font-['PingFang_SC'] text-[14px] leading-[22px] tracking-[0px] cursor-pointer z-[10000000]",
|
|
31
|
+
onMouseEnter: ()=>{
|
|
32
|
+
clearTimeout(timeoutRef.current);
|
|
33
|
+
setOpen(true);
|
|
34
|
+
},
|
|
35
|
+
onMouseLeave: ()=>{
|
|
36
|
+
timeoutRef.current = setTimeout(()=>setOpen(false), 100);
|
|
37
|
+
},
|
|
31
38
|
children: [
|
|
32
39
|
/*#__PURE__*/ jsx("img", {
|
|
33
40
|
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg",
|
|
@@ -45,8 +52,13 @@ const Component = ()=>{
|
|
|
45
52
|
side: "top",
|
|
46
53
|
align: "end",
|
|
47
54
|
sideOffset: 8,
|
|
48
|
-
onMouseEnter: ()=>
|
|
49
|
-
|
|
55
|
+
onMouseEnter: ()=>{
|
|
56
|
+
clearTimeout(timeoutRef.current);
|
|
57
|
+
setOpen(true);
|
|
58
|
+
},
|
|
59
|
+
onMouseLeave: ()=>{
|
|
60
|
+
timeoutRef.current = setTimeout(()=>setOpen(false), 100);
|
|
61
|
+
},
|
|
50
62
|
children: [
|
|
51
63
|
/*#__PURE__*/ jsxs("div", {
|
|
52
64
|
className: "self-stretch px-2 pt-2 pb-1 flex flex-col justify-start items-start gap-1",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "./welcome.css";
|
|
4
3
|
const Welcome = ()=>/*#__PURE__*/ jsxs("div", {
|
|
5
|
-
className: "
|
|
4
|
+
className: "flex flex-col items-center justify-center w-full h-full min-h-[70vh]",
|
|
6
5
|
children: [
|
|
7
6
|
/*#__PURE__*/ jsx("div", {
|
|
8
7
|
className: "text-xl font-bold leading-8 mb-2",
|
package/lib/utils/axiosConfig.js
CHANGED
|
@@ -15,7 +15,6 @@ function getRequestLogInfo(config) {
|
|
|
15
15
|
}
|
|
16
16
|
function initAxiosConfig(axiosInstance) {
|
|
17
17
|
if (!axiosInstance) axiosInstance = axios;
|
|
18
|
-
axiosInstance.defaults.timeout = 10000;
|
|
19
18
|
axiosInstance.interceptors.request.use((config)=>{
|
|
20
19
|
config._startTime = Date.now();
|
|
21
20
|
const csrfToken = window.csrfToken;
|
package/package.json
CHANGED