@{
Layout = null;
}
Add头像
上传图片
用户名
密码
性别
爱好
描述
立即提交
layui.use('upload', function () {
var upload = layui.upload;
var uploadInst = upload.render({
elem: "#test1",
url: "https://localhost:44304/api/Upload/Post",
done: function (res)
{
console.log(res);
layui.$("#test2").attr('src', 'https://localhost:44304' + res.data.src);
layui.$("#test2").attr('value','https://localhost:44304'+ res.data.src);
alert('上传成功');
},
error: function ()
{
}
})
})
layui.use('form',function () {
var form = layui.form;
form.on('submit(formDemo)', function (data) {
console.log(data);
$.ajax({
url: "https://localhost:44304/api/userinfos/Post",
data: data.field,
type:"Post",
success: function () {
alert('成功');
location.href = '/UserInfoS/Index';
}
})
return false;
}
)
})
原文链接:https://www.cnblogs.com/ly-03-04/p/12321599.html
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。