mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-23 21:36:38 +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 () {
|
||||
// 直接从Storage中获取用户信息
|
||||
let userStorageInfo = wx.getStorageSync('userInfo');
|
||||
|
||||
console.log('用户信息',userStorageInfo);
|
||||
if (userStorageInfo) {
|
||||
that.globalData.userInfo = JSON.parse(userStorageInfo);
|
||||
} else {
|
||||
@ -114,6 +114,7 @@ App({
|
||||
console.log(res.userInfo);
|
||||
wx.setStorageSync('userInfo', JSON.stringify(res.userInfo));
|
||||
wx.setStorageSync('loginFlag', res.sessionKey);
|
||||
wx.setStorageSync('token', res.token);
|
||||
callback();
|
||||
} else {
|
||||
that.showInfo(res.errmsg);
|
||||
|
||||
1
app.json
1
app.json
@ -9,7 +9,6 @@
|
||||
"pages/enterCommunity/enterCommunity",
|
||||
"pages/myBooks/myBooks",
|
||||
"pages/detail/detail",
|
||||
"pages/comment/comment",
|
||||
"pages/notice/index",
|
||||
"pages/notice/detail/detail",
|
||||
"pages/repairList/repairList",
|
||||
|
||||
@ -19,14 +19,14 @@ const appInfo = {
|
||||
};
|
||||
|
||||
const urlInfo = {
|
||||
areaUrl: baseUrl +"appApi/area.listAreas",
|
||||
GetNoticeListUrl: baseUrl + 'appApi/api.queryNotices',
|
||||
areaUrl: baseUrl +"app/area.listAreas",
|
||||
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',
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -46,8 +46,7 @@ Page({
|
||||
let curLocation = wx.getStorageSync("currentLocation");
|
||||
this.setData({
|
||||
province: curLocation.province,
|
||||
city: curLocation.city
|
||||
|
||||
city: curLocation.city
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@ -58,11 +58,12 @@ const getHeaders = function(){
|
||||
transaction_id: wxuuid(),
|
||||
req_time: getDateYYYYMMDDHHMISS(),
|
||||
sign:'1234567',
|
||||
user_id:'-1'
|
||||
|
||||
user_id:'-1',
|
||||
cookie: '_java110_token_=' + wx.getStorageSync('token')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
formatTime: formatTime,
|
||||
getHeaders: getHeaders
|
||||
|
||||
Loading…
Reference in New Issue
Block a user