Skip to content

Commit

Permalink
globals
Browse files Browse the repository at this point in the history
Signed-off-by: jingyang <[email protected]>
  • Loading branch information
zjy365 committed Oct 16, 2023
1 parent b44816f commit 287b3cf
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 12 deletions.
24 changes: 12 additions & 12 deletions service/license/src/services/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ request.interceptors.request.use(
request.interceptors.response.use(
(response: AxiosResponse) => {
const { status, data } = response;
if (data.code === 401) {
console.log('鉴权失败');
useSessionStore.getState().delSession();
return window.location.replace('/signin');
}
if (status < 200 || status >= 300) {
return Promise.reject(new Error(data?.code + ':' + data?.message));
}
// if (data.code === 401) {
// console.log('鉴权失败');
// useSessionStore.getState().delSession();
// return window.location.replace('/signin');
// }
// if (status < 200 || status >= 300) {
// return Promise.reject(new Error(data?.code + ':' + data?.message));
// }

const apiResp = data as ApiResp;
if (apiResp?.code && (apiResp.code < 200 || apiResp.code >= 300)) {
return Promise.reject(apiResp);
}
// const apiResp = data as ApiResp;
// if (apiResp?.code && (apiResp.code < 200 || apiResp.code >= 300)) {
// return Promise.reject(apiResp);
// }

return data;
},
Expand Down
69 changes: 69 additions & 0 deletions service/license/src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

html,
body,
#__next {
width: 100vw;
height: 100vh;
overflow: hidden;
}

iframe {
border: none;
}

::-webkit-scrollbar,
::-webkit-scrollbar {
width: 8px;
height: 8px;
border-radius: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
background: transparent;
border-radius: 6px;
}
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
background: #6a6969;
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
background: #999;
}

::-webkit-scrollbar-corner {
background-color: transparent;
}

.icon {
width: 16px;
height: 16px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}

div {
&::-webkit-scrollbar-thumb,
&::-webkit-scrollbar-thumb {
background: transparent !important;
border-radius: 10px;
transition: 1s;
}
&:hover {
&::-webkit-scrollbar-thumb,
&::-webkit-scrollbar-thumb {
background: rgba(189, 193, 197, 0.5) !important;
}
&::-webkit-scrollbar-thumb:hover,
&::-webkit-scrollbar-thumb:hover {
background: rgba(189, 193, 197, 1) !important;
}
}
}
52 changes: 52 additions & 0 deletions service/license/src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { defineStyleConfig, extendTheme } from '@chakra-ui/react';

const Button = defineStyleConfig({
baseStyle: {
borderRadius: '4px'
},
sizes: {
sm: {},
md: {},
primary: {
width: '215px',
height: '36px'
}
},
variants: {
primary: {
bg: '#3E3B3B',
_hover: {
bg: '#3E3B3B',
_disabled: {
bg: '#3E3B3B'
}
},
color: '#FEFEFE'
}
}
});

const Input = defineStyleConfig({});

const Select = defineStyleConfig({
variants: {
filled: {
field: {
backgroundColor: '#F4F6F8'
}
}
},
defaultProps: {
size: 'md',
variant: 'filled'
}
});

export const theme = extendTheme({
initialColorMode: 'light',
components: {
Button,
Input,
Select
}
});

0 comments on commit 287b3cf

Please sign in to comment.