mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-06-12 10:00:57 +08:00
加入小程序登录时 加入token 鉴权问题
This commit is contained in:
parent
f0bb174fec
commit
7c7c990bb4
3
app.js
3
app.js
@ -62,7 +62,7 @@ App({
|
|||||||
success: function () {
|
success: function () {
|
||||||
// 直接从Storage中获取用户信息
|
// 直接从Storage中获取用户信息
|
||||||
let userStorageInfo = wx.getStorageSync('userInfo');
|
let userStorageInfo = wx.getStorageSync('userInfo');
|
||||||
|
console.log('用户信息',userStorageInfo);
|
||||||
if (userStorageInfo) {
|
if (userStorageInfo) {
|
||||||
that.globalData.userInfo = JSON.parse(userStorageInfo);
|
that.globalData.userInfo = JSON.parse(userStorageInfo);
|
||||||
} else {
|
} else {
|
||||||
@ -114,6 +114,7 @@ App({
|
|||||||
console.log(res.userInfo);
|
console.log(res.userInfo);
|
||||||
wx.setStorageSync('userInfo', JSON.stringify(res.userInfo));
|
wx.setStorageSync('userInfo', JSON.stringify(res.userInfo));
|
||||||
wx.setStorageSync('loginFlag', res.sessionKey);
|
wx.setStorageSync('loginFlag', res.sessionKey);
|
||||||
|
wx.setStorageSync('token', res.token);
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
that.showInfo(res.errmsg);
|
that.showInfo(res.errmsg);
|
||||||
|
|||||||
1
app.json
1
app.json
@ -9,7 +9,6 @@
|
|||||||
"pages/enterCommunity/enterCommunity",
|
"pages/enterCommunity/enterCommunity",
|
||||||
"pages/myBooks/myBooks",
|
"pages/myBooks/myBooks",
|
||||||
"pages/detail/detail",
|
"pages/detail/detail",
|
||||||
"pages/comment/comment",
|
|
||||||
"pages/notice/index",
|
"pages/notice/index",
|
||||||
"pages/notice/detail/detail",
|
"pages/notice/detail/detail",
|
||||||
"pages/repairList/repairList",
|
"pages/repairList/repairList",
|
||||||
|
|||||||
@ -19,14 +19,14 @@ const appInfo = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const urlInfo = {
|
const urlInfo = {
|
||||||
areaUrl: baseUrl +"appApi/area.listAreas",
|
areaUrl: baseUrl +"app/area.listAreas",
|
||||||
GetNoticeListUrl: baseUrl + 'appApi/api.queryNotices',
|
GetNoticeListUrl: baseUrl + 'app/api.queryNotices',
|
||||||
//报修接口
|
//报修接口
|
||||||
saveOwnerRepair: baseUrl + 'appApi/ownerRepair.saveOwnerRepair',
|
saveOwnerRepair: baseUrl + 'app/ownerRepair.saveOwnerRepair',
|
||||||
//查看报修
|
//查看报修
|
||||||
listOwnerRepairs: baseUrl + 'appApi/ownerRepair.listOwnerRepairs',
|
listOwnerRepairs: baseUrl + 'app/ownerRepair.listOwnerRepairs',
|
||||||
//家庭成员
|
//家庭成员
|
||||||
saveOwner: baseUrl + 'appApi/owner.saveOwner',
|
saveOwner: baseUrl + 'app/owner.saveOwner',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,6 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
province: curLocation.province,
|
province: curLocation.province,
|
||||||
city: curLocation.city
|
city: curLocation.city
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -58,10 +58,11 @@ const getHeaders = function(){
|
|||||||
transaction_id: wxuuid(),
|
transaction_id: wxuuid(),
|
||||||
req_time: getDateYYYYMMDDHHMISS(),
|
req_time: getDateYYYYMMDDHHMISS(),
|
||||||
sign:'1234567',
|
sign:'1234567',
|
||||||
user_id:'-1'
|
user_id:'-1',
|
||||||
|
cookie: '_java110_token_=' + wx.getStorageSync('token')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
formatTime: formatTime,
|
formatTime: formatTime,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user