sunsheng 1 vuosi sitten
vanhempi
commit
a9155bff5b

+ 2 - 2
src/api/test.go

@@ -126,7 +126,7 @@ func TestList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		Page:        page,
 		Size:        size,
 		Query:       query,
-		Sort:        bson.M{"createTime": -1},
+		Sort:        bson.D{bson.E{Key: "createTime", Value: -1}, bson.E{Key: "_id", Value: -1}},
 	})
 }
 
@@ -227,7 +227,7 @@ func ImportTest(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 				continue
 			}
 			// 去除可能的空行
-			if len(ts[0]) < 3 {
+			if len(ts) == 0 {
 				continue
 			}
 			// 问题(content) 试题类型(type)  (options)选项A 选项B 选项C 选项D 分值(score) (answer)答案

+ 5 - 2
src/api/user.go

@@ -174,6 +174,7 @@ func UserList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		Page:        page,
 		Size:        size,
 		Query:       query,
+		Sort:        bson.D{bson.E{Key: "createTime", Value: -1}, bson.E{Key: "_id", Value: -1}},
 		Project:     []string{"nid", "name", "loginName", "avatar", "roles", "createTime", "updateTime"},
 	})
 
@@ -320,7 +321,7 @@ func ImportUser(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 				continue
 			}
 			// 去除可能的空行
-			if len(us[0]) < 3 {
+			if len(us) == 0 {
 				continue
 			}
 			// 用户名name 编号nid 密码password 角色roles
@@ -337,8 +338,10 @@ func ImportUser(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 			}
 			user.Roles = []string{us[2]}
 			user.Password = UtilMd5(us[3])
-			if len(us[3]) == 0 || len(us[3]) == 32 {
+			if len(us[3]) == 0 {
 				user.Password = UtilMd5("123456")
+			} else if len(us[3]) == 32 {
+				user.Password = us[3]
 			}
 			user.LoginName = fmt.Sprintf("%s_%s", user.Name, user.Nid)
 

+ 8 - 0
src/copter-train.log

@@ -5,3 +5,11 @@
 {"level":"error","timestamp":"2024-02-22 16:43:28","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"管理员_20140001\" }]]","service_name":"copter-train"}
 {"level":"error","timestamp":"2024-02-22 16:43:28","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"张三_20140002\" }]]","service_name":"copter-train"}
 {"level":"error","timestamp":"2024-02-22 16:43:28","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"赵四_20140003\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:08","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"用户名_123\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:08","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"管理员_20140001\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:08","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"张三_20140002\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:08","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"赵四_20140003\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:10","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"用户名_123\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:10","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"管理员_20140001\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:10","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"张三_20140002\" }]]","service_name":"copter-train"}
+{"level":"error","timestamp":"2024-02-22 17:29:10","message":"[write exception: write errors: [E11000 duplicate key error collection: copter.users index: loginName_1 dup key: { loginName: \"赵四_20140003\" }]]","service_name":"copter-train"}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/Form-32b736a7.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/Form-3e7c293d.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-044151c4.js


+ 0 - 1
src/static/assets/index-0bb3caf9.css

@@ -1 +0,0 @@
-.m4bnzns{width:400px}.m4bnzns .radio_g{width:100%;text-align:center;margin-bottom:24px}.m4bnzns .options_items .ant-input-group-wrapper{margin-bottom:10px}.m4bnzns .options_items .ant-input-group-wrapper:last-child{margin-bottom:0}.m4bnzns .options_items .ant-input-group-addon{width:36px}.m4bnzns .select_inp,.m4bnzns .select_inp input{cursor:pointer}.pbfvr2l .banner_table .cover_img{max-width:300px;height:100px;object-fit:contain}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-0beba047.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-11da78d1.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-15a099cb.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-3561d70f.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-543fdb95.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-71883371.js


+ 0 - 1
src/static/assets/index-7cfc17b2.css

@@ -1 +0,0 @@
-.mf25f5b{width:400px}.mf25f5b .radio_g{width:100%;text-align:center;margin-bottom:24px}.mf25f5b .options_items .ant-input-group-wrapper{margin-bottom:10px}.mf25f5b .options_items .ant-input-group-wrapper:last-child{margin-bottom:0}.mf25f5b .options_items .ant-input-group-addon{width:36px}.mf25f5b .select_inp,.mf25f5b .select_inp input{cursor:pointer}.p70m601 .banner_table .cover_img{max-width:300px;height:100px;object-fit:contain}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-96af42d6.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-b610c147.css


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-c7729973.js


+ 1 - 0
src/static/assets/index-caf78abd.css

@@ -0,0 +1 @@
+.mf25f5b{width:400px}.mf25f5b .radio_g{width:100%;text-align:center;margin-bottom:24px}.mf25f5b .options_items .ant-input-group-wrapper{margin-bottom:10px}.mf25f5b .options_items .ant-input-group-wrapper:last-child{margin-bottom:0}.mf25f5b .options_items .ant-input-group-addon{width:36px}.mf25f5b .select_inp,.mf25f5b .select_inp input{cursor:pointer}.p1rkzvc{margin-top:20px}.p70m601 .banner_table .cover_img{max-width:300px;height:100px;object-fit:contain}.p70m601 .selected_view{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 0 20px;padding:10px 20px;border:1px solid var(--vt-c-primary);background-color:#e6f7ff;border-radius:2px}

+ 0 - 1
src/static/assets/index-d4896fb7.js

@@ -1 +0,0 @@
-import{d as f,k as v,v as r,c as e,l as s,x as o,I as d,B as w}from"./index-432e0d5a.js";import{F as l,R as n}from"./Form-3e7c293d.js";import"./useFlexGapSupport-1b1e93ca.js";const h={wrapperCol:{span:24}},x={wrapperCol:{span:24}},b=f({setup(){const i=v(),m=r({loading:!1,loginType:"default"}),a=r({loginName:"",password:"",role:"student"}),p=r({loginName:[{required:!0,message:"请输入正确的账号",trigger:"change"}],password:[{required:!0,message:"请输入正确的密码",trigger:"change"}],role:[{required:!0,message:"登录角色不能为空",trigger:"change"}]}),{validate:c,validateInfos:u}=l.useForm(a,p);async function g(){c().then(t=>{i.passwordLogin(t)})}return()=>e("div",{class:y},[e("div",{class:"content"},[e("div",{class:"title"},[s("用户登录")]),e("div",{class:"py-30px px-20px"},[e(l,o(h,{name:"basic"}),{default:()=>[e(l.Item,o({name:"loginName"},u.loginName),{default:()=>[e(d,{placeholder:"请输入账号",value:a.loginName,"onUpdate:value":t=>a.loginName=t,maxlength:30},null)]}),e(l.Item,o({name:"password"},u.password),{default:()=>[e(d.Password,{placeholder:"请输入密码",value:a.password,"onUpdate:value":t=>a.password=t,maxlength:18},null)]}),e(l.Item,o({name:"role"},u.role),{default:()=>[e(n.Group,{class:"flex justify-between w-full login_role",value:a.role,"onUpdate:value":t=>a.role=t},{default:()=>[e(n,{value:"student"},{default:()=>[s("学生")]}),e(n,{value:"teacher"},{default:()=>[s("老师")]}),e(n,{value:"admin"},{default:()=>[s("管理员")]})]})]}),e(l.Item,o(x,{style:{marginBottom:0}}),{default:()=>[e(w,{htmlType:"submit",type:"primary",block:!0,class:"login_btn",size:"large",loading:m.loading,onClick:g},{default:()=>[s("登录")]})]})]})])])])}}),y="p1fwmfaj";export{b as default};

+ 1 - 0
src/static/assets/index-d91659c6.css

@@ -0,0 +1 @@
+.m4bnzns{width:400px}.m4bnzns .radio_g{width:100%;text-align:center;margin-bottom:24px}.m4bnzns .options_items .ant-input-group-wrapper{margin-bottom:10px}.m4bnzns .options_items .ant-input-group-wrapper:last-child{margin-bottom:0}.m4bnzns .options_items .ant-input-group-addon{width:36px}.m4bnzns .select_inp,.m4bnzns .select_inp input{cursor:pointer}.p18d7uyp{margin-top:20px}.pbfvr2l .banner_table .cover_img{max-width:300px;height:100px;object-fit:contain}.pbfvr2l .selected_view{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 0 20px;padding:10px 20px;border:1px solid var(--vt-c-primary);background-color:#e6f7ff;border-radius:2px}

+ 1 - 0
src/static/assets/index-eb04c163.js

@@ -0,0 +1 @@
+import{d as v,k as h,v as r,c as e,l as n,x as l,I as d,B as w}from"./index-c7729973.js";import{F as s,R as x,a as i}from"./Form-32b736a7.js";import"./useFlexGapSupport-316e8c7f.js";const y={wrapperCol:{span:24}},I={wrapperCol:{span:24}},C=v({setup(){const m=h(),p=r({loading:!1,loginType:"default"}),a=r({name:"",nid:"",password:"",role:"student"}),c=r({name:[{required:!0,message:"请输入用户姓名",trigger:"change"}],nid:[{required:!0,message:"请输入用户编号",trigger:"change"}],password:[{required:!0,message:"请输入正确的密码",trigger:"change"}],role:[{required:!0,message:"登录角色不能为空",trigger:"change"}]}),{validate:g,validateInfos:o}=s.useForm(a,c);async function f(){g().then(t=>{const u={...t};u.loginName=u.name+"_"+u.nid,m.passwordLogin(u)})}return()=>e("div",{class:B},[e("div",{class:"content"},[e("div",{class:"title"},[n("用户登录")]),e("div",{class:"py-30px px-20px"},[e(s,l(y,{name:"basic"}),{default:()=>[e(s.Item,l({name:"name"},o.name),{default:()=>[e(d,{placeholder:"请输入用户姓名",value:a.name,"onUpdate:value":t=>a.name=t,maxlength:30},null)]}),e(s.Item,l({name:"nid"},o.nid),{default:()=>[e(d,{placeholder:"请输入用户编号",value:a.nid,"onUpdate:value":t=>a.nid=t},null)]}),e(s.Item,l({name:"password"},o.password),{default:()=>[e(d.Password,{placeholder:"请输入登录密码",value:a.password,"onUpdate:value":t=>a.password=t,maxlength:18},null)]}),e(s.Item,l({name:"role"},o.role),{default:()=>[e(x,{class:"flex justify-between w-full login_role",value:a.role,"onUpdate:value":t=>a.role=t},{default:()=>[e(i,{value:"student"},{default:()=>[n("学生")]}),e(i,{value:"teacher"},{default:()=>[n("老师")]}),e(i,{value:"admin"},{default:()=>[n("管理员")]})]})]}),e(s.Item,l(I,{style:{marginBottom:0}}),{default:()=>[e(w,{htmlType:"submit",type:"primary",block:!0,class:"login_btn",size:"large",loading:p.loading,onClick:f},{default:()=>[n("登录")]})]})]})])])])}}),B="p1fwmfaj";export{C as default};

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/index-fc889994.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
src/static/assets/useFlexGapSupport-316e8c7f.js


+ 2 - 2
src/static/index.html

@@ -8,8 +8,8 @@
       content="width=device-width, initial-scale=1.0,user-scalable=no"
     />
     <title>直升机训练后台管理系统</title>
-    <script type="module" crossorigin src="./assets/index-432e0d5a.js"></script>
-    <link rel="stylesheet" href="./assets/index-1a4d4cdb.css">
+    <script type="module" crossorigin src="./assets/index-c7729973.js"></script>
+    <link rel="stylesheet" href="./assets/index-b610c147.css">
   </head>
   <body>
     <div id="app"></div>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä