Merge pull request 'dev' (#583) from dev into prd-deploy
Reviewed-on: #583
This commit is contained in:
commit
a092132b9f
@ -2,12 +2,13 @@ import { useContext } from 'react'
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useForm } from 'react-hook-form'
|
import { useForm } from 'react-hook-form'
|
||||||
import { sessionStore } from '@/store/commonAtom'
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
import { useRecoilValue, useRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { logout, setSession, login } from '@/lib/authActions'
|
import { login, logout, setSession } from '@/lib/authActions'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
import { useRouter } from 'next/navigation'
|
||||||
|
|
||||||
export default function ChangePasswordPop(props) {
|
export default function ChangePasswordPop(props) {
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
@ -18,6 +19,7 @@ export default function ChangePasswordPop(props) {
|
|||||||
const { patch } = useAxios(globalLocaleState)
|
const { patch } = useAxios(globalLocaleState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
||||||
|
const router = useRouter()
|
||||||
const formInitValue = {
|
const formInitValue = {
|
||||||
password1: '',
|
password1: '',
|
||||||
password2: '',
|
password2: '',
|
||||||
@ -128,12 +130,14 @@ export default function ChangePasswordPop(props) {
|
|||||||
} else {
|
} else {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
logout()
|
logout()
|
||||||
|
router.replace('/login', undefined, { shallow: true })
|
||||||
console.log('code not 200 error')
|
console.log('code not 200 error')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
logout()
|
logout()
|
||||||
|
router.replace('/login', undefined, { shallow: true })
|
||||||
console.log('catch::::::::', error)
|
console.log('catch::::::::', error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -207,6 +211,7 @@ export default function ChangePasswordPop(props) {
|
|||||||
className="btn-origin grey"
|
className="btn-origin grey"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
logout()
|
logout()
|
||||||
|
router.replace('/login', undefined, { shallow: true })
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{getMessage('main.popup.login.btn2')}
|
{getMessage('main.popup.login.btn2')}
|
||||||
|
|||||||
@ -3094,7 +3094,7 @@ export const useTrestle = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (!halfBottomRightModule) {
|
if (!halfBottomRightModule) {
|
||||||
halfBottomRightPoint = { x: x + w, y: y - height / 2 }
|
halfBottomRightPoint = { x: x + w, y: y + height / 2 }
|
||||||
halfBottomRightModule = centerPoints.find(
|
halfBottomRightModule = centerPoints.find(
|
||||||
(centerPoint) => Math.abs(centerPoint.x - halfBottomRightPoint.x) < maxX && Math.abs(centerPoint.y - halfBottomRightPoint.y) < maxY,
|
(centerPoint) => Math.abs(centerPoint.x - halfBottomRightPoint.x) < maxX && Math.abs(centerPoint.y - halfBottomRightPoint.y) < maxY,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import {
|
|||||||
} from '@/store/canvasAtom'
|
} from '@/store/canvasAtom'
|
||||||
import { QLine } from '@/components/fabric/QLine'
|
import { QLine } from '@/components/fabric/QLine'
|
||||||
import { basicSettingState } from '@/store/settingAtom'
|
import { basicSettingState } from '@/store/settingAtom'
|
||||||
import { calcLineActualSizeByLineLength } from '@/util/qpolygon-utils'
|
import { calcLineActualSizeByLineLength, calcLinePlaneSize } from '@/util/qpolygon-utils'
|
||||||
import { getDegreeByChon } from '@/util/canvas-util'
|
import { getDegreeByChon } from '@/util/canvas-util'
|
||||||
import { useText } from '@/hooks/useText'
|
import { useText } from '@/hooks/useText'
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
@ -31,6 +31,7 @@ export const useLine = () => {
|
|||||||
const addLine = (points = [], options) => {
|
const addLine = (points = [], options) => {
|
||||||
const line = new QLine(points, {
|
const line = new QLine(points, {
|
||||||
...options,
|
...options,
|
||||||
|
attributes: {},
|
||||||
fontSize: lengthText.fontSize.value,
|
fontSize: lengthText.fontSize.value,
|
||||||
fontFamily: lengthText.fontFamily.value,
|
fontFamily: lengthText.fontFamily.value,
|
||||||
})
|
})
|
||||||
@ -38,7 +39,7 @@ export const useLine = () => {
|
|||||||
if (line.length < 1) {
|
if (line.length < 1) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
line.attributes.planeSize = calcLinePlaneSize(line)
|
||||||
canvas?.add(line)
|
canvas?.add(line)
|
||||||
return line
|
return line
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user