|
@@ -6,7 +6,7 @@ import store from './store'
|
|
import { initLocale } from '@/locales/i18n'
|
|
import { initLocale } from '@/locales/i18n'
|
|
import loadCloudFontFace from '@/utils/font'
|
|
import loadCloudFontFace from '@/utils/font'
|
|
import Dialog from '@/wxcomponents/vant/dialog/dialog'
|
|
import Dialog from '@/wxcomponents/vant/dialog/dialog'
|
|
-
|
|
|
|
|
|
+
|
|
import './uni.promisify.adaptor'
|
|
import './uni.promisify.adaptor'
|
|
Vue.config.productionTip = false
|
|
Vue.config.productionTip = false
|
|
Vue.prototype.$config = {
|
|
Vue.prototype.$config = {
|
|
@@ -16,6 +16,8 @@ Vue.prototype.onInitNavbar = function(e) {
|
|
this.$config.pageHeight = e.detail.pageHeight
|
|
this.$config.pageHeight = e.detail.pageHeight
|
|
}
|
|
}
|
|
Vue.prototype.checkAuth = function(pagePath) {
|
|
Vue.prototype.checkAuth = function(pagePath) {
|
|
|
|
+ console.log(pagePath)
|
|
|
|
+ console.log(store.getters.user)
|
|
if (!store.getters.user) {
|
|
if (!store.getters.user) {
|
|
this.redirectTo('/pages/user/login?redirect=' + encodeURIComponent(pagePath))
|
|
this.redirectTo('/pages/user/login?redirect=' + encodeURIComponent(pagePath))
|
|
return false
|
|
return false
|
|
@@ -24,6 +26,7 @@ Vue.prototype.checkAuth = function(pagePath) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Vue.prototype.redirectTo = function(pagePath) {
|
|
Vue.prototype.redirectTo = function(pagePath) {
|
|
|
|
+ console.log(pagePath)
|
|
if (pagePath.indexOf('https') === -1) {
|
|
if (pagePath.indexOf('https') === -1) {
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url: pagePath
|
|
url: pagePath
|
|
@@ -35,6 +38,7 @@ Vue.prototype.redirectTo = function(pagePath) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Vue.prototype.navigateTo = function(pagePath) {
|
|
Vue.prototype.navigateTo = function(pagePath) {
|
|
|
|
+ console.log(pagePath)
|
|
if (pagePath.indexOf('http') === 0) {
|
|
if (pagePath.indexOf('http') === 0) {
|
|
this.webviewTo(pagePath)
|
|
this.webviewTo(pagePath)
|
|
} else {
|
|
} else {
|
|
@@ -157,4 +161,4 @@ export function createApp() {
|
|
app
|
|
app
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// #endif
|
|
|
|
|
|
+// #endif
|