Commit 4c68609c authored by mengcuiguang's avatar mengcuiguang

代码优化

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