Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 修复导入问题 #1684

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions zhenxun/builtin_plugins/web_ui/api/tabs/plugin_manage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from ....base_model import Result
from ....utils import authentication

require("plugin_store")
from zhenxun.builtin_plugins.plugin_store import ShopManage

router = APIRouter(prefix="/store")


Expand All @@ -20,6 +17,9 @@
)
async def _() -> Result:
try:
require("plugin_store")
from zhenxun.builtin_plugins.plugin_store import ShopManage

data = await ShopManage.get_data()
plugin_list = [
{**data[name].dict(), "name": name, "id": idx}
Expand All @@ -40,6 +40,9 @@ async def _() -> Result:
)
async def _(param: PluginIr) -> Result:
try:
require("plugin_store")
from zhenxun.builtin_plugins.plugin_store import ShopManage

result = await ShopManage.add_plugin(param.id) # type: ignore
return Result.ok(info=result)
except Exception as e:
Expand All @@ -53,6 +56,9 @@ async def _(param: PluginIr) -> Result:
)
async def _(param: PluginIr) -> Result:
try:
require("plugin_store")
from zhenxun.builtin_plugins.plugin_store import ShopManage

result = await ShopManage.update_plugin(param.id) # type: ignore
return Result.ok(info=result)
except Exception as e:
Expand All @@ -66,6 +72,9 @@ async def _(param: PluginIr) -> Result:
)
async def _(param: PluginIr) -> Result:
try:
require("plugin_store")
from zhenxun.builtin_plugins.plugin_store import ShopManage

result = await ShopManage.remove_plugin(param.id) # type: ignore
return Result.ok(info=result)
except Exception as e:
Expand Down
Loading