fix: fix some issues with berry (#913)
* fix: login address error * fix: Normal users display profile menu * fix: remove redundant code
This commit is contained in:
parent
c9ebcab8b8
commit
37afb313b5
@ -87,7 +87,7 @@ const panel = {
|
|||||||
url: '/panel/profile',
|
url: '/panel/profile',
|
||||||
icon: icons.IconUserScan,
|
icon: icons.IconUserScan,
|
||||||
breadcrumbs: false,
|
breadcrumbs: false,
|
||||||
isAdmin: true
|
isAdmin: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'setting',
|
id: 'setting',
|
||||||
|
@ -14,7 +14,7 @@ API.interceptors.response.use(
|
|||||||
if (error.response?.status === 401) {
|
if (error.response?.status === 401) {
|
||||||
localStorage.removeItem('user');
|
localStorage.removeItem('user');
|
||||||
store.dispatch({ type: LOGIN, payload: null });
|
store.dispatch({ type: LOGIN, payload: null });
|
||||||
window.location.href = config.basename + '/login';
|
window.location.href = config.basename + 'login';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error.response?.data?.message) {
|
if (error.response?.data?.message) {
|
||||||
|
@ -38,8 +38,6 @@ const validationSchema = Yup.object().shape({
|
|||||||
then: Yup.string().required("密钥 不能为空"),
|
then: Yup.string().required("密钥 不能为空"),
|
||||||
}),
|
}),
|
||||||
other: Yup.string(),
|
other: Yup.string(),
|
||||||
proxy: Yup.string(),
|
|
||||||
test_model: Yup.string(),
|
|
||||||
models: Yup.array().min(1, "模型 不能为空"),
|
models: Yup.array().min(1, "模型 不能为空"),
|
||||||
groups: Yup.array().min(1, "用户组 不能为空"),
|
groups: Yup.array().min(1, "用户组 不能为空"),
|
||||||
base_url: Yup.string().when("type", {
|
base_url: Yup.string().when("type", {
|
||||||
@ -623,71 +621,6 @@ const EditModal = ({ open, channelId, onCancel, onOk }) => {
|
|||||||
</FormHelperText>
|
</FormHelperText>
|
||||||
)}
|
)}
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl
|
|
||||||
fullWidth
|
|
||||||
error={Boolean(touched.proxy && errors.proxy)}
|
|
||||||
sx={{ ...theme.typography.otherInput }}
|
|
||||||
>
|
|
||||||
<InputLabel htmlFor="channel-proxy-label">
|
|
||||||
{inputLabel.proxy}
|
|
||||||
</InputLabel>
|
|
||||||
<OutlinedInput
|
|
||||||
id="channel-proxy-label"
|
|
||||||
label={inputLabel.proxy}
|
|
||||||
type="text"
|
|
||||||
value={values.proxy}
|
|
||||||
name="proxy"
|
|
||||||
onBlur={handleBlur}
|
|
||||||
onChange={handleChange}
|
|
||||||
inputProps={{}}
|
|
||||||
aria-describedby="helper-text-channel-proxy-label"
|
|
||||||
/>
|
|
||||||
{touched.proxy && errors.proxy ? (
|
|
||||||
<FormHelperText error id="helper-tex-channel-proxy-label">
|
|
||||||
{errors.proxy}
|
|
||||||
</FormHelperText>
|
|
||||||
) : (
|
|
||||||
<FormHelperText id="helper-tex-channel-proxy-label">
|
|
||||||
{" "}
|
|
||||||
{inputPrompt.proxy}{" "}
|
|
||||||
</FormHelperText>
|
|
||||||
)}
|
|
||||||
</FormControl>
|
|
||||||
{inputPrompt.test_model && (
|
|
||||||
<FormControl
|
|
||||||
fullWidth
|
|
||||||
error={Boolean(touched.test_model && errors.test_model)}
|
|
||||||
sx={{ ...theme.typography.otherInput }}
|
|
||||||
>
|
|
||||||
<InputLabel htmlFor="channel-test_model-label">
|
|
||||||
{inputLabel.test_model}
|
|
||||||
</InputLabel>
|
|
||||||
<OutlinedInput
|
|
||||||
id="channel-test_model-label"
|
|
||||||
label={inputLabel.test_model}
|
|
||||||
type="text"
|
|
||||||
value={values.test_model}
|
|
||||||
name="test_model"
|
|
||||||
onBlur={handleBlur}
|
|
||||||
onChange={handleChange}
|
|
||||||
inputProps={{}}
|
|
||||||
aria-describedby="helper-text-channel-test_model-label"
|
|
||||||
/>
|
|
||||||
{touched.test_model && errors.test_model ? (
|
|
||||||
<FormHelperText
|
|
||||||
error
|
|
||||||
id="helper-tex-channel-test_model-label"
|
|
||||||
>
|
|
||||||
{errors.test_model}
|
|
||||||
</FormHelperText>
|
|
||||||
) : (
|
|
||||||
<FormHelperText id="helper-tex-channel-test_model-label">
|
|
||||||
{" "}
|
|
||||||
{inputPrompt.test_model}{" "}
|
|
||||||
</FormHelperText>
|
|
||||||
)}
|
|
||||||
</FormControl>
|
|
||||||
)}
|
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={onCancel}>取消</Button>
|
<Button onClick={onCancel}>取消</Button>
|
||||||
<Button
|
<Button
|
||||||
|
Loading…
Reference in New Issue
Block a user