Commit 692275c7 authored by lizhishu's avatar lizhishu

1.提交更新;

parent de553b2a
......@@ -143,22 +143,37 @@
};
},
onLoad(options) {
uni.setStorageSync('token',
`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwaG9uZSI6IjE4OTQyNTA4MzY0IiwidXNlcklkIjoiMjA4ODIxMjM4MzI0MDM1MSIsImJpbmRVc2VySWQiOiI2MTMwMCIsImJpbmRVc2VyVHlwZSI6IjIiLCJiaW5kQWNjb3VudElkIjoiMTEzIiwic291cmNlIjoiYWxpcGF5IiwiZXhwIjoxNjg4NzE3MDQyLCJpc3MiOiJhZG1pbiIsIm5iZiI6MTY4ODcxMjQ0Mn0.TJIWWE85hrDLENglp5YVqh8sVFzi5hE-17DjfputrOg`
)
this.HomePageData()
// if (!options['schoolId'] || !options['userId']) {
// Dialog({
// title: '系统提示!',
// message: '学生Id或学校Id为必传参数!',
// confirmButtonText: "知道了"
// }).then(res => {
// window.close()
// })
// return;
// }
if (!options['token']) {
Dialog({
title: '系统提示',
message: 'token为空!',
confirmButtonText: "知道了"
}).then(res => {
window.close()
})
return;
}
this.UserLogin(options['token'])
},
methods: {
//登录获取用户信息
async UserLogin(token) {
let data = await requestPost('/cgi-xpay/app/Login', {
grantType: 'alipay',
code: token,
})
console.warn("登录获取用户信息", data)
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
return
}
uni.setStorageSync('token', data.data['token'])
this.HomePageData()
},
// 查询消费会员权益项
async QueryProductContractItem() {
const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', {
......@@ -167,6 +182,7 @@
})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
......@@ -179,6 +195,7 @@
const data = await requestPost('/cgi-xpay/app/h5/HomePageData', {})
if (data['code'] != 200) {
await Dialog({
title: '温馨提示',
message: data['message'],
confirmButtonText: "知道了"
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment