Commit 4c68609c authored by mengcuiguang's avatar mengcuiguang

代码优化

parent c304e772
......@@ -2,10 +2,6 @@
import checkUpdate from './utils/update.js';
export default {
onLaunch: function(options) {
console.log('App onLaunch');
this.getQueryOptions(options)
// #ifdef APP-PLUS
//设置2.4秒后主动关闭,最多设置6秒
setTimeout(() => {
......@@ -29,25 +25,6 @@
// #endif
try {
let value = uni.getStorageSync('token') || '';
// if (options.query.token) {
// if (value !== options.query.token) {
// value = '';
// } else {
// value = options.query.token;
// }
// uni.setStorage({
// key: 'token',
// data: value
// });
// }
// if (options.query.token) {
// value = options.query.token;
// uni.setStorage({
// key: 'token',
// data: value
// });
// }
let inviteUId = uni.getStorageSync('inviteUId') || '';
if (!inviteUId && options.query.inviteUId) {
......@@ -89,55 +66,7 @@
this.globalData.resetLogin = false
},
methods: {
getQueryOptions(options) {
var channel = '' // 渠道
var clueToken = '' // 归因参数
var adId = '' // 计划id
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var creativeId = '' // 创意id
if (options.query.clueToken ?? '' != '') {
channel = 'tt'
clueToken = options.query.clueToken ?? ''
adId = options.query.adId ?? ''
advertiserId = options.query.advertiserId ?? ''
reqId = options.query.reqId ?? ''
creativeId = options.query.creativeId ?? ''
}
if (options.query.ksChannel ?? '' != '') {
channel = 'kuaishou'
clueToken = options.query.callback ?? ''
adId = options.query.ksCampaignId ?? ''
reqId = options.query.ksUnitId ?? ''
creativeId = options.query.ksCreativeId ?? ''
}
uni.setStorage({
key: 'channel',
data: channel
});
uni.setStorage({
key: 'clueToken',
data: clueToken
});
uni.setStorage({
key: 'adId',
data: adId
});
uni.setStorage({
key: 'advertiserId',
data: advertiserId
});
uni.setStorage({
key: 'reqId',
data: reqId
});
uni.setStorage({
key: 'creativeId',
data: creativeId
});
}
},
globalData: {
resetLogin: false,
......@@ -149,19 +78,15 @@
h5Url: 'https://api.mints-id.com/index.html',
// baseUrl: 'https://api.mints-tech.cn/camera-api/miniApi',
baseUrl: 'http://192.168.110.71:8301/miniApi',
// baseUrl: 'http://test.mints-id.com/ww-new/api',
titleButtonWidth: 38,
token: '',
userId: 0,
inviteUId: '',
serviceUrl: '',
loginKey: '',
downUrl: '', //
versionName: 'v 1.0.0',
realNameStatus: false,
auth: false, // 三要素实名认证
userInfo: null,
cardInfo: null,
pkgName: 'com.mints.minivideo'
}
};
......
......@@ -176,7 +176,7 @@
"enable" : true
}
},
"title" : "康陪侣",
"title" : "短剧",
"router" : {
"base" : "./"
},
......
......@@ -89,8 +89,6 @@ export default {
},
logout() {
app.globalData.userInfo = null;
app.globalData.userId = 0;
app.globalData.auth = false;
uni.removeStorageSync('token');
},
put(options) {
......
......@@ -113,7 +113,6 @@
key: 'token',
data: data.token
});
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
setTimeout(() => {
redirectTo('home');
......
......@@ -112,7 +112,7 @@
handlePhone() {
// 联系我们
this.post({
url: '/app/customerServiceNumbers',
url: '/vedio/customerServiceNumbers',
showLoading: false,
success: ({
data
......
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