|
|
@ -4,7 +4,7 @@ import { config, postCaptcha, loginCaptcha, wechatApplet, getUserInfo, loginWech |
|
|
import { zconfig, loginToken } from "../api/ztb" |
|
|
import { zconfig, loginToken } from "../api/ztb" |
|
|
import { pconfig } from "../api/payment" |
|
|
import { pconfig } from "../api/payment" |
|
|
import { mconfig } from "../api/moment" |
|
|
import { mconfig } from "../api/moment" |
|
|
import { sconfig } from "../api/saas" |
|
|
|
|
|
|
|
|
import { sconfig, getOrderExists } from "../api/saas" |
|
|
const storage = require('../../utils/storage') |
|
|
const storage = require('../../utils/storage') |
|
|
const util = require('../../utils/util') |
|
|
const util = require('../../utils/util') |
|
|
const event = require('../../utils/event') |
|
|
const event = require('../../utils/event') |
|
|
@ -72,27 +72,43 @@ Page({ |
|
|
event.emit('EventMessage', { what: 888, desc: 'Logined' }) |
|
|
event.emit('EventMessage', { what: 888, desc: 'Logined' }) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
this.setData({ loging: false}) |
|
|
|
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
util.showToast(err) |
|
|
app.globalData.token = null |
|
|
app.globalData.token = null |
|
|
storage.remove('Authorization') |
|
|
storage.remove('Authorization') |
|
|
config.header = null |
|
|
config.header = null |
|
|
wx.hideLoading() |
|
|
|
|
|
util.showToast(err) |
|
|
|
|
|
|
|
|
this.setData({ loging: false}) |
|
|
wx.navigateBack() |
|
|
wx.navigateBack() |
|
|
}) |
|
|
}) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
wx.hideLoading() |
|
|
wx.hideLoading() |
|
|
this.setData({ loging: false}) |
|
|
|
|
|
|
|
|
util.showToast(err) |
|
|
app.globalData.token = null |
|
|
app.globalData.token = null |
|
|
storage.remove('Authorization') |
|
|
storage.remove('Authorization') |
|
|
config.header = null |
|
|
config.header = null |
|
|
this.setData({ loging: false}) |
|
|
this.setData({ loging: false}) |
|
|
|
|
|
wx.navigateBack() |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleUserToken: function(userToken){ |
|
|
handleUserToken: function(userToken){ |
|
|
storage.put('accessToken', userToken) |
|
|
|
|
|
|
|
|
storage.put('userToken', userToken) |
|
|
sconfig.header = {'user-token': userToken } |
|
|
sconfig.header = {'user-token': userToken } |
|
|
|
|
|
|
|
|
|
|
|
getOrderExists().then(result => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
if (Number(result.data) != 1 || !app.release) { |
|
|
|
|
|
wx.navigateBack() |
|
|
|
|
|
} else { |
|
|
|
|
|
wx.reLaunch({ url: '/pages/paper/index' }) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
util.showToast(err) |
|
|
|
|
|
app.globalData.token = null |
|
|
|
|
|
storage.remove('Authorization') |
|
|
|
|
|
config.header = null |
|
|
|
|
|
this.setData({ loging: false}) |
|
|
|
|
|
wx.navigateBack() |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
changePwd: function () { |
|
|
changePwd: function () { |
|
|
if (this.data.pwdType === 'password') { |
|
|
if (this.data.pwdType === 'password') { |
|
|
|