Wangbo 4 weeks ago
parent
commit
117ba692db

BIN
app/signin/assets/background.png


+ 10 - 5
app/signin/components/mail-and-password-auth.tsx

@@ -103,6 +103,7 @@ export default function MailAndPasswordAuth({ isInvite, allowRegistration }: Mai
   }
 
   return <form onSubmit={() => { }}>
+    {/* 登录页输入框 */}
     <div className='mb-3'>
       <label htmlFor="email" className="my-2 system-md-semibold text-text-secondary">
         {t('login.email')}
@@ -124,9 +125,7 @@ export default function MailAndPasswordAuth({ isInvite, allowRegistration }: Mai
     <div className='mb-3'>
       <label htmlFor="password" className="my-2 flex items-center justify-between">
         <span className='system-md-semibold text-text-secondary'>{t('login.password')}</span>
-        <Link href={`/reset-password?${searchParams.toString()}`} className='system-xs-regular text-components-button-secondary-accent-text'>
-          {t('login.forget')}
-        </Link>
+        
       </label>
       <div className="relative mt-1">
         <Input
@@ -142,7 +141,7 @@ export default function MailAndPasswordAuth({ isInvite, allowRegistration }: Mai
           placeholder={t('login.passwordPlaceholder') || ''}
           tabIndex={2}
         />
-        <div className="absolute inset-y-0 right-0 flex items-center">
+        {/* <div className="absolute inset-y-0 right-0 flex items-center">
           <Button
             type="button"
             variant='ghost'
@@ -150,8 +149,14 @@ export default function MailAndPasswordAuth({ isInvite, allowRegistration }: Mai
           >
             {showPassword ? '👀' : '😝'}
           </Button>
-        </div>
+        </div> */}
+      </div>
+      <div style={{textAlign: 'right'}}>
+        <Link href={`/reset-password?${searchParams.toString()}`} className='system-xs-regular text-components-button-secondary-accent-text'>
+          {t('login.forget')}
+        </Link>
       </div>
+      
     </div>
 
     <div className='mb-2'>

+ 41 - 6
app/signin/layout.tsx

@@ -1,10 +1,25 @@
+import Script from 'next/script'
 import Header from './_header'
 import style from './page.module.css'
 
 import cn from '@/utils/classnames'
+import { IS_CE_EDITION } from '@/config'
 
 export default async function SignInLayout({ children }: any) {
   return <>
+    {!IS_CE_EDITION && (
+      <>
+        <Script strategy="beforeInteractive" async src={'https://www.googletagmanager.com/gtag/js?id=AW-11217955271'}></Script>
+        <Script
+          id="ga-monitor-register"
+          dangerouslySetInnerHTML={{
+            __html: 'window.dataLayer2 = window.dataLayer2 || [];function gtag(){dataLayer2.push(arguments);}gtag(\'js\', new Date());gtag(\'config\', \'AW-11217955271"\');',
+          }}
+        >
+        </Script>
+      </>
+    )}
+{/* 登录页 */}
     <div className={cn(
       style.background,
       'flex w-full min-h-screen',
@@ -21,17 +36,37 @@ export default async function SignInLayout({ children }: any) {
         <Header />
         <div className={
           cn(
-            'flex flex-col items-center w-full grow justify-center',
+            // 'flex flex-wrap items-center w-full grow justify-center',
+            style.loginflex,
             'px-6',
-            'md:px-[108px]',
+            'md:px-[10px]'
+            ,
           )
         }>
-          <div className='flex flex-col md:w-[400px]'>
-            {children}
+
+          <div style={{
+            margin: 'auto',
+          }
+          }>
+            <div className={cn(
+              style.login,
+              'flex md:w-[400px]'
+            )}>
+            </div>
+          </div>
+          <div style={{
+            margin: 'auto',
+            boxShadow: 'rgba(149, 157, 165, 0.2) 0px 8px 24px',
+            padding: '90px 50px',
+          }
+          }>
+            <div className='md:w-[400px]'>
+              {children}
+            </div>
           </div>
         </div>
-        <div className='px-8 py-6 system-xs-regular text-text-tertiary'>
-          © {new Date().getFullYear()} LangGenius, Inc. All rights reserved.
+        <div style={{textAlign: 'center'}} className='px-8 py-6 system-xs-regular text-text-tertiary'>
+          © {new Date().getFullYear()} 桂林理工大学, 桂林壹斗米信息科技有限公司
         </div>
       </div>
     </div>

+ 33 - 17
app/signin/normalForm.tsx

@@ -13,6 +13,7 @@ import { getSystemFeatures, invitationCheck } from '@/service/common'
 import { LicenseStatus, defaultSystemFeatures } from '@/types/feature'
 import Toast from '@/app/components/base/toast'
 import { IS_CE_EDITION } from '@/config'
+import style from './page.module.css'
 
 const NormalForm = () => {
   const { t } = useTranslation()
@@ -128,6 +129,7 @@ const NormalForm = () => {
 
   return (
     <>
+      {/* 登录页输入模块 */}
       <div className="w-full mx-auto mt-8">
         {isInviteLink
           ? <div className="w-full mx-auto">
@@ -135,7 +137,18 @@ const NormalForm = () => {
             <p className='mt-2 body-md-regular text-text-tertiary'>{t('login.joinTipStart')}{workspaceName}{t('login.joinTipEnd')}</p>
           </div>
           : <div className="w-full mx-auto">
-            <h2 className="title-4xl-semi-bold text-text-primary">{t('login.pageTitle')}</h2>
+            {/* <h2 className="title-4xl-semi-bold text-text-primary">{t('login.pageTitle')}</h2> */}
+            <div>
+              <span style={{margin:'0 auto'}}>
+                <span className={cn(style.himg)}></span>
+                <span className={cn(style.eimg)}></span>
+                <span className={cn(style.limg)}></span>
+                <span className={cn(style.limg)}></span>
+                <span className={cn(style.oimg)}></span>
+              </span>
+
+
+            </div>
             <p className='mt-2 body-md-regular text-text-tertiary'>{t('login.welcome')}</p>
           </div>}
         <div className="bg-white">
@@ -184,29 +197,32 @@ const NormalForm = () => {
               </div>
             </div>
           </>}
-          <div className="w-full block mt-2 system-xs-regular text-text-tertiary">
-            {t('login.tosDesc')}
-            &nbsp;
-            <Link
-              className='system-xs-medium text-text-secondary hover:underline'
-              target='_blank' rel='noopener noreferrer'
-              href='https://dify.ai/terms'
-            >{t('login.tos')}</Link>
-            &nbsp;&&nbsp;
-            <Link
-              className='system-xs-medium text-text-secondary hover:underline'
-              target='_blank' rel='noopener noreferrer'
-              href='https://dify.ai/privacy'
-            >{t('login.pp')}</Link>
+          <div className="w-full block mt-2 system-xs-regular text-text-tertiary" style={{ display: 'flex', alignItems: 'center' }}>
+            <input type="checkbox" value="sleep" checked></input>&nbsp;
+            <div>
+              {t('login.tosDesc')}
+              &nbsp;
+              <Link
+                className='system-xs-medium text-text-secondary hover:underline'
+                target='_blank' rel='noopener noreferrer'
+                href='https://dify.ai/terms'
+              >{t('login.tos')}</Link>
+              &nbsp;和&nbsp;
+              <Link
+                className='system-xs-medium text-text-secondary hover:underline'
+                target='_blank' rel='noopener noreferrer'
+                href='https://dify.ai/privacy'
+              >{t('login.pp')}</Link>
+            </div>
           </div>
-          {IS_CE_EDITION && <div className="w-hull block mt-2 system-xs-regular text-text-tertiary">
+          {/* {IS_CE_EDITION && <div className="w-hull block mt-2 system-xs-regular text-text-tertiary">
             {t('login.goToInit')}
             &nbsp;
             <Link
               className='system-xs-medium text-text-secondary hover:underline'
               href='/install'
             >{t('login.setAdminAccount')}</Link>
-          </div>}
+          </div>} */}
 
         </div>
       </div>

+ 108 - 1
app/signin/page.module.css

@@ -9,4 +9,111 @@
 .background {
   background-image: url('./assets/background.png');
   background-size: cover;
-}
+}
+
+.login {
+  background-image: url('./assets/login.png');
+  background-size: cover;
+  width:250px;
+  height:200px;
+  margin: auto;
+}
+
+.himg {
+  background-image: url('./assets/h.svg');
+  background-size: cover;
+  width:30px;
+  height:30px;
+  /* margin: auto; */
+  display: inline-block;
+}
+
+.eimg {
+  background-image: url('./assets/e.svg');
+  background-size: cover;
+  width:30px;
+  height:30px;
+  /* margin: auto; */
+  display: inline-block;
+  margin-left: -5px;
+}
+
+.limg {
+  background-image: url('./assets/l.svg');
+  background-size: cover;
+  width:30px;
+  height:30px;
+  /* margin: auto; */
+  margin-left: -5px;
+  display: inline-block;
+}
+
+.oimg {
+  background-image: url('./assets/o.svg');
+  background-size: cover;
+  width:30px;
+  height:30px;
+  /* margin: auto; */
+  margin-left: -5px;
+  display: inline-block;
+}
+
+.loginflex{
+  /* display: flex;
+  justify-content: space-around; */
+  height:85%;
+  padding:5%;
+  width: 80vw;
+  margin: auto;
+}
+
+@media (min-width: 576px) {
+  .loginflex{
+    display: flex;
+    justify-content: space-around;
+    height:85%;
+    padding:5%;
+    /* margin: auto; */
+    width: 90vw;
+  }
+
+  .login {
+    width:250px;
+    height:200px;
+    margin: auto;
+  }
+  
+}
+
+
+  @media (min-width: 768px) {
+    .loginflex{
+      display: flex;
+      justify-content: space-around;
+      height:85%;
+      padding:5%;
+      margin: auto;
+    }
+
+    .login {
+      width:350px;
+      height:300px;
+      margin: auto;
+    }
+    
+  }
+
+  @media (min-width: 992px) {
+    .loginflex{
+      display: flex;
+      justify-content: space-around;
+      height:85%;
+      padding:5%;
+    }
+
+    .login {
+      width:350px;
+      height:300px;
+      margin: auto;
+    }
+  }