用户接口对接
This commit is contained in:
22
App.vue
22
App.vue
@@ -2,21 +2,17 @@
|
||||
import encrypt from './common/js/aes.js'
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
let cidAES = uni.getStorageSync('cidAES')
|
||||
let cidAES = uni.getStorageSync('cidAES') || 'nnvmhMk8626D8QHhJefm+W9rTAJWuBPRxcnRm4+9bWXdSLRIyTnTruoYfLxGK3Oy'
|
||||
uni.setStorageSync('cidAES', cidAES);
|
||||
if (!cidAES) {
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
console.log(res.cid);
|
||||
uni.setStorageSync('cid', res.cid);
|
||||
var cidAES = encrypt.Encrypt(res.cid, this.$config.key);
|
||||
uni.setStorageSync('cidAES', cidAES);
|
||||
},
|
||||
fail (err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
document.addEventListener('plusready', () => {
|
||||
// 页面加载时触发
|
||||
let pinf = plus.push.getClientInfo();
|
||||
let cid = pinf.clientid;//客户端标识
|
||||
cidAES = encrypt.Encrypt(cid, this.$config.key);
|
||||
uni.setStorageSync('cidAES', cidAES);
|
||||
}, false);
|
||||
}
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show')
|
||||
|
||||
Reference in New Issue
Block a user