Coder Social home page Coder Social logo

axum_admin's Introduction

  • 👋 Hi, I’m @lingdu1234
  • 👀 I’m interested in ...
  • 🌱 I’m currently learning ...
  • 💞️ I’m looking to collaborate on ...
  • 📫 How to reach me ...

axum_admin's People

Contributors

lingdu1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axum_admin's Issues

验证码不符合规范

image
这校验逻辑,等于无效。
有无办法,让验证有且仅有一次,比如验证一次就立即移除;超过2分钟也立即失效

No item named const_new` found for struct `tokio::sync::OnceCell

Hi!
Thank you for great crates!

Compiling db v0.1.0
error[E0599]: no function or associated item named `const_new` found for struct `tokio::sync::OnceCell` in the current scope
 --> db/src/db.rs:7:57
  |
7 | pub static DB: OnceCell<DatabaseConnection> = OnceCell::const_new();
  |                                                         ^^^^^^^^^ function or associated item not found in `tokio::sync::OnceCell<_>`

cargo 1.65.0 (4bc8f24d3 2022-10-20)

no such column: sys_menu.i18n

at C:\Users\Administrator.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\sea-orm-0.10.5\src\driver\sqlx_sqlite.rs:128 on ThreadId(1)

2023-03-13T11:56:47.7751335+08:00 INFO app_service::service_utils::api_utils: 初始化时获取路由API失败:Query(
SqlxError(
Database(
SqliteError {
code: 1,
message: "no such column: sys_menu.i18n",
},
),
),
)
at service\src\service_utils\api_utils.rs:45 on ThreadId(1)

我感觉在 Res::with_err 中分类err进行判断比较好

可以在service controller 中返回自定义的 thiserror:error
调用 Res::with_err(err:anyhow::Error)
然后再with_err 中可以去downcast_ref 判断错误类型并返回相应的信息,错误信息可以自定义,更灵活一些

api_prefix 怎么设置

let app = Router::new()
.nest(&CFG.server.api_prefix, apps::api())
// "/" 与所有路由冲突

数据库连接失败

thread 'main' panicked at '数据库打开失败: Conn("encountered unexpected or invalid data: expected NUL in byte sequence")', F:\rustWork\axum_admin-axum\db\src\db.rs:18:43
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error: process didn't exit successfully: target\debug\axum-admin.exe (exit code: 101)

我 执行 sea-orm-cli migrate up 报错
could not compile sqlx-macros due to previous error 好像编译不了

于是我就没有执行这个数据库迁移。我在本地弄了一个db 的127 的mysql ,我看了连接信息,没有问题,但是 数据库打开失败,
给点提示,我哪里错误了,

安装过程出现数据库写入中文字符错误

Execution Error: error returned from database: 1366 (22007): Incorrect string value: '\xE9\xA2\x84\xE8\xA7\x88...' for column iui314.sys_update_log.title at row 1
Execution Error: error returned from database: 1366 (22007): Incorrect string value: '\xE7\xA5\x9E\xE9\xA9\xAC' for column iui314.sys_user.user_nickname at row 1
表格数据初始化成功:migration/data/m20220101_000001_create_table/obj_sys_user_dept.sql
表格数据初始化成功:migration/data/m20220101_000001_create_table/obj_sys_user_post.sql
表格数据初始化成功:migration/data/m20220101_000001_create_table/obj_sys_user_role.sql
Execution Error: error returned from database: 1366 (22007): Incorrect string value: '\xE7\x94\xA8\xE6\x88\xB7...' for column iui314.test_data_scope.data_a at row 1

尝试对所有的sql脚本设置utf-8,只解决 部分错误 ,还是有中文无法写入。
尝试对mysql默认设置字符为utf-8,但查看mysql的iui314数据库仍然是latin1

MariaDB [(none)]> use iui314

Database changed
MariaDB [iui314]> SHOW VARIABLES LIKE 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_database | latin1 |
+--------------------------+----------------------------+

cargo run运行异常

编译都ok,但是cargo run后,打印信息后程序退出

axum_admin> cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.65s
Running target\debug\axum-admin.exe

                                       | |         (_)
 _ __   ___   ___ _ __ ___     __ _  __| |_ __ ___  _ _ __
| '_ \ / _ \ / _ \ '_ ` _ \   / _` |/ _` | '_ ` _ \| | '_ \
| |_) | (_) |  __/ | | | | | | (_| | (_| | | | | | | | | | |
| .__/ \___/ \___|_| |_| |_|  \__,_|\__,_|_| |_| |_|_|_| |_|
| |
|_|

。。。。。
at app\src\utils\api_utils.rs:42 on ThreadId(1)

78 2022-10-13T16:36:18.3031433+08:00 DEBUG sea_orm::driver::sqlx_sqlite: SELECT "sys_job"."job_id", "sys_job"."task_id", "sys_job"."task_count", "sys_job"."run_count", "sys_job"."job_name", "sys_job"."job_params", "sys_job"."job_group", "sys_job"."invoke_target", "sys_job"."cron_expression", "sys_job"."misfire_policy", "sys_job"."concurrent", "sys_job"."status", "sys_job"."create_by", "sys_job"."update_by", "sys_job"."remark", "sys_job"."last_time", "sys_job"."next_time", "sys_job"."end_time", "sys_job"."created_at", "sys_job"."updated_at", "sys_job"."deleted_at" FROM "sys_job" WHERE "sys_job"."status" = '1' ORDER BY "sys_job"."job_id" ASC
at d:\RUST_HOME.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\sea-orm-0.9.2\src\driver\sqlx_sqlite.rs:131 on ThreadId(1)

:87
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error: process didn't exit successfully: target\debug\axum-admin.exe (exit code: 101)

run error.txt

sqlite 数据库报错

初始化时获取路由API失败:Query( "error returned from database: (code: 1) no such column: sys_menu.log_method",

Consider adding axum_admin to SeaORM showcase!

Hey @lingdu1234, Thanks for adopting SeaORM!
It's our pleasure to see more inspirational projects were built on top of SeaORM :)

Let us know if you have any feature recommendation or feedback. Your contribution is what drive us forward!

Some learning resources for you: Documentation, Tutorial, Cookbook, Q&A, Blog
Join our Discord server to chat with others in the SeaQL community!

Feel free to submit a PR to showcase your project, SeaQL/sea-orm#403.

axum 版本无法编译

执行的命令:cargo run --bin axum-admin

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> /Users/yangxg/.cargo/registry/src/github.com-1ecc6299db9ec823/scru128-2.1.3/src/generator.rs:71:6
    |
71  | impl<R: RngCore> Scru128Generator<R> {
    |      ^
...
164 |     pub const fn last_status(&self) -> Status {
    |     ----------------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information

For more information about this error, try `rustc --explain E0658`.

是否是依赖库的版本问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.