Commit 692275c7 authored by lizhishu's avatar lizhishu

1.提交更新;

parent de553b2a
...@@ -143,22 +143,37 @@ ...@@ -143,22 +143,37 @@
}; };
}, },
onLoad(options) { onLoad(options) {
uni.setStorageSync('token', if (!options['token']) {
`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwaG9uZSI6IjE4OTQyNTA4MzY0IiwidXNlcklkIjoiMjA4ODIxMjM4MzI0MDM1MSIsImJpbmRVc2VySWQiOiI2MTMwMCIsImJpbmRVc2VyVHlwZSI6IjIiLCJiaW5kQWNjb3VudElkIjoiMTEzIiwic291cmNlIjoiYWxpcGF5IiwiZXhwIjoxNjg4NzE3MDQyLCJpc3MiOiJhZG1pbiIsIm5iZiI6MTY4ODcxMjQ0Mn0.TJIWWE85hrDLENglp5YVqh8sVFzi5hE-17DjfputrOg` Dialog({
) title: '系统提示',
this.HomePageData() message: 'token为空!',
// if (!options['schoolId'] || !options['userId']) { confirmButtonText: "知道了"
// Dialog({ }).then(res => {
// title: '系统提示!', window.close()
// message: '学生Id或学校Id为必传参数!', })
// confirmButtonText: "知道了" return;
// }).then(res => { }
// window.close() this.UserLogin(options['token'])
// })
// return;
// }
}, },
methods: { 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() { async QueryProductContractItem() {
const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', { const data = await requestPost('/cgi-xpay/app/h5/QueryProductContractItem', {
...@@ -167,6 +182,7 @@ ...@@ -167,6 +182,7 @@
}) })
if (data['code'] != 200) { if (data['code'] != 200) {
await Dialog({ await Dialog({
title: '温馨提示',
message: data['message'], message: data['message'],
confirmButtonText: "知道了" confirmButtonText: "知道了"
}) })
...@@ -179,6 +195,7 @@ ...@@ -179,6 +195,7 @@
const data = await requestPost('/cgi-xpay/app/h5/HomePageData', {}) const data = await requestPost('/cgi-xpay/app/h5/HomePageData', {})
if (data['code'] != 200) { if (data['code'] != 200) {
await Dialog({ await Dialog({
title: '温馨提示',
message: data['message'], message: data['message'],
confirmButtonText: "知道了" 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