课程前面的swagger测试都通了
真机测试没通
that.ajax(that.url.register, 'POST', data, function(resp) {
let permission = resp.data.permission;
let token = resp.data.token;
uni.setStorageSync('token', token);
uni.setStorageSync('permission', permission);
console.log(permission)
uni.switchTab({
url: '../index/index'
});
});
我的url是正确的,不是localhost
let baseUrl = "http://192.168.1.103:8080/emos-wx-api"
手机是同一个wifi
手机ip192.168.1.100
手机上输入000000并点击执行注册后没有反应,后端也没有数据
代码也按照手册后面的改过了
uni.login({
provider: 'weixin',
success: function(resp) {
console.log(resp.code);
let code = resp.code;
// 获取用户信息
uni.getUserProfile({
desc: '获取用户信息',
success: function(resp) {
console.log(resp.userInfo.nickName);
console.log(resp.userInfo.avatarUrl);
let nickName = resp.userInfo.nickName;
let avatarUrl = resp.userInfo.avatarUrl;
let data = {
code: that.code,
nickname: nickName,
photo: avatarUrl,
registerCode: that.registerCode
};
that.ajax(that.url.register, 'POST', data, function(resp) {
let permission = resp.data.permission;
let token = resp.data.token;
uni.setStorageSync('token', token);
uni.setStorageSync('permission', permission);
console.log(permission)
uni.switchTab({
url: '../index/index'
});
});
}
真机测试1.0版