Skip to content

Commit

Permalink
fix: 中文输入法回车触发提交 & 默认没有 icp 备案号
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Sep 16, 2023
1 parent b57fb13 commit 0f8818e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion init.db.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func initDB() {
`
stmt, err := db.Prepare(sql_add_setting)
checkErr(err)
res, err := stmt.Exec(0, "favicon.ico", "Van Nav", "京ICP证XXXXXXXX号", "logo192.png", "logo512.png", false, false, true)
res, err := stmt.Exec(0, "favicon.ico", "Van Nav", "", "logo192.png", "logo512.png", false, false, true)
checkErr(err)
_, err = res.LastInsertId()
checkErr(err)
Expand Down
5 changes: 3 additions & 2 deletions ui/website/src/components/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ const Content = (props: any) => {

const onKeyEnter = (ev: KeyboardEvent) => {
const cards = filteredDataRef.current;
if (ev.code === "Enter") {
// 使用 keyCode 防止与中文输入冲突
if (ev.keyCode === 13) {
if (cards && cards.length) {
window.open(cards[0]?.url, "_blank");
resetSearch();
Expand Down Expand Up @@ -212,7 +213,7 @@ const Content = (props: any) => {
</div>
</div>
<div className="record-wraper">
<a href="https://beian.miit.gov.cn" target="_blank" rel="noreferrer">{data?.setting?.govRecord ?? "京ICP证XXXXXXXX号"}</a>
<a href="https://beian.miit.gov.cn" target="_blank" rel="noreferrer">{data?.setting?.govRecord ?? ""}</a>
</div>
{showGithub && <GithubLink />}
<DarkSwitch showGithub={showGithub} />
Expand Down

0 comments on commit 0f8818e

Please sign in to comment.