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 { useToast } from '@answer/hooks';
|
||||
import { useSmtpSetting, updateSmtpSetting } from '@answer/api';
|
||||
|
||||
import { useSmtpSetting, updateSmtpSetting } from '@/services';
|
||||
import pattern from '@/common/pattern';
|
||||
|
||||
const Smtp: FC = () => {
|
||||
|
|
|
@ -3,14 +3,14 @@ import { Form, Button } from 'react-bootstrap';
|
|||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { changeEmail, checkImgCode } from '@answer/api';
|
||||
import type {
|
||||
ImgCodeRes,
|
||||
PasswordResetReq,
|
||||
FormDataType,
|
||||
} from '@answer/common/interface';
|
||||
import { userInfoStore } from '@answer/stores';
|
||||
import { loggedUserInfoStore } from '@answer/stores';
|
||||
|
||||
import { changeEmail, checkImgCode } from '@/services';
|
||||
import { PicAuthCodeModal } from '@/components/Modal';
|
||||
|
||||
const Index: FC = () => {
|
||||
|
@ -34,7 +34,7 @@ const Index: FC = () => {
|
|||
});
|
||||
const [showModal, setModalState] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
const { user: userInfo, update: updateUser } = userInfoStore();
|
||||
const { user: userInfo, update: updateUser } = loggedUserInfoStore();
|
||||
|
||||
const getImgCode = () => {
|
||||
checkImgCode({
|
||||
|
|
|
@ -3,9 +3,8 @@ import { Container, Row, Col } from 'react-bootstrap';
|
|||
import { Link, useSearchParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { changeEmailVerify, getUserInfo } from '@/services';
|
||||
import { userInfoStore } from '@answer/stores';
|
||||
|
||||
import { loggedUserInfoStore } from '@/stores';
|
||||
import { changeEmailVerify, getLoggedUserInfo } from '@/services';
|
||||
import { PageTitle } from '@/components';
|
||||
|
||||
const Index: FC = () => {
|
||||
|
@ -13,7 +12,7 @@ const Index: FC = () => {
|
|||
const [searchParams] = useSearchParams();
|
||||
const [step, setStep] = useState('loading');
|
||||
|
||||
const updateUser = userInfoStore((state) => state.update);
|
||||
const updateUser = loggedUserInfoStore((state) => state.update);
|
||||
|
||||
useEffect(() => {
|
||||
const code = searchParams.get('code');
|
||||
|
@ -22,7 +21,7 @@ const Index: FC = () => {
|
|||
changeEmailVerify({ code })
|
||||
.then(() => {
|
||||
setStep('success');
|
||||
getUserInfo().then((res) => {
|
||||
getLoggedUserInfo().then((res) => {
|
||||
// update user info
|
||||
updateUser(res);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue