This commit is contained in:
parent
35e99c7c9f
commit
0443185899
|
|
@ -12,7 +12,7 @@ import toast from "react-hot-toast";
|
|||
import md5 from "md5";
|
||||
|
||||
|
||||
import service from '@/lib/http/service';
|
||||
import getService from '@/lib/http/service';
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function MixSignIn(props: {
|
||||
|
|
@ -53,6 +53,7 @@ export function MixSignIn(props: {
|
|||
console.log("--username:", user, "--password:", password, "--md5 password:", (md5(password)))
|
||||
setIsLoading(true);
|
||||
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/customer/login', {
|
||||
user_name: user,
|
||||
password: md5(password),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Loading } from "@/components/ui/loading";
|
|||
import { toast } from "@/components/ui/toaster";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { OTPInput, SlotProps } from "input-otp";
|
||||
import service from "@/lib/http/service";
|
||||
import getService from "@/lib/http/service";
|
||||
import md5 from "md5";
|
||||
import { useTranslation } from "react-i18next";
|
||||
// import { Minus } from "lucide-react";
|
||||
|
|
@ -32,7 +32,7 @@ export const EmailCode: React.FC<Props> = ({ setError, emailValue, passwordValue
|
|||
)
|
||||
setIsLoading(true);
|
||||
|
||||
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/customer/register', {
|
||||
user_name: emailValue,
|
||||
email: emailValue,
|
||||
|
|
@ -68,6 +68,7 @@ export const EmailCode: React.FC<Props> = ({ setError, emailValue, passwordValue
|
|||
const resendCode = async () => {
|
||||
console.log("resendCode", emailValue)
|
||||
try {
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/common/auth-code', {
|
||||
user_name: emailValue,
|
||||
email: emailValue,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { FadeInStagger } from "@/components/landing/fade-in";
|
|||
import { Input } from "@/components/ui/input";
|
||||
import { toast } from "@/components/ui/toaster";
|
||||
import { useRouter } from "next/navigation";
|
||||
import service from "@/lib/http/service";
|
||||
import getService from "@/lib/http/service";
|
||||
|
||||
import Image from 'next/image';
|
||||
import showImage from '@/components/images/show.png';
|
||||
|
|
@ -132,6 +132,7 @@ export function EmailSignUp(props: {
|
|||
// }
|
||||
// });
|
||||
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/common/auth-code', {
|
||||
user_name: email,
|
||||
email: email,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { FadeInStagger } from "@/components/landing/fade-in";
|
|||
import { Input } from "@/components/ui/input";
|
||||
import { toast } from "@/components/ui/toaster";
|
||||
import { useRouter } from "next/navigation";
|
||||
import service from "@/lib/http/service";
|
||||
import getService from "@/lib/http/service";
|
||||
|
||||
import Image from 'next/image';
|
||||
import showImage from '@/components/images/show.png';
|
||||
|
|
@ -103,6 +103,7 @@ export function MixSignUp(props: {
|
|||
}
|
||||
setIsLoading(true)
|
||||
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/customer/uregister', {
|
||||
user_name: username,
|
||||
Referral: referrer,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Link from "next/link";
|
|||
import { notFound } from "next/navigation";
|
||||
|
||||
import { BLOG_PATH, getContentData, getFilePaths, getPost, getPostContent } from "@/lib/mdx-helper";
|
||||
import service from "@/lib/http/service";
|
||||
import getService from "@/lib/http/service";
|
||||
import { Header, NavBack, TimeP } from "@/components/header";
|
||||
import { baseTitle, baseURL, keywordsRoot } from "@/lib/metadata";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Link from "next/link";
|
|||
import { notFound } from "next/navigation";
|
||||
|
||||
import { BLOG_PATH, getContentData, getFilePaths, getPost, getQAContent } from "@/lib/mdx-helper";
|
||||
import service from "@/lib/http/service";
|
||||
import getService from "@/lib/http/service";
|
||||
import { Header, NavBack, TimeP } from "@/components/header";
|
||||
import { baseTitle, baseURL, keywordsRoot } from "@/lib/metadata";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { Header, NavBack } from "@/components/header";
|
|||
import { Footer } from "@/components/footer";
|
||||
import { Button, Checkbox, Form, GetProp, Input, Radio, RadioChangeEvent, Space } from "antd";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import service from "@/lib/http/service";
|
||||
import getService from "@/lib/http/service";
|
||||
import toast from 'react-hot-toast';
|
||||
import { UserData } from "@/components/user-menu";
|
||||
import { useLocalStorage } from "@/lib/hooks/use-local-storage";
|
||||
|
|
@ -132,6 +132,7 @@ export default function PostsPage() {
|
|||
|
||||
setIsLoadingInfo(true);
|
||||
async function initFunc() {
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/customer/sub-info', {
|
||||
email: infoRef.current.email
|
||||
}, {
|
||||
|
|
@ -178,6 +179,7 @@ export default function PostsPage() {
|
|||
|
||||
setInitLoading(true);
|
||||
async function initFunc() {
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/tag/list', {
|
||||
}, {
|
||||
headers: {
|
||||
|
|
@ -268,6 +270,7 @@ export default function PostsPage() {
|
|||
if (isLoading) return
|
||||
|
||||
setIsLoading(true);
|
||||
const service = await getService();
|
||||
let result: any = await service.post('/api/v1/customer/edit', {
|
||||
language,
|
||||
"first_name": values.first_name,
|
||||
|
|
@ -303,6 +306,7 @@ export default function PostsPage() {
|
|||
|
||||
console.log("values.first_name", values.first_name)
|
||||
// setIsLoading(true);
|
||||
const service = await getService();
|
||||
let result2: any = await service.post('/api/v1/customer/subscribe', {
|
||||
language,
|
||||
"first_name": values.first_name,
|
||||
|
|
@ -331,6 +335,7 @@ export default function PostsPage() {
|
|||
|
||||
}
|
||||
setIsLoading(true);
|
||||
const service = await getService();
|
||||
let result3: any = await service.post('/api/v1/customer/unsubscribe', {
|
||||
language,
|
||||
"email": values.email,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|||
|
||||
|
||||
|
||||
import service from '@/lib/http/service';
|
||||
import getService from '@/lib/http/service';
|
||||
import toast from 'react-hot-toast';
|
||||
import { Button } from '../ui/button';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
|
@ -151,6 +151,7 @@ const NineGrid: React.FC<NineGridProps> = ({
|
|||
|
||||
|
||||
setInitLoading(true);
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/qa/list', {
|
||||
language,
|
||||
"page_no": current - 1,
|
||||
|
|
@ -201,7 +202,7 @@ const NineGrid: React.FC<NineGridProps> = ({
|
|||
|
||||
tag = tag == categoriesRef.current[0].value ? "" : tag
|
||||
|
||||
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/news/list', {
|
||||
"id": 0,
|
||||
language,
|
||||
|
|
@ -488,6 +489,7 @@ const Article = () => {
|
|||
let isMounted = true
|
||||
|
||||
async function initFunc() {
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/tag/list', {
|
||||
}, {
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Link from "next/link";
|
|||
import { Container } from "@/components/landing/container";
|
||||
import { FadeIn } from "@/components/landing/fade-in";
|
||||
import { NewsletterForm } from "@/components/landing/newsletter";
|
||||
import service from '@/lib/http/service';
|
||||
import getService from '@/lib/http/service';
|
||||
import { useLocalStorage } from '@/lib/hooks/use-local-storage';
|
||||
import { UserData } from './user-menu';
|
||||
import toast from 'react-hot-toast';
|
||||
|
|
@ -68,6 +68,7 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) {
|
|||
console.log('Finish:', values);
|
||||
if (isLoading) return
|
||||
setIsLoading(true);
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/customer/subscribe', {
|
||||
"first_name": values.first_name,
|
||||
"email": values.email,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
DropdownMenuTrigger
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import { sync } from 'framer-motion'
|
||||
import service from '@/lib/http/service'
|
||||
import getService from '@/lib/http/service'
|
||||
import React from 'react'
|
||||
import toast from 'react-hot-toast'
|
||||
import { useRouter } from 'next/navigation'
|
||||
|
|
@ -118,6 +118,7 @@ export function UserMenu({ user }: { user: UserData }) {
|
|||
console.log('logout')
|
||||
if (isLoading) return
|
||||
setIsLoading(true);
|
||||
const service = await getService();
|
||||
await service.post('/api/v1/customer/logout', {
|
||||
}, {
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue