Merge remote-tracking branch 'upstream/main'

This commit is contained in:
ckt1031
2023-09-30 22:56:30 +08:00
13 changed files with 86 additions and 56 deletions

View File

@@ -2,9 +2,9 @@ import React, { useContext, useEffect, useState } from 'react';
import { Button, Divider, Form, Grid, Header, Image, Message, Modal, Segment } from 'semantic-ui-react';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import { UserContext } from '../context/User';
import { API, getLogo, showError, showInfo, showSuccess } from '../helpers';
import { API, getLogo, showError, showSuccess, showWarning } from '../helpers';
import Turnstile from 'react-turnstile';
import { getOAuthState, onGitHubOAuthClicked } from './utils';
import { onGitHubOAuthClicked } from './utils';
const LoginForm = () => {
const [inputs, setInputs] = useState({
@@ -94,8 +94,14 @@ const LoginForm = () => {
if (success) {
userDispatch({ type: 'login', payload: data });
localStorage.setItem('user', JSON.stringify(data));
navigate('/');
showSuccess('登录成功!');
if (username === 'root' && password === '123456') {
navigate('/user/edit');
showSuccess('登录成功!');
showWarning('请立刻修改默认密码!');
} else {
navigate('/token');
showSuccess('登录成功!');
}
} else {
showError(message);
}
@@ -170,7 +176,7 @@ const LoginForm = () => {
circular
color='black'
icon='github'
onClick={()=>onGitHubOAuthClicked(status.github_client_id)}
onClick={() => onGitHubOAuthClicked(status.github_client_id)}
/>
)}
{status.wechat_login && (

View File

@@ -69,7 +69,7 @@ const EditChannel = () => {
localModels = ['ERNIE-Bot', 'ERNIE-Bot-turbo', 'Embedding-V1'];
break;
case 17:
localModels = ['qwen-v1', 'qwen-plus-v1', 'text-embedding-v1'];
localModels = ['qwen-turbo', 'qwen-plus', 'text-embedding-v1'];
break;
case 16:
localModels = ['chatglm_pro', 'chatglm_std', 'chatglm_lite'];

View File

@@ -104,7 +104,7 @@ const EditUser = () => {
label='密码'
name='password'
type={'password'}
placeholder={'请输入新的密码'}
placeholder={'请输入新的密码,最短 8 位'}
onChange={handleInputChange}
value={password}
autoComplete='new-password'