mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
update README.rst
This commit is contained in:
@@ -121,7 +121,7 @@ And set ``permission=True`` to active it:
|
||||
|
||||
Enum Support
|
||||
~~~~~~~~~~~~
|
||||
When you define a enum field of tortoise-orm,like ``IntEnumField``,you can inherit ``fastapi_admin.enum.EnumMixin`` and impl ``choices()`` method,
|
||||
When you define a enum field of tortoise-orm,like ``IntEnumField``,you can inherit ``fastapi_admin.enums.EnumMixin`` and impl ``choices()`` method,
|
||||
FastAPI-admin will auto read and display and render a ``select`` widget in front.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -3,7 +3,6 @@ import json
|
||||
import jwt
|
||||
from fastapi import Query, Path, Depends, HTTPException
|
||||
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||
from fastapi.security.utils import get_authorization_scheme_param
|
||||
from pydantic import BaseModel
|
||||
from starlette.requests import Request
|
||||
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN, HTTP_404_NOT_FOUND
|
||||
|
||||
@@ -13,7 +13,7 @@ router = APIRouter()
|
||||
)
|
||||
async def home():
|
||||
return {
|
||||
'title': "Welcome to REST ADMIN"
|
||||
'title': "Welcome to FastAPI ADMIN"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import axios from 'axios'
|
||||
import store, { types } from './store'
|
||||
import store, {types} from './store'
|
||||
import _ from 'lodash'
|
||||
|
||||
const API_URI = process.env.VUE_APP_API_URL || '/admin/api/'
|
||||
@@ -20,7 +20,7 @@ axios.interceptors.response.use(response => {
|
||||
return response;
|
||||
}, ({response}) => {
|
||||
store.commit(types.STOP_LOADING)
|
||||
const { data, status, statusText } = response
|
||||
const {data, status, statusText} = response
|
||||
switch (status) {
|
||||
case 422:
|
||||
|
||||
@@ -37,7 +37,7 @@ axios.interceptors.response.use(response => {
|
||||
if (Array.isArray(msg)) {
|
||||
msg = msg[0].message
|
||||
}
|
||||
|
||||
|
||||
if (msg) {
|
||||
Vue.prototype.$snotify.error(String(msg))
|
||||
} else {
|
||||
@@ -48,4 +48,4 @@ axios.interceptors.response.use(response => {
|
||||
|
||||
Vue.prototype.$http = axios
|
||||
|
||||
export default axios
|
||||
export default axios
|
||||
|
||||
Reference in New Issue
Block a user