Skip to content

Commit

Permalink
fix: 默认不展示icp证
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Sep 15, 2023
1 parent 49bbef3 commit b57fb13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func updateCatelog(data updateCatelogDto, db *sql.DB) {
func getImgFromDB(url1 string, db *sql.DB) Img {
urlEncoded := url.QueryEscape(url1)
sql_get_img := `
SELECT * FROM nav_img
SELECT id,url,value FROM nav_img
WHERE url=?;
`
rows, err := db.Query(sql_get_img, urlEncoded)
Expand Down Expand Up @@ -260,7 +260,7 @@ func addTool(data addToolDto, db *sql.DB) int64 {

func getAllTool(db *sql.DB) []Tool {
sql_get_all := `
SELECT * FROM nav_table order by sort;
SELECT id,name,url,logo,catelog,desc,sort,hide FROM nav_table order by sort;
`
results := make([]Tool, 0)
rows, err := db.Query(sql_get_all)
Expand Down Expand Up @@ -294,7 +294,7 @@ func getAllTool(db *sql.DB) []Tool {

func getAllCatelog(db *sql.DB) []Catelog {
sql_get_all := `
SELECT * FROM nav_catelog order by sort;
SELECT id,name,sort FROM nav_catelog order by sort;
`
results := make([]Catelog, 0)
rows, err := db.Query(sql_get_all)
Expand Down Expand Up @@ -455,7 +455,7 @@ func importTools(data []Tool) {

func getSetting(db *sql.DB) Setting {
sql_get_user := `
SELECT * FROM nav_setting WHERE id = ?;
SELECT id,favicon,title,govRecord,logo192,logo512,hideAdmin,hideGithub,jumpTargetBlank FROM nav_setting WHERE id = ?;
`
var setting Setting
row := db.QueryRow(sql_get_user, 0)
Expand All @@ -469,7 +469,7 @@ func getSetting(db *sql.DB) Setting {
Id: 0,
Favicon: "favicon.ico",
Title: "Van Nav",
GovRecord: "京ICP证XXXXXXXX号",
GovRecord: "",
Logo192: "logo192.png",
Logo512: "logo512.png",
HideAdmin: false,
Expand Down Expand Up @@ -514,7 +514,7 @@ func getSetting(db *sql.DB) Setting {

func getApiTokens(db *sql.DB) []Token {
sql_get_api_tokens := `
SELECT * FROM nav_api_token WHERE disabled = 0;
SELECT id,name,value,disabled FROM nav_api_token WHERE disabled = 0;
`
results := make([]Token, 0)
rows, err := db.Query(sql_get_api_tokens)
Expand All @@ -531,7 +531,7 @@ func getApiTokens(db *sql.DB) []Token {

func getUser(name string, db *sql.DB) User {
sql_get_user := `
SELECT * FROM nav_user WHERE name = ?;
SELECT id,name,password FROM nav_user WHERE name = ?;
`
var user User
row := db.QueryRow(sql_get_user, name)
Expand Down
4 changes: 0 additions & 4 deletions ui/admin/src/pages/Setting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ export const Setting: React.FC<SettingProps> = (props) => {
<Form.Item
label="公信部备案"
name="govRecord"
required
rules={[{ required: true, message: "请输入网站 govRecord" }]}


>
<Input placeholder="请输入网站备案信息"></Input>
</Form.Item>
Expand Down

0 comments on commit b57fb13

Please sign in to comment.