xx:{"phone":111,"password":1234}
uni.request({
url: 'http://localhost:9091/staff/login', //仅为示例,并非真实接口地址。
method:'POST',
data: {
phone:this.xx.phone,
password:this.xx.password
},
success: (res) => {
}
})
存
uni.setStorage({
key:'key',
data:value
})
取
uni.getStorage({
key: 'key',
success: function (res) {
console.log(res);
}
});
本文介绍了一个使用uni-app进行用户登录的代码示例,包括POST请求发送登录信息到本地服务器接口,并展示了如何使用uni-app的API进行数据的存储与读取操作。
5244





