后臺(tái)內(nèi)容列表使用ajax提交數(shù)據(jù),接口是文章發(fā)布接口,咋直接到首頁(yè)了呢,這是哪兒錯(cuò)了
<script>
var other = xmSelect.render({
el: '#other',
language: 'zn',
data: {$workinfo},
paging: true,
});
layui.use(['form', 'layedit', 'laydate'], function(){
var form = layui.form
,layer = layui.layer
,layedit = layui.layedit
,laydate = layui.laydate;
//監(jiān)聽(tīng)提交
form.on('submit(demo1)', function(data){
$.ajax({
url: "./index.php?appid=1&appsecret=PHPCMFA655E48809D75&api_auth_code="+{md5($member['password'].$member['salt'])}+"&api_auth_uid="+{$member['id']}+"&s=member&app=work&c=home&m=add",
type: "POST",
dataType: "json",
data:{
'is_ajax': 1,
'is_draft': 0,
'catid': 1,
'data["title"]': $('#title').value(),
'data["worktype"]': $('#worktype').value(),
'data["other"]': other.getValue(),
'data["state"]': $('#state').value(),
'data["content"]': $('#content').value(),
'data[inputtime]': '{SYS_TIME}',
'data[inputip]':'{$ip}',
'data[author]': '{$member['username']}',
'data[uid]': '{$member['id']}',
'data[status]': 9
},
success: function(data) {
layer.msg(data);
},
error: function (data) {
}
});
return false;
});
});
</script>
改成
開(kāi)源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問(wèn)題!
回復(fù)@官方實(shí)習(xí)技術(shù) 還是不行啊,我這個(gè)是那里有問(wèn)題啊