import { Button, Input, Popup, SafeArea, Toast } from "@nutui/nutui-react-taro"; import { useEffect, useState } from "react"; import auth from "@/services/auth"; import { userStore } from "@/store/user-store"; import Taro from "@tarojs/taro"; import { aesEncrypt } from "@/utils/aes"; import Captcha from "@/components/captcha"; import { Image, Text, View } from "@tarojs/components"; import base from "@/hocs/base"; import { Icon } from "@/components"; import dayjs from "dayjs"; import { APP_VERSION } from "@/constant"; export default base(function Page() { const setUser = userStore((state) => state.setUser); const [showBasic, setShowBasic] = useState(false); const [username, setUsername] = useState(); const [password, setPassword] = useState(); const [channel, setChannel] = useState(); const initChannel = async () => { const { data } = await auth.channel.selectChannelByDomain({ domain: "operation.erp.qilincloud168.com", }); setChannel(data.data); }; useEffect(() => { initChannel().then(); }, []); return ( { setShowBasic(false); }} > { const formData = { token: token, username: username!, password: aesEncrypt(password!), }; const { data } = await auth.userAuth.passwordLogin(formData); if (data.success) { await setUser(); setShowBasic(false); Taro.reLaunch({ url: `/pages/main/index/index`, }); } }} /> {/* Logo展示区域 */} {channel?.logo && ( )} {channel?.title} 账号 { setUsername(value); }} /> 密码 { setPassword(value); }} /> 忘记密码? 版本号:{APP_VERSION} © {dayjs().format("YYYY")} {channel?.technicalSupport} 版权所有 ); });