mirror of https://gitee.com/answerdev/answer.git
refactor(services): update some service import issue
This commit is contained in:
parent
d11c714adb
commit
04b1b46ef2
|
@ -4,8 +4,8 @@ import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import type * as Type from '@answer/common/interface';
|
import type * as Type from '@answer/common/interface';
|
||||||
import { useToast } from '@answer/hooks';
|
import { useToast } from '@answer/hooks';
|
||||||
import { useSmtpSetting, updateSmtpSetting } from '@answer/api';
|
|
||||||
|
|
||||||
|
import { useSmtpSetting, updateSmtpSetting } from '@/services';
|
||||||
import pattern from '@/common/pattern';
|
import pattern from '@/common/pattern';
|
||||||
|
|
||||||
const Smtp: FC = () => {
|
const Smtp: FC = () => {
|
||||||
|
|
|
@ -3,14 +3,14 @@ import { Form, Button } from 'react-bootstrap';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { changeEmail, checkImgCode } from '@answer/api';
|
|
||||||
import type {
|
import type {
|
||||||
ImgCodeRes,
|
ImgCodeRes,
|
||||||
PasswordResetReq,
|
PasswordResetReq,
|
||||||
FormDataType,
|
FormDataType,
|
||||||
} from '@answer/common/interface';
|
} from '@answer/common/interface';
|
||||||
import { userInfoStore } from '@answer/stores';
|
import { loggedUserInfoStore } from '@answer/stores';
|
||||||
|
|
||||||
|
import { changeEmail, checkImgCode } from '@/services';
|
||||||
import { PicAuthCodeModal } from '@/components/Modal';
|
import { PicAuthCodeModal } from '@/components/Modal';
|
||||||
|
|
||||||
const Index: FC = () => {
|
const Index: FC = () => {
|
||||||
|
@ -34,7 +34,7 @@ const Index: FC = () => {
|
||||||
});
|
});
|
||||||
const [showModal, setModalState] = useState(false);
|
const [showModal, setModalState] = useState(false);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { user: userInfo, update: updateUser } = userInfoStore();
|
const { user: userInfo, update: updateUser } = loggedUserInfoStore();
|
||||||
|
|
||||||
const getImgCode = () => {
|
const getImgCode = () => {
|
||||||
checkImgCode({
|
checkImgCode({
|
||||||
|
|
|
@ -3,9 +3,8 @@ import { Container, Row, Col } from 'react-bootstrap';
|
||||||
import { Link, useSearchParams } from 'react-router-dom';
|
import { Link, useSearchParams } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { changeEmailVerify, getUserInfo } from '@/services';
|
import { loggedUserInfoStore } from '@/stores';
|
||||||
import { userInfoStore } from '@answer/stores';
|
import { changeEmailVerify, getLoggedUserInfo } from '@/services';
|
||||||
|
|
||||||
import { PageTitle } from '@/components';
|
import { PageTitle } from '@/components';
|
||||||
|
|
||||||
const Index: FC = () => {
|
const Index: FC = () => {
|
||||||
|
@ -13,7 +12,7 @@ const Index: FC = () => {
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
const [step, setStep] = useState('loading');
|
const [step, setStep] = useState('loading');
|
||||||
|
|
||||||
const updateUser = userInfoStore((state) => state.update);
|
const updateUser = loggedUserInfoStore((state) => state.update);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const code = searchParams.get('code');
|
const code = searchParams.get('code');
|
||||||
|
@ -22,7 +21,7 @@ const Index: FC = () => {
|
||||||
changeEmailVerify({ code })
|
changeEmailVerify({ code })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
setStep('success');
|
setStep('success');
|
||||||
getUserInfo().then((res) => {
|
getLoggedUserInfo().then((res) => {
|
||||||
// update user info
|
// update user info
|
||||||
updateUser(res);
|
updateUser(res);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue