37 lines
820 B
JavaScript
37 lines
820 B
JavaScript
|
import Vue from "vue";
|
||
|
import App from "./App";
|
||
|
|
||
|
import store from "./store";
|
||
|
import Request from "./request/js/index";
|
||
|
|
||
|
Vue.prototype.$eventHub = new Vue();
|
||
|
Vue.config.productionTip = false;
|
||
|
|
||
|
Vue.prototype.$store = store;
|
||
|
Vue.prototype.$http = Request();
|
||
|
|
||
|
App.mpType = "app";
|
||
|
|
||
|
// Vue.prototype.checkLogin = function(){
|
||
|
// var userInfo = uni.getStorageSync('userInfo');
|
||
|
// if(userInfo == ''){
|
||
|
// uni.redirectTo({url:'login/login'});
|
||
|
// return false;
|
||
|
// }
|
||
|
// return [userInfo];
|
||
|
// }
|
||
|
|
||
|
Vue.prototype.goMain = function (sessionName) {
|
||
|
if (sessionName) {
|
||
|
uni.removeStorageSync(sessionName);
|
||
|
}
|
||
|
// uni.switchTab({url: "../main/main"}); url: '/pages/index/index'
|
||
|
uni.switchTab({ url: "/pages/main/main" });
|
||
|
};
|
||
|
|
||
|
const app = new Vue({
|
||
|
store,
|
||
|
...App,
|
||
|
});
|
||
|
app.$mount();
|