wangfukang 3 weeks ago
parent
commit
ffa6bb04fc
  1. 13
      pages/login/login.vue

13
pages/login/login.vue

@ -187,7 +187,7 @@
},
getRegistrationID(options = {}) {
const cachedClientId = this.getStoredClientId();
if (cachedClientId) {
if (!options.force && cachedClientId) {
return Promise.resolve(cachedClientId);
}
@ -199,8 +199,10 @@
if (isResolved) return;
isResolved = true;
if (timer) clearTimeout(timer);
this.saveClientId(clientId);
resolve(clientId || this.getStoredClientId());
if (clientId) {
this.saveClientId(clientId);
}
resolve(clientId || (options.force ? '' : this.getStoredClientId()));
};
timer = setTimeout(() => {
finish('');
@ -441,10 +443,11 @@
let clientId = ''
try {
clientId = await this.getRegistrationID({
timeout: 800
force: true,
timeout: 2000
});
} catch (e) {
clientId = this.getStoredClientId()
clientId = ''
}
let url;
let data;

Loading…
Cancel
Save