Commit fcada8cf authored by Hello's avatar Hello

ios闪退修复

parent 694f29f0
...@@ -144,6 +144,7 @@ export default { ...@@ -144,6 +144,7 @@ export default {
let tagOption = { let tagOption = {
'username': vm.username, 'username': vm.username,
} }
localStorage.setItem('appUserId', res.info.app_user_id)
vm.Jpush._jpush_config(tagOption) vm.Jpush._jpush_config(tagOption)
} else { } else {
hlsPopup.hideLoading() hlsPopup.hideLoading()
......
...@@ -6,20 +6,19 @@ export default { ...@@ -6,20 +6,19 @@ export default {
onGetRegistrationID: function (data) { onGetRegistrationID: function (data) {
let vm = this let vm = this
try { try {
//alert("JPushPlugin:registrationID is " + JSON.stringify(data)); // alert("JPushPlugin:registrationID is " + JSON.stringify(data));
if (data) { if (data) {
// alert('111') // alert('111')
window.localStorage.setItem('registrationID', data) window.localStorage.setItem('registrationID', data)
} }
if (!data) { if (!data) {
//alert('222') // alert('222')
window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID.bind(vm)) window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID.bind(vm))
//window.setTimeout(() => this.getRegistrationID(),1000) // window.setTimeout(() => this.getRegistrationID(),1000)
/* window.setTimeout(function () { /* window.setTimeout(function () {
vm.getRegistrationID() vm.getRegistrationID()
}, 1000)*/ }, 1000) */
} }
} catch (exception) { } catch (exception) {
// alert('###'+exception); // alert('###'+exception);
} }
...@@ -190,8 +189,8 @@ export default { ...@@ -190,8 +189,8 @@ export default {
// 极光推送 // 极光推送
_jpush_config: function (tagOption) { _jpush_config: function (tagOption) {
if (process.env.isMobilePlatform) { if (process.env.isMobilePlatform) {
let phone = window.localStorage.user_phone let userId = window.localStorage.appUserId
// alert('phone'+phone) // alert('phone'+phone)
let tags = [] let tags = []
for (let key in tagOption) { for (let key in tagOption) {
tags.push(tagOption[key]) tags.push(tagOption[key])
...@@ -199,7 +198,7 @@ export default { ...@@ -199,7 +198,7 @@ export default {
/* if (userName) { /* if (userName) {
tags.push(userName.toUpperCase()) tags.push(userName.toUpperCase())
} */ } */
window.plugins.jPushPlugin.setTags({sequence: Number(phone), tags: tags}, window.plugins.jPushPlugin.setTags({sequence: Number(userId), tags: tags},
function (result) { function (result) {
// alert('11'+result.tags) // alert('11'+result.tags)
}, function (error) { }, function (error) {
......
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