Commit 74bec2b7 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent d324ce2d
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
sourceType: '', sourceType: '',
slotParam: '', slotParam: '',
vipList: [], vipList: [],
localToken: '',
appName: '河狸小故事', appName: '河狸小故事',
isVip: false isVip: false
} }
...@@ -70,25 +69,23 @@ ...@@ -70,25 +69,23 @@
}, },
onShow(options) { onShow(options) {
this.ttLoging() this.ttLoging()
this.isVipStatus()
}, },
methods: { methods: {
isVipStatus() { isVipStatus() {
if (this.sourceType == 'android' && this.localToken) { this.post({
this.post({ url: '/user/baseMsg',
url: '/user/baseMsg', showLoading: false,
showLoading: false, success: ({
success: ({ data
data }) => {
}) => { if (data.expireTime > 0) {
if (data.expireTime > 0) { this.isVip = true
this.isVip = true } else {
} else { this.isVip = false
this.isVip = false
}
} }
}); }
} });
}, },
ttLoging() { ttLoging() {
var that = this; var that = this;
...@@ -130,7 +127,6 @@ ...@@ -130,7 +127,6 @@
data data
}) => { }) => {
app.globalData.userId = data.idcode; app.globalData.userId = data.idcode;
that.localToken = data.token;
saveToken(data.token) saveToken(data.token)
// saveToken( // saveToken(
// 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997' // 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997'
...@@ -203,7 +199,11 @@ ...@@ -203,7 +199,11 @@
appId: "wxbd687630cd02ce1d", appId: "wxbd687630cd02ce1d",
path: 'pages/index/index', path: 'pages/index/index',
extraData: wxData.params, extraData: wxData.params,
success(res) {}, success(res) {
setTimeout(() => {
that.isVipStatus()
}, 1000);
},
fail(res) { fail(res) {
// 未成功跳转到签约小程序 // 未成功跳转到签约小程序
// console.log("wxSign fail=", res); // console.log("wxSign fail=", res);
......
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