代码优化
This commit is contained in:
parent
f3615bfbb8
commit
820fb9aea6
16
App.vue
16
App.vue
|
|
@ -376,8 +376,18 @@
|
|||
//请求后台接口 解析数据 对比版本
|
||||
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
||||
res = res.data[0];
|
||||
|
||||
if (widgetInfo.version < res.version && uni.getSystemInfoSync().platform == 'android') {
|
||||
console.log(widgetInfo)
|
||||
console.log(res)
|
||||
let version;
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
version = res.version
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
version = res.iosVersion
|
||||
}
|
||||
version = res.version
|
||||
// && uni.getSystemInfoSync().platform == 'android'
|
||||
if (widgetInfo.version < version) {
|
||||
let downloadLink = '';
|
||||
let androidLink = res.androidWgtUrl;
|
||||
let iosLink = res.iosWgtUrl;
|
||||
|
|
@ -635,7 +645,7 @@
|
|||
onShow: function() {
|
||||
|
||||
// #ifdef H5
|
||||
isH5Android()
|
||||
// isH5Android()
|
||||
// #endif
|
||||
|
||||
console.log('App Show')
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
const ROOTPATH1 = "https://dj-api.hnsiyao.cn/czg/"; //
|
||||
const ROOTPATH = "https://dj-api.hnsiyao.cn/czg/"; //后台服务域名
|
||||
const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
|
||||
// APP
|
||||
// const ROOTPATH1 = "https://dj-api.hnsiyao.cn/czg/"; //
|
||||
// const ROOTPATH = "https://dj-api.hnsiyao.cn/czg/"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = "https://video.hnsiyao.cn/czg/"; //
|
||||
// const ROOTPATH = "https://video.hnsiyao.cn/czg/"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
// h5
|
||||
const ROOTPATH1 = "https://web.hnsiyao.cn/czg/"; //
|
||||
const ROOTPATH = "https://web.hnsiyao.cn/czg/"; //后台服务域名
|
||||
const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = "https://web-api.hnsiyao.cn/czg/"; //
|
||||
// const ROOTPATH = "https://web-api.hnsiyao.cn/czg/"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
// const ROOTPATH1 = "http://192.168.1.5:8100/czg/"; //
|
||||
// const ROOTPATH = "http://192.168.1.5:8100/czg/"; //后台服务域名
|
||||
// const ROOTPATH2 = "http://192.168.1.5:8100"; //后台服务域名
|
||||
|
|
|
|||
|
|
@ -52,6 +52,17 @@ const install = (Vue, vm) => {
|
|||
}, 1500)
|
||||
return false;
|
||||
} else if (res.code == 401) {
|
||||
// 获取当前页面实例
|
||||
const pages = getCurrentPages();
|
||||
// 获取当前页面的实例
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面路径
|
||||
const pagePath = currentPage.route
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const isIOS = /iOS/.test(systemInfo.platform);
|
||||
// if ( pagePath == "pages/task/index") {
|
||||
// return;
|
||||
// }
|
||||
// 假设201为token失效,这里跳转登录
|
||||
vm.$u.toast('验证失败,请重新登录');
|
||||
uni.removeStorageSync("token")
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ module.exports = {
|
|||
const pagePath = currentPage.route
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const isIOS = /iOS/.test(systemInfo.platform);
|
||||
if ( pagePath == "pages/task/index") {
|
||||
return;
|
||||
}
|
||||
// if ( pagePath == "pages/task/index") {
|
||||
// return;
|
||||
// }
|
||||
uni.removeStorageSync("token")
|
||||
uni.removeStorageSync("userId")
|
||||
uni.removeStorageSync("phone")
|
||||
|
|
@ -52,9 +52,7 @@ module.exports = {
|
|||
title: '用户信息失效,请重新登录!',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
uni.navigateTo({ url: "/pages/login/login" })
|
||||
},
|
||||
post: function(url, data, header) {
|
||||
let that = this;
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@
|
|||
uni.setStorageSync('qdCodeion', options.qdCode)
|
||||
}
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.$Request.get('/app/common/type/813').then(res => {
|
||||
this.$u.get('/app/common/type/813').then(res => {
|
||||
if (res.code == 0 && res.data.value) {
|
||||
if (res.data.value == '是') {
|
||||
this.getActivity()
|
||||
|
|
@ -418,7 +418,7 @@
|
|||
//#endif
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.getMyLoveVideo()
|
||||
this.$Request.get('/app/common/type/813').then(res => {
|
||||
this.$u.get('/app/common/type/813').then(res => {
|
||||
if (res.code == 0 && res.data.value) {
|
||||
if (res.data.value == '是') {
|
||||
this.getActivitys()
|
||||
|
|
@ -426,7 +426,7 @@
|
|||
}
|
||||
})
|
||||
//新用户红包 837
|
||||
this.$Request.get('/app/common/type/837').then(res => {
|
||||
this.$u.get('/app/common/type/837').then(res => {
|
||||
if (res.code == 0 && res.data.value) {
|
||||
this.xxJDNum = res.data.value;
|
||||
this.checkNewUser()
|
||||
|
|
@ -890,6 +890,7 @@
|
|||
state: 1
|
||||
}
|
||||
this.$u.api.msg(data).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.notice = res.data.list
|
||||
res.data.list.forEach(res => {
|
||||
|
|
|
|||
|
|
@ -285,6 +285,7 @@
|
|||
title: '正在登录中...',
|
||||
})
|
||||
this.$u.post('/app/Login/registerCode?password=' + code + '&phone=' + mobile).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
uni.setStorageSync('token', res.token)
|
||||
uni.setStorageSync('userId', res.user.userId)
|
||||
|
|
@ -306,14 +307,9 @@
|
|||
icon: 'none'
|
||||
})
|
||||
const arr= getCurrentPages()
|
||||
if(arr.length<=1){
|
||||
return uni.reLaunch({
|
||||
uni.reLaunch({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
uni.navigateBack({
|
||||
delta: arr.length<=2?1:2
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@
|
|||
this.relation = relation;
|
||||
this.invitation = relation;
|
||||
}
|
||||
this.$u.get('/app/common/type/3').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.registerCode = res.data.value
|
||||
}
|
||||
});
|
||||
// this.$u.get('/app/common/type/3').then(res => {
|
||||
// if (res.code == 0) {
|
||||
// this.registerCode = res.data.value
|
||||
// }
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
isShowAgree() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue