浏览代码

提交审核优化

mxs 9 月之前
父节点
当前提交
e02b993657
共有 2 个文件被更改,包括 10 次插入9 次删除
  1. 2 1
      frontend/src/views/CodeList.vue
  2. 8 8
      server.go

+ 2 - 1
frontend/src/views/CodeList.vue

@@ -671,7 +671,8 @@ const tableEvents = {
     confirmSubmit(row) {
         const lua = getLuaParams(row)
         const param = {
-            stype: '提交'
+            stype: '提交',
+            code: lua.code
         }
         lua.state = 1
         ServerActionUpdateCodeState({ lua: [lua], param }).then(r => {

+ 8 - 8
server.go

@@ -12,9 +12,8 @@ import (
 	"time"
 )
 
-const HREF = "http://127.0.0.1:8091/%s"
-
-//const HREF = "http://visualize.spdata.jianyu360.com/%s"
+// const HREF = "http://127.0.0.1:8091/%s"
+const HREF = "http://visualize.spdata.jianyu360.com/%s"
 
 type Result struct {
 	Msg  string `json:"msg"`
@@ -91,16 +90,17 @@ func (a *App) ServerActionUpdateCodeState(param map[string]interface{}) *Result
 	//前期校验
 	if User != nil {
 		//提交审核时,验证校验清单
-		lua, _ := param["lua"].(map[string]interface{})
-		if qu.IntAll(lua["state"]) == 1 {
-			code := qu.ObjToString(lua["code"])
-			if vr := be.VerifyResults[code]; vr == nil { //没有检验清单,不允许提交
+		p, _ := param["param"].(map[string]interface{})
+		if qu.ObjToString(p["stype"]) == "提交" {
+			code := qu.ObjToString(p["code"])
+			vr := be.VerifyResults[code]
+			if vr == nil { //没有检验清单,不允许提交
 				r.Msg = "未验证,无法提交!"
 				//} else if !vr.ListItems || !vr.Content || !vr.Title || !vr.PublishTime { //校验检验清单必通过项
 			} else if !vr.ListItems || !vr.Content || !vr.Title || !vr.PublishTime || !vr.ListTrunPage { //校验检验清单必通过项
 				r.Msg = "验证清单未通过!"
 			} else {
-				lua["verify"] = vr
+				//p["verify"] = vr
 				be.VerifyResults[code] = nil //清空验证结果
 			}
 		}