Explorar o código

Merge branch 'dev2.6.5' of http://39.105.157.10:10080/qmx/qfw into dev2.6.5

zouyuxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
7aeca2902e

+ 2 - 2
core/README.md

@@ -1,2 +1,2 @@
-v2.6.5
-企业贷款
+v2.6.4.1
+商机洞察增加意见反馈

+ 3 - 2
core/src/qfw/filter/sessfilter.go

@@ -7,10 +7,11 @@ session过滤器
 package filter
 
 import (
-	"github.com/go-xweb/xweb"
 	"net/http"
 	"qfw/util"
 	"regexp"
+
+	"github.com/go-xweb/xweb"
 )
 
 //session过滤器
@@ -36,7 +37,7 @@ func (s *sessfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 			ut := util.IntAllDef(userType, -1)
 
 			if cr.String() == "/manage/" {
-				if ut == 0 {
+				if ut <= 0 {
 					b = true
 				}
 			} else {

+ 9 - 9
core/src/qfw/manage/auditing.go

@@ -292,15 +292,15 @@ func (s *SystemManage) Systemsetting() error {
 	if s.GetSession("loginName") == nil {
 		return s.Redirect("/")
 	} else {
-		var userid = s.GetSession("userId").(string)
-		u := FindOne("user", "{'_id':'"+userid+"'}")
-		log.Println("userid:", (*u)["i_type"])
-		u_type := (*u)["i_type"]
-		if u_type == 0 {
-			return s.Render("/manage/systemsetting.html")
-		} else {
-			return s.Redirect("/")
-		}
+		//		var userid = s.GetSession("userId").(string)
+		//		u := FindOne("user", "{'_id':'"+userid+"'}")
+		//		log.Println("userid:", (*u)["i_type"])
+		//		u_type := (*u)["i_type"]
+		//		if u_type == 0 {
+		return s.Render("/manage/systemsetting.html")
+		//		} else {
+		//			return s.Redirect("/")
+		//		}
 
 	}
 }

+ 1 - 1
core/src/qfw/manage/feedback.go

@@ -100,7 +100,7 @@ func (s *SystemManage) Feedbackcontent(_id string) error {
 		if u_type == 0 {
 			r := FindById("interaction", _id, `{"i_type":1,"l_submitdate":1,"s_submitid":1,"s_submitname":1,"s_remark":1,
 					  "s_pic":1,"s_enterprisetype":1,"_id":1,"s_link":1,"i_status":1,"s_title":1,
-					"s_editorname":1,"s_opinion":1,"l_editordate":1,"s_record":1,"s_title_no":1,"s_source":1,"s_username":1,"s_from":1}`)
+					"s_editorname":1,"s_opinion":1,"l_editordate":1,"s_record":1,"s_title_no":1,"s_source":1,"s_username":1,"s_from":1,"s_fromName":1}`)
 			if nil != r {
 				if util.IntAll((*r)["i_status"]) == 0 {
 					s_editorname, _ := s.GetSession("nickName").(string)

+ 310 - 0
core/src/qfw/manage/rbac.go

@@ -0,0 +1,310 @@
+package manage
+
+import (
+	"encoding/json"
+	"errors"
+	"log"
+	"qfw/util"
+	. "qfw/util/mongodb"
+	"qfw/util/redis"
+	"strings"
+	"time"
+
+	"github.com/go-xweb/xweb"
+	"gopkg.in/mgo.v2/bson"
+)
+
+//后台管理
+type Rbac struct {
+	*xweb.Action
+	//目录管理
+	index       xweb.Mapper `xweb:"/manage/rbac/index"`       //后台目录首页
+	catalogList xweb.Mapper `xweb:"/manage/rbac/catalogList"` //获取后台目录列表
+	saveCL      xweb.Mapper `xweb:"/manage/rbac/saveCL"`      //更新目录
+	//管理员管理
+	mgIndex     xweb.Mapper `xweb:"/manage/rbac/mgIndex"`     //后台管理员管理首页
+	mgUsersList xweb.Mapper `xweb:"/manage/rbac/mgUsersList"` //获取管理员列表
+	saveMG      xweb.Mapper `xweb:"/manage/rbac/saveMG"`      //更新管理员目录
+	//获取各自管理员的目录
+	gEachCL xweb.Mapper `xweb:"/manage/rbac/gEachCL"`
+	//管理分转
+	toEachPage xweb.Mapper `xweb:"/manage/rbac/toEachPage"`
+}
+
+func init() {
+	xweb.AddAction(&Rbac{})
+}
+
+//
+func (this *Rbac) ToEachPage() error {
+	defer util.Catch()
+	if this.GetSession("userId") == nil {
+		return this.Redirect("/")
+	}
+	var resultMap *[]map[string]interface{}
+	userId := util.ObjToString(this.GetSession("userId"))
+	u := FindOne("user", "{'_id':'"+userId+"'}")
+	u_type := (*u)["i_type"]
+	if u_type == 0 {
+		pids := util.ObjToString((*u)["s_power"])
+		if len(strings.Split(pids, ",")) > 0 {
+			var ids []bson.ObjectId
+			for _, chid := range strings.Split(pids, ",") {
+				ids = append(ids, bson.ObjectIdHex(chid))
+			}
+			resultMap = Find("catalog", bson.M{"_id": bson.M{"$in": ids}}, nil, nil, false, -1, -1)
+		}
+		firstUrl := "/"
+		if len(*resultMap) > 0 {
+			firstUrl = util.ObjToString((*resultMap)[0]["s_url"])
+		}
+		return this.Redirect(firstUrl)
+	} else if u_type == -1 {
+		return this.Render("/manage/rbac/systemsetting.html")
+	}
+	return nil
+}
+
+//
+func (this *Rbac) GEachCL() {
+	defer util.Catch()
+	r := func() *FuncResult {
+		if this.GetSession("userId") == nil {
+			return &FuncResult{false, errors.New("未登录"), nil}
+		}
+		if this.Method() != "POST" {
+			return &FuncResult{false, errors.New("请求方式有误"), nil}
+		}
+		userId := util.ObjToString(this.GetSession("userId"))
+		var redisMap = map[string]interface{}{}
+		redisData, err := redis.GetBytes("other", "userP_"+userId)
+		if err != nil || len(*redisData) > 0 {
+			var resultMap *[]map[string]interface{}
+			rData := FindById("user", userId, `{"s_power":1}`)
+			if (*rData)["s_power"] != nil {
+				pids := util.ObjToString((*rData)["s_power"])
+				if len(strings.Split(pids, ",")) > 0 {
+					var ids []bson.ObjectId
+					for _, chid := range strings.Split(pids, ",") {
+						ids = append(ids, bson.ObjectIdHex(chid))
+					}
+					resultMap = Find("catalog", bson.M{"_id": bson.M{"$in": ids}}, nil, nil, false, -1, -1)
+				}
+			}
+			if len(*resultMap) > 0 {
+				redisMap = map[string]interface{}{
+					"data": *resultMap,
+				}
+				rM, _ := json.Marshal(redisMap)
+				redis.PutBytes("other", "userP_"+userId, &rM, 120*60)
+			}
+		} else {
+			json.Unmarshal(*redisData, &redisMap)
+		}
+		return &FuncResult{true, nil, redisMap}
+	}()
+
+	if r.Err != nil {
+		log.Printf(" EACHCL err:%v\n", r.Err.Error())
+	}
+	this.ServeJson(r.Format())
+}
+
+//管理员管理
+func (this *Rbac) MgIndex() error {
+	if this.GetSession("userId") == nil {
+		return this.Redirect("/")
+	}
+	return this.Render("/manage/rbac/mgIndex.html")
+}
+
+//
+func (this *Rbac) SaveMG() {
+	defer util.Catch()
+	r := func() *FuncResult {
+		if this.GetSession("userId") == nil {
+			return &FuncResult{false, errors.New("未登录"), nil}
+		}
+		if this.Method() != "POST" {
+			return &FuncResult{false, errors.New("请求方式有误"), nil}
+		}
+		_id := this.GetString("_id") //userid
+		if _id == "" {
+			return &FuncResult{false, errors.New("userid不能为空"), nil}
+		}
+		MGStr := this.GetString("MGStr") //目录id
+		if MGStr == "" {
+			return &FuncResult{false, errors.New("目录id不能为空"), nil}
+		}
+		i_type, _ := this.GetInteger("i_type")
+		//
+		mData := map[string]interface{}{
+			"s_power":     MGStr,
+			"i_type":      i_type,
+			"l_powerdate": time.Now().Unix(),
+		}
+		if !Update("user", &map[string]interface{}{
+			"_id": util.StringTOBsonId(_id),
+		}, &map[string]interface{}{
+			"$set": mData,
+		}, false, false) {
+			return &FuncResult{false, errors.New("更新管理员信息失败"), nil}
+		} else {
+			redis.Del("other", "userP_"+_id)
+			return &FuncResult{true, nil, nil}
+		}
+		return &FuncResult{false, errors.New("未知操作"), nil}
+	}()
+
+	if r.Err != nil {
+		log.Printf("MG err:%v\n", r.Err.Error())
+	}
+	this.ServeJson(r.Format())
+}
+
+//
+func (this *Rbac) MgUsersList() {
+	defer util.Catch()
+	if this.GetSession("userId") == nil {
+		this.ServeJson(map[string]interface{}{
+			"msg": "未登录",
+		})
+	}
+	if this.Method() != "POST" {
+		this.ServeJson(map[string]interface{}{
+			"msg": "请求方式有误",
+		})
+	}
+	size, _ := this.GetInteger("perPage")
+	if size > 100 {
+		this.ServeJson(map[string]interface{}{
+			"msg": "请求太多",
+		})
+	}
+	currentPage, _ := this.GetInteger("currentPage")
+	query := map[string]interface{}{}
+	if this.GetString("normal") != "" && this.GetString("openid") != "" {
+		query["s_m_openid"] = this.GetString("openid")
+	} else {
+		query["i_type"] = 0
+	}
+	res := map[string]interface{}{}
+	res["totalRows"] = Count("user", query)
+	data := *Find("user", query, `{"_id":-1}`, nil, false, (currentPage-1)*size, size)
+	for _, v := range data {
+		data_1 := v["l_registedate"]
+		v["l_registedate"] = util.FormatDateWithObj(&data_1, util.Date_Full_Layout)
+	}
+	res["data"] = data
+	res["currentPage"] = currentPage
+	this.ServeJson(res)
+}
+
+//目录管理
+func (this *Rbac) Index() error {
+	if this.GetSession("userId") == nil {
+		return this.Redirect("/")
+	}
+	return this.Render("/manage/rbac/systemsetting.html")
+}
+
+//
+func (this *Rbac) SaveCL() {
+	defer util.Catch()
+	Dotype := this.GetString("dotype") //删除 or 新增 or 修改
+	r := func() *FuncResult {
+		if this.GetSession("userId") == nil {
+			return &FuncResult{false, errors.New("未登录"), nil}
+		}
+		if this.Method() != "POST" {
+			return &FuncResult{false, errors.New("请求方式有误"), nil}
+		}
+		if Dotype == "D" {
+			cl_id := this.GetString("clid") //目录id
+			if cl_id == "" {
+				return &FuncResult{false, errors.New("目录id不能为空"), nil}
+			}
+			ok := DelById("catalog", cl_id)
+			if ok {
+				return &FuncResult{true, nil, nil}
+			}
+		} else {
+			cl_name := this.GetString("clname") //目录名称
+			if cl_name == "" {
+				return &FuncResult{false, errors.New("目录名称不能为空"), nil}
+			}
+			cl_url := this.GetString("clurl") //目录url
+			if cl_url == "" {
+				return &FuncResult{false, errors.New("目录地址不能为空"), nil}
+			}
+			//
+			mData := map[string]interface{}{
+				"s_name":       cl_name,
+				"s_url":        cl_url,
+				"s_remark":     this.GetString("clremark"), //目录说明
+				"s_icon":       this.GetString("cllcon"),   //目录图标
+				"l_createdate": time.Now().Unix(),
+			}
+			if Dotype == "S" {
+				if Save("catalog", mData) == "" {
+					return &FuncResult{false, errors.New("增加目录失败"), nil}
+				} else {
+					return &FuncResult{true, nil, nil}
+				}
+			} else if Dotype == "U" {
+				cl_id := this.GetString("clid")
+				if cl_id == "" {
+					return &FuncResult{false, errors.New("目录id不能为空"), nil}
+				}
+				mData["l_updatedate"] = time.Now().Unix()
+				if !Update("catalog", &map[string]interface{}{
+					"_id": util.StringTOBsonId(cl_id),
+				}, &map[string]interface{}{
+					"$set": mData,
+				}, false, false) {
+					return &FuncResult{false, errors.New("更新目录失败"), nil}
+				} else {
+					return &FuncResult{true, nil, nil}
+				}
+			}
+		}
+		return &FuncResult{false, errors.New("未知操作"), nil}
+	}()
+
+	if r.Err != nil {
+		log.Printf(" catalog%s err:%v\n", Dotype, r.Err.Error())
+	}
+	this.ServeJson(r.Format())
+}
+
+//
+func (this *Rbac) CatalogList() {
+	defer util.Catch()
+	if this.GetSession("userId") == nil {
+		this.ServeJson(map[string]interface{}{
+			"msg": "未登录",
+		})
+	}
+	if this.Method() != "POST" {
+		this.ServeJson(map[string]interface{}{
+			"msg": "请求方式有误",
+		})
+	}
+	size, _ := this.GetInteger("perPage")
+	if size > 100 {
+		this.ServeJson(map[string]interface{}{
+			"msg": "请求太多",
+		})
+	}
+	currentPage, _ := this.GetInteger("currentPage")
+	res := map[string]interface{}{}
+	res["totalRows"] = Count("catalog", nil)
+	data := *Find("catalog", nil, []string{"-l_createdate"}, nil, false, (currentPage-1)*size, size)
+	for _, v := range data {
+		data_1 := v["l_createdate"]
+		v["l_createdate"] = util.FormatDateWithObj(&data_1, util.Date_Full_Layout)
+	}
+	res["data"] = data
+	res["currentPage"] = currentPage
+	this.ServeJson(res)
+}

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2020-01-16 16:17:23"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2020-01-16 16:17:23"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2020-02-27 13:19:16"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2020-02-27 13:19:21"}},"marketisstart":true,"marketrate":300}

+ 4 - 4
core/src/web/templates/common/login.html

@@ -147,8 +147,8 @@ $(function (){
 				clearInterval(t);
 				if(data.freeze == 2){
 				    window.location.href="/front/webhelpcontent/55c818d8af537440a700000d.html";
-				}else if (data.userType == 0){//后台管理员
-					window.location.href="/manage/system";
+				}else if (data.userType == 0||data.userType == -1){//管理员
+					window.location.href="/manage/rbac/toEachPage";
 				}else{
 					afterLoginSkip(data,true);
 				}
@@ -179,8 +179,8 @@ function afterLoginSkip(data,flag){
 		return;
 	}
 	if(flag){
-		if(data.userType == 0){
-			window.location.href="/manage/system";
+		if(data.userType == 0||data.userType == -1){
+			window.location.href="/manage/rbac/toEachPage";
 			return;
 		}
 		if(loginParam == -1){//登录完之后回调

+ 2 - 3
core/src/web/templates/manage/course/order_detail.html

@@ -240,7 +240,8 @@
 						if(res["order_status"]=="0"){
 							$(".status").text("待付款").css({"color":"#EAB62F"})
 						}else if(res["order_status"]=="1"){
-							$(".status").text("已支付").css({"color":"#4DB443"})
+							$(".status").text("已支付").css({"color":"#4DB443"})							
+							$(".zfdh").text(res["out_trade_no"]).parent().show();
 						}else if(res["order_status"]=="-2"){
 							$(".status").text("已取消").css({"color":"#F5585"})
 						}
@@ -267,8 +268,6 @@
 						}
 						if(res["course_status"]=="2"){
 							$("#chakanpz").parents(".nofloat").show();
-						}else{
-							$(".zfdh").text(res["out_trade_no"]).show();
 						}
 						$(".dj").text(parseInt(resCour["i_price"])/100)
 						$(".ddzj").text(filter["peoleNum"]*resCour["i_price"]/100)

+ 8 - 0
core/src/web/templates/manage/feedbackcontent.html

@@ -113,6 +113,14 @@ background-color:#FFFFFF;
 		<div class="col-sm-4">
 		</div>
 		</div>
+    <div class="form-group">
+      <label id="col-sm-2" class="col-sm-2 control-label" for="name">问题来源:</label>
+	    <div class="col-sm-3">
+        <span style="background-color:#f0f0f0;" class="form-control">{{.T.s_fromName}}</span>
+		  </div>
+  		<div class="col-sm-4">
+  		</div>
+		</div>
 		<div class="form-group">
         <label id="col-sm-2" class="col-sm-2 control-label" for="name">问题来源页面:</label>
 	    <div class="col-sm-6">

+ 254 - 0
core/src/web/templates/manage/rbac/mgIndex.html

@@ -0,0 +1,254 @@
+<html>
+<head>
+<title>目录管理</title>
+{{include "/common/inc.html"}}
+<style type="text/css">
+
+#content table{
+table-layout: fixed;
+border:0px;
+font-size:14px;
+}
+.table>thead>tr>th:nth-child(1){
+width:10%;
+}
+.table>thead>tr>th:nth-child(2){
+width:25%;
+}
+.table>thead>tr>th:nth-child(3){
+width:15%;
+}
+.table>thead>tr>th:nth-child(4){
+width:50%;
+}
+.table>thead>tr>th:nth-last-child(1){
+width:0px;
+}
+.table>thead>tr>th{
+border:0px;
+font-size:14px;
+}
+.table>tbody>tr>td{
+white-space: nowrap;
+text-overflow: ellipsis;
+overflow: hidden;
+border:0px;
+border-bottom:1px dashed #999999;
+}
+#_Container_0{
+background-color:#FFFFFF;
+}
+.buttonStyle{width:64px;height:22px;line-height:22px;color:#369;text-align:center;background:url({{Msg "seo" "cdn"}}/images/buticon.gif) no-repeat left top;border:0;font-size:12px;}
+.buttonStyle:hover{background:url({{Msg "seo" "cdn"}}/images/buticon.gif) no-repeat left -23px;}
+.pagination>.active>a:hover,.pagination>.active>a:focus{
+background-color:#18CC7D;
+}
+#sidebar { margin-left:0px;}
+.hui{color:#999999;}
+#showCL .checkbox label:first-child{
+	margin-left: 10px !important;
+}
+#showCL .checkbox label{
+	margin-bottom: 15px;
+    margin-right: 20px;
+}
+</style>
+</head>
+<body>
+{{include "/manage/audithead.html"}}
+<div class="row" style="width:96%; margin:0 auto;">
+	<div  class="cont-one"  style="margin-top:10px;" >
+		{{include "/manage/rbac/slider.html"}}
+		<div id="content">
+		<!-- 中间 -->
+		<script>
+			$(function(){
+				$("#audit").datatable({
+				   perPage: 10
+				  ,showPagination:true
+				  ,checkbox:"" //check radio
+				  ,checkboxHeader:false
+				  ,idField:"_id"
+				  ,classname:"table-hover"
+				  ,css:{"height":"450px"}
+				  //,post:{"name":"ee"}
+				  ,buttons: ['<div style="width:50%;margin:5px" class="input-group pull-right" id="search"><input type="text" id="searchtext" value=""  data-original-title="Search" class="form-control" placeholder="请输入openid..."><span class="input-group-btn"><button class="btn btn-success" onclick="SearchContent()" data-original-title="Search" id="searchtip" type="button" style="height:38px;">检索</button></span></div>']
+				  , url: '/manage/rbac/mgUsersList'
+				  , columns: [
+				        {
+				            title: "用户昵称",field: "s_nickname", callback: function (data) {
+		                        return data.s_nickname
+		                    }
+				        }
+				      , {
+				            title: "openid", field: "s_m_openid", callback: function (data) {
+		                        return data.s_m_openid
+		                    }
+				        },
+						{
+							title:"注册时间",field:"l_registedate", callback: function (data) {
+		                        return data.l_registedate
+		                    }
+						},
+						{
+							title:"操作",field:"_id",callback:function(ct,cd,val,k,m){
+							 	var id = ct["_id"]
+								if(ct["i_type"]==0){
+							 		v="<button dataid='"+id+"' class='btn  btn-success btn-xs' onclick='change(this)' powerids='"+ct["s_power"]+"' style='opacity:1;margin-right: 10px;padding: 2px 5px;'>查看或修改权限</button><button class='btn  btn-warning btn-xs'  onclick=del(\'"+id+"\')  style='opacity:1;padding: 2px 5px;'>删除权限</button>"
+								}else{
+							 		v="<button dataid='"+id+"' class='btn  btn-success btn-xs' onclick='newMG(this)' style='opacity:1;margin-right: 10px;padding: 2px 5px;'>添加</button>"
+								}
+								return v
+							}
+							
+						}
+				    ]
+				});
+			})
+			</script>
+		<div id="audit"></div>
+		{{include "/manage/auditdetail.html"}}
+		</div>
+	</div>
+</div>
+<div class="modal fade" id="addModal" tabindex="-1" role="dialog">
+  <div class="modal-dialog" role="document">
+    <div class="modal-content">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+        <h4 class="modal-title">管理员操作</h4>
+      </div>
+      <div class="modal-body" id="showCL">
+      		
+      </div>
+      <div class="modal-footer">
+        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+        <button type="button" class="btn btn-primary" onclick="saveData()">提交</button>
+      </div>
+    </div>
+  </div>
+</div>
+
+{{include "/common/bottom.html"}}
+<script src="/js/qfwtable.js"></script>
+<script type="text/javascript" src="/js/zDrag.js"></script>
+<script type="text/javascript" src="/js/zDialog.js"></script>
+<script type="text/javascript">
+	var CLOBJ = {};
+	var MGStr = "";
+	var _id = ""
+	var i_type = 1;
+	function SearchContent(){
+		var find=$("#audit").data("datatable")
+		console.log(find)
+		if(!find.options.opost) find.options.opost=find.options.post||{};
+		find.options.post=$.extend(find.options.opost,{normal:"Y",openid:$("#searchtext").val()});
+		find.options.currentPage=1
+		find.render();
+	}
+	//新增
+	function newMG(th){
+		i_type = 0;
+		_id = $(th).attr("dataid");
+		$("#addModal").modal("show");
+		showCL()
+	}
+	//删除
+	function del(id){
+		i_type = 3;
+		_id = id;
+		saveData("D")
+	}
+	//
+	function change(th){
+		i_type = 0;
+		var rdata = $(th).attr("powerids").split(",");
+		_id = $(th).attr("dataid");
+		console.log(rdata)
+		showCL(rdata)
+	}
+	//
+	function showCL(rdata){
+		if(CLOBJ){
+			var clHtml = '<div class="checkbox">';
+			for(var i in CLOBJ){
+				var checkFlag = "";
+				if(rdata!=undefined&&rdata.length>0){
+					for(var j in rdata){
+						if(i==rdata[j]){
+							checkFlag = "checked";
+							break;
+						}
+					}
+				}
+				clHtml +='<label class="checkbox-inline"><input type="checkbox" '+checkFlag+' value="'+i+'">'+CLOBJ[i]+'</label>'
+			}
+			clHtml += '</div>';
+			$("#showCL").html(clHtml);
+		}
+		$("#addModal").modal("show");
+	}
+  	$(function(){
+		getCL();
+  	})
+	//
+	function getCL(){
+		$.ajax({
+            type: "POST",
+            url: "/manage/rbac/catalogList",
+            data:{},
+            async:false,
+            dataType: "json",
+            success: function(r){
+				if(r.data.length>0){
+					for(var i=0;i<r.data.length;i++){
+						CLOBJ[r.data[i]._id]=r.data[i].s_name
+					}
+				}
+            },
+            error: function(){
+                alert("稍后再试!")
+            }
+        });
+	}
+	//
+	function saveData(t){
+		MGStr = '';
+		if(t!='D'){
+			$("#showCL").find("label").each(function(i,dom){
+				if($(dom).find("input").is(':checked')){
+					if(MGStr!=""){
+						MGStr +=','
+					}
+					MGStr += $(dom).find("input").val()
+				}
+			})
+		}else{
+			MGStr = '0';
+		}
+		var param = {
+			"MGStr":MGStr,
+			"_id":_id,
+			"i_type":i_type,
+		};
+        $.ajax({
+            type: "POST",
+            url: "/manage/rbac/saveMG",
+            data:param,
+            async:false,
+            dataType: "json",
+            success: function(r){
+				if(r.success){
+					document.location.reload();
+				}else{
+					alert("稍后再试!")
+				}
+            },
+            error: function(){
+                alert("稍后再试!")
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 62 - 0
core/src/web/templates/manage/rbac/slider.html

@@ -0,0 +1,62 @@
+<style>
+.liactive{background-color:#f5f5f5;}
+</style>
+<div id="sidebar">
+	<ul>
+		<li dataId="glyphicon-th-list" class="list-group-item" >
+			<a style=" font-weight:normal;" href="/manage/rbac/index">
+				<i class="glyphicon glyphicon-th-list"></i>
+				<span>目录管理</span>
+			</a>
+		</li>
+		<li dataId="glyphicon-user" class="list-group-item">
+			<a style=" font-weight:normal;" href="/manage/rbac/mgIndex">
+				<i class="glyphicon glyphicon-user"></i> 
+				<span>管理员管理</span>
+			</a>
+		</li>
+		<li id="pcUndate"  class="list-group-item">
+			<a style=" font-weight:normal;" onclick="pushVersion()">
+				<i class="glyphicon glyphicon-level-up"></i> 
+				<span>PC助手版本更新</span>
+			</a>
+		</li>
+	</ul>
+ <style type="text/css">.glyphicon{font-family:'Glyphicons Halflings';}</style>
+	 <script>
+		$(function(){
+			selectActive();
+		})
+		//
+		function selectActive(){
+			var liactive = sessionStorage.getItem("liactive");
+			var liflag = false;
+			$("#sidebar").find("li").each(function(i,dom){
+				if(liactive!=null&&liactive==$(dom).attr("dataId")){
+					$(dom).addClass("liactive");
+					liflag = true;
+				}
+				$(dom).click(function(){
+					sessionStorage.setItem("liactive",$(dom).attr("dataId"));
+				})
+			})
+			if (!liflag){
+				$("#sidebar").find("li").eq(0).addClass("liactive");
+			}
+		}
+		//
+		 function pushVersion() {
+		     var con = confirm("您确定要更新PC助手版本吗?");
+		     if(con){
+	                $.post("/manage/message/pushVersion",{},function(data){
+	                    console.log(data);
+	                    if (data.repl){
+	                        alert("版本号:"+data.version+",更新成功!");
+	                    }else{
+	                        alert("更新失败");
+	                    }
+	                })
+			 }
+	        }
+	 </script>
+</div>	

+ 244 - 0
core/src/web/templates/manage/rbac/systemsetting.html

@@ -0,0 +1,244 @@
+<html>
+<head>
+<title>目录管理</title>
+{{include "/common/inc.html"}}
+<style type="text/css">
+
+#content table{
+table-layout: fixed;
+border:0px;
+font-size:14px;
+}
+.table>thead>tr>th:nth-child(1){
+width:15%;
+}
+.table>thead>tr>th:nth-child(2){
+width:25%;
+}
+.table>thead>tr>th:nth-child(3){
+width:25%;
+}
+.table>thead>tr>th:nth-child(4){
+width:5%;
+}
+.table>thead>tr>th:nth-child(5){
+width:15%;
+}
+.table>thead>tr>th:nth-child(6){
+width:15%;
+}
+.table>thead>tr>th:nth-last-child(1){
+width:0px;
+}
+.table>thead>tr>th{
+border:0px;
+font-size:14px;
+}
+.table>tbody>tr>td{
+white-space: nowrap;
+text-overflow: ellipsis;
+overflow: hidden;
+border:0px;
+border-bottom:1px dashed #999999;
+}
+#_Container_0{
+background-color:#FFFFFF;
+}
+.buttonStyle{width:64px;height:22px;line-height:22px;color:#369;text-align:center;background:url({{Msg "seo" "cdn"}}/images/buticon.gif) no-repeat left top;border:0;font-size:12px;}
+.buttonStyle:hover{background:url({{Msg "seo" "cdn"}}/images/buticon.gif) no-repeat left -23px;}
+.pagination>.active>a:hover,.pagination>.active>a:focus{
+background-color:#18CC7D;
+}
+#sidebar { margin-left:0px;}
+.hui{color:#999999;}
+</style>
+</head>
+<body>
+{{include "/manage/audithead.html"}}
+<div class="row" style="width:96%; margin:0 auto;">
+	<div  class="cont-one"  style="margin-top:10px;" >
+		{{include "/manage/rbac/slider.html"}}
+		<div id="content">
+		<!-- 中间 -->
+		<script>
+			$(function(){
+				$("#audit").datatable({
+				   perPage: 10
+				  ,showPagination:true
+				  ,checkbox:"" //check radio
+				  ,checkboxHeader:false
+				  ,idField:"_id"
+				  ,classname:"table-hover"
+				  ,css:{"height":"450px"}
+				  //,post:{"name":"ee"}
+				  ,buttons: ['<div style="width:10%;margin:5px" class="input-group pull-right" id="search"><span class="input-group-btn"><button class="btn btn-success" onclick="newCL()" data-original-title="Search" id="searchtip" type="button" style="height:38px;border-radius: 4px;">新增目录</button></span></div>']
+				  , url: '/manage/rbac/catalogList'
+				  , columns: [
+				        {
+				            title: "名称",field: "s_name", callback: function (data) {
+		                        return data.s_name
+		                    }
+				        }
+				      , {
+				            title: "url地址", field: "s_url", callback: function (data) {
+		                        return data.s_url
+		                    }
+				        },
+						{
+				            title: "备注", field: "s_remark", callback: function (data) {
+		                        return data.s_remark
+		                    }
+				        },
+						{
+				            title: "图标", field: "s_icon",callback:function(ct,cd,val,k,m){
+								return '<i class="glyphicon '+ct["s_icon"]+'"></i>'
+							}	
+				        },
+						{
+							title:"创建时间",field:"l_createdate", callback: function (data) {
+		                        return data.l_createdate
+		                    }
+						},
+						{
+							title:"操作",field:"_id",callback:function(ct,cd,val,k,m){
+							 	var id = ct["_id"]
+							 	v="<button dataid='"+id+"' class='btn  btn-success btn-xs' onclick='change(this)' style='opacity:1;margin-right: 10px;'>修改</button><button class='btn  btn-warning btn-xs'  onclick=del(\'"+id+"\')  style='opacity:1;'>删除</button>"
+								return v
+							}
+							
+						}
+				    ]
+				});
+			})
+			</script>
+		<div id="audit"></div>
+		{{include "/manage/auditdetail.html"}}
+		</div>
+	</div>
+</div>
+<div class="modal fade" id="addModal" tabindex="-1" role="dialog">
+  <div class="modal-dialog" role="document">
+    <div class="modal-content">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+        <h4 class="modal-title">新增目录</h4>
+      </div>
+      <div class="modal-body">
+      	<form class="form-horizontal" role="form">
+		  <div class="form-group">
+		    <label for="firstname" class="col-sm-2 control-label">目录名称</label>
+		    <div class="col-sm-4">
+		      	<input type="text" style="display: inline;width: 90%;" class="form-control" id="clname" placeholder="请输入目录名称">
+				<em style="color: red;">*</em>
+		    </div>
+		  </div>
+		  <div class="form-group">
+		    <label for="lastname" class="col-sm-2 control-label">目录地址</label>
+		    <div class="col-sm-8">
+		      	<input type="text" style="display: inline;width: 90%;" class="form-control" id="clurl" placeholder="请输入目录地址">
+				<em style="color: red;">*</em>
+		    </div>
+		  </div>
+		  <div class="form-group">
+		    <label for="lastname" class="col-sm-2 control-label">目录图标</label>
+		    <div class="col-sm-6">
+		      <input type="text" class="form-control" id="cllcon" placeholder="请输入目录图标">
+		    </div>
+		  </div>
+		  <div class="form-group">
+		    <label for="lastname" class="col-sm-2 control-label">目录备注</label>
+		    <div class="col-sm-8">
+		      <input type="text" class="form-control" id="clremark" placeholder="请输入目录备注">
+		    </div>
+		  </div>
+		</form>
+      </div>
+      <div class="modal-footer">
+        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+        <button type="button" class="btn btn-primary" onclick="saveData('S')">保存</button>
+      </div>
+    </div>
+  </div>
+</div>
+
+{{include "/common/bottom.html"}}
+<script src="/js/qfwtable.js"></script>
+<script type="text/javascript" src="/js/zDrag.js"></script>
+<script type="text/javascript" src="/js/zDialog.js"></script>
+<script type="text/javascript">
+	var dotype = "S";
+	//新增
+	function newCL(){
+		dotype = "S";
+		$("#addModal").modal("show");
+	}
+	//更新
+	function change(th){
+		$("#clname").val($(th).parents("tr").find("td").eq("0").text());
+		$("#clurl").val($(th).parents("tr").find("td").eq("1").text());
+		$("#cllcon").val($(th).parents("tr").find("td").eq("3").find("i").attr("class").split(" ")[1]);
+		$("#clremark").val($(th).parents("tr").find("td").eq("2").text());
+		dotype = "U";
+		$("#addModal").modal("show");
+	}
+	//删除
+	function del(id){
+		dotype = "D";
+		$.ajax({
+            type: "POST",
+            url: "/manage/rbac/saveCL",
+            data:{"clid":id,"dotype":dotype},
+            async:false,
+            dataType: "json",
+            success: function(r){
+				if(r.success){
+					document.location.reload();
+				}else{
+					alert("稍后再试!")
+				}
+            },
+            error: function(){
+                alert("稍后再试!")
+            }
+        });
+	}
+	function saveData(){
+		if($("#clname").val()==""){
+			alert("目录名称不能为空")
+			return false
+		}
+		if($("#clurl").val()==""){
+			alert("目录地址不能为空")
+			return false
+		}
+		var param = {
+			"clname":$("#clname").val(),
+			"clurl":$("#clurl").val(),
+			"cllcon":$("#cllcon").val(),
+			"clremark":$("#clremark").val(),
+			"dotype":dotype,
+		};
+        $.ajax({
+            type: "POST",
+            url: "/manage/rbac/saveCL",
+            data:param,
+            async:false,
+            dataType: "json",
+            success: function(r){
+				if(r.success){
+					document.location.reload();
+				}else{
+					alert("稍后再试!")
+				}
+            },
+            error: function(){
+                alert("稍后再试!")
+            }
+        });
+    }
+  	$(function(){
+		//$("#addModal").modal("show");
+  	})
+</script>
+</body>
+</html>

+ 56 - 66
core/src/web/templates/manage/slider.html

@@ -1,75 +1,65 @@
+<style>
+.liactive{background-color:#f5f5f5;}
+</style>
 <div id="sidebar">
 	<ul>
-		<li id="waitaudit" class="list-group-item" ><a style=" font-weight:normal;" href="/manage/system">
-		<i class="glyphicon glyphicon-list-alt"></i> <span>企业审核</span></a></li>
-		<li id="expess"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/articlelist"><i class="glyphicon glyphicon-facetime-video"></i> <span>信息发布</span></a></li>
-		<li id="feedback"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/feedback"><i class="glyphicon glyphicon-share"></i> <span>意见反馈</span></a></li>
-		<li id="course"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/course/index"><i class="glyphicon course-icon"></i> <span>招投标课程管理</span></a></li>
-		<li id="courseOrder"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/courseOrder/index"><i class="glyphicon course-icon"></i> <span>招投标订单管理</span></a></li>
-		<li id="seo"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/seo"><i class="glyphicon glyphicon-euro"></i> <span>SEO优化</span></a></li>
-		<li id="ad"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/ad"><i class="glyphicon glyphicon-th-large"></i> <span>广告管理</span></a></li>
-		<li id="count"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/count"><i class="glyphicon glyphicon-signal"></i> <span>数据统计</span></a></li>
-		<li id="cauditbar"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/caudit"><i class="glyphicon glyphicon-user"></i> <span>开发者认证</span></a></li>
-		<li id="message"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/message/index"><i class="glyphicon glyphicon-comment"></i> <span>消息管理</span></a></li>
-    	<li id="dataReportOrder"  class="list-group-item"><a style=" font-weight:normal;"  href="/manage/dataReportOrder/list"><i class="glyphicon glyphicon-download-alt"></i> <span>数据报告</span></a></li>
-		<li id="dataExportOrder"  class="list-group-item"><a style=" font-weight:normal;"  href="/manage/dataExportOrder/list"><i class="glyphicon glyphicon-download-alt"></i> <span>数据导出订单</span></a></li>
-		<li id="viporder"  class="list-group-item"><a style=" font-weight:normal;"  href="/manage/vipOrder/list"><i class="glyphicon glyphicon-download-alt"></i> <span>VIP订阅订单</span></a></li>
-		<li id="entnicheorder"  class="list-group-item"><a style=" font-weight:normal;"  href="/manage/entnicheOrder/list"><i class="glyphicon glyphicon-download-alt"></i> <span>企业商机管理</span></a></li>
-		<li id="jyloan"  class="list-group-item"><a style=" font-weight:normal;"  href="/manage/jyloan/list"><i class="glyphicon glyphicon-download-alt"></i> <span>企业贷款</span></a></li>
-    	<li id="pcUndate"  class="list-group-item"><a style=" font-weight:normal;" onclick="pushVersion()"><i class="glyphicon glyphicon-level-up"></i> <span>PC助手版本更新</span></a></li>
-		<!-- <li id="jydata"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/data/index"><i class="glyphicon glyphicon-euro"></i> <span>剑鱼数据管理</span></a></li>
-		<li id="databack"  class="list-group-item"><a style=" font-weight:normal;" href="/manage/data/back"><i class="glyphicon glyphicon-euro"></i> <span>剑鱼备份数据</span></a></li> -->
-		<li id="sendMessage"  class="sendActive list-group-item" style="border-bottom-left-radius: 4px; border-bottom-right-radius: 4px;"><a style="font-weight:normal;"  data-toggle="collapse" 
-    data-target="#collapseOne"><i class="glyphicon glyphicon-log-in"></i> <span>推送管理</span></a>
-		</li>
-		<div id="collapseOne"  class="sendActive collapse" style="border-left: 1px solid #ddd;border-right: 1px solid #ddd;border-bottom: 1px solid #ccc;background-color: rgb(255, 255, 255);border-bottom-left-radius: 4px; border-bottom-right-radius: 4px;">
-			<a style="font-weight:normal;display: block;color: #999;text-decoration: none;height: 45px;line-height: 45px;  margin-left: 56px;"  href="/manage/orderMessage/list"><span>订阅消息</span></a>
-		</div>
-
 	</ul>
  <style type="text/css">.glyphicon{font-family:'Glyphicons Halflings';}</style>
 	 <script>
 		$(function(){
-			var sendfirst = true;
-			if(window.location.href.indexOf("orderMessage")>0){
-				sendfirst = false;
-			};
-			$("#sendMessage").mouseover(function(){
-				$("#collapseOne").css({"background-color":"#f5f5f5"});
-				$("#sendMessage").css({"background-color":"#f5f5f5"});
-			}).mouseout(function () {
-				$("#collapseOne").css({"background-color":"rgb(255, 255, 255)"});
-				$("#sendMessage").css({"background-color":"rgb(255, 255, 255)"});
-		    }).click(function(){
-				if (sendfirst){
-					$("#sendMessage").css({"border-bottom-left-radius":"0px","border-bottom-right-radius":"0px","border-bottom-color":"#ddd"});
-					sendfirst = false;
-				}else{
-					$("#sendMessage").css({"border-bottom-left-radius":"4px","border-bottom-right-radius":"4px","border-bottom-color":"#ccc"});
-					sendfirst = true;
-				}
-			});
-			
-			$("#collapseOne").mouseover(function(){
-				$("#sendMessage").css({"background-color":"#f5f5f5"});
-				$("#collapseOne").css({"background-color":"#eee"});
-			}).mouseout(function () {
-				$("#collapseOne").css({"background-color":"rgb(255, 255, 255)"});
-				$("#sendMessage").css({"background-color":"rgb(255, 255, 255)"});
-		    })
+			getEachCL();
 		})
-		 function pushVersion() {
-		     var con = confirm("您确定要更新PC助手版本吗?");
-		     if(con){
-                 $.post("/manage/message/pushVersion",{},function(data){
-                     console.log(data);
-                     if (data.repl){
-                         alert("版本号:"+data.version+",更新成功!");
-                     }else{
-                         alert("更新失败");
-                     }
-                 })
-			 }
-         }
+		function getEachCL(){
+			$.ajax({
+	            type: "POST",
+	            url: "/manage/rbac/gEachCL",
+	            data:{},
+	            async:false,
+	            dataType: "json",
+	            success: function(r){
+					if (r.success){
+						appendHtml(r.data.data)
+					}
+	            },
+	            error: function(){
+	                alert("稍后再试!")
+	            }
+	        });
+		}
+		//
+		function appendHtml(r){
+			if(r.length>0){
+				var labHtml = '';
+				for(var i=0;i<r.length;i++){
+					labHtml += '<li dataId="'+r[i].s_icon+'" class="list-group-item" >'
+							+'<a style=" font-weight:normal;" href="'+r[i].s_url+'">'
+							+'<i class="glyphicon '+r[i].s_icon+'"></i>'
+							+'<span>'+r[i].s_name+'</span>'
+							+'</a>'
+							+'</li>';
+				}
+				$("#sidebar ul").html(labHtml);
+				setTimeout(function(){
+					selectActive();
+				},500)
+			}
+		}
+		//
+		function selectActive(){
+			var liactive = sessionStorage.getItem("liactive");
+			var liflag = false;
+			$("#sidebar").find("li").each(function(i,dom){
+				if(liactive!=null&&liactive==$(dom).attr("dataId")){
+					$(dom).addClass("liactive");
+					liflag = true;
+				}
+				$(dom).click(function(){
+					sessionStorage.setItem("liactive",$(dom).attr("dataId"));
+				})
+			})
+			if (!liflag){
+				$("#sidebar").find("li").eq(0).addClass("liactive");
+			}
+		}
 	 </script>
 </div>	

+ 0 - 1
core/src/web/templates/manage/systemsetting.html

@@ -60,7 +60,6 @@ background-color:#18CC7D;
 
 <!-- 中间 -->
 <script>
-
 $(function(){
 	$("#audit").datatable({
    perPage: 10