123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- import Vue from "vue";
- import VueRouter from "vue-router";
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch(err => err);
- }
- Vue.use(VueRouter);
- const routes = [
- {
- path: "/",
- name: "login",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/login/login.vue")
- },
- {
- path: "/test",
- name: "test",
- component: ()=>import("../views/test/test.vue")
- },
- {
- path: "/loginByPhone",
- name: "loginByPhone",
- meta:{
- keepAlive:false
- },
- component: ()=>import("../views/login/loginByPhone.vue")
- },
- {
- path: "/loginByCode",
- name: "loginByCode",
- meta:{
- keepAlive:false
- },
- component: ()=>import("../views/login/loginByCode.vue")
- },
- {
- path: "/sex",
- name: "sex",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/info/sex.vue")
- },
- {
- path: "/figure",
- name: "figure",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/info/figure.vue")
- },
- {
- path: "/datum",
- name: "datum",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/info/datum.vue")
- },
- {
- path: "/city",
- name: "city",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/info/city.vue")
- },
- {
- path: "/wechat",
- name: "wechat",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/info/wechat.vue")
- },
- {
- path: "/labels",
- name: "labels",
- meta:{
- keepAlive:false
- },
- component: ()=>import("../views/info/labels.vue")
- },
- {
- path: "/user",
- name: "user",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/friends/user.vue")
- },
- {
- path: "/main",
- name: "main",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/main/main.vue"),
- redirect: '/friends',
- children:[
- {
- path: "/friends",
- name: "friends",
- meta:{
- keepAlive:true
- },
- component:()=>import("../views/friends/friends.vue"),
- },
- {
- path: "/messages",
- name: "messages",
- meta:{
- keepAlive:false
- },
- component:()=>import("../views/messages/messages.vue"),
- },
- {
- path: "/mine",
- name: "mine",
- meta:{
- keepAlive:false
- },
- component:()=>import("../views/mine/mine.vue"),
- },
- ]
- },
- {
- path: "/chatting",
- name: "chatting",
- meta:{
- keepAlive:false
- },
- component: ()=>import("../views/chatting/chatting.vue")
- },
- {
- path: "/editCenter",
- name: "editCenter",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/info/editCenter.vue")
- },
- {
- path: "/guest",
- name: "guest",
- meta:{
- keepAlive:false
- },
- component: ()=>import("../views/mine/guest.vue")
- },
- {
- path: "/search",
- name: "search",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/search/search.vue")
- },
- {
- path: "/album",
- name: "album",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/mine/album.vue")
- },
- {
- path: "/faceVideo",
- name: "faceVideo",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/faceVideo/faceVideo.vue")
- },
- {
- path: "/chooseImage",
- name: "chooseImage",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/mine/chooseImage.vue")
- },
- {
- path: "/authReady",
- name: "authReady",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/mine/authReady.vue")
- },
- {
- path: "/setting",
- name: "setting",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/setting/setting.vue")
- },
- {
- path: "/vip",
- name: "vip",
- meta:{
- keepAlive:true
- },
- component: ()=>import("../views/vip/vip.vue")
- },
- {
- path: "/walletHome",
- name: "walletHome",
- component: () => import("../views/wallet/walletHome/index"),
- },
- {
- path: "/ydDetail",
- name: "ydDetail",
- component: () => import("../views/wallet/ydDetail/index"),
- },
- {
- path: "/walletWithdraw",
- name: "walletWithdraw",
- component: () => import("../views/wallet/walletWithdraw/index"),
- },
- {
- path: "/boundAli",
- name: "boundAli",
- component: () => import("../views/wallet/boundAli/index"),
- },
- {
- path: "/incomeDetail",
- name: "incomeDetail",
- component: () => import("../views/wallet/incomeDetail/index"),
- },
- {
- path: "/exchange",
- name: "exchange",
- component: () => import("../views/wallet/exchange/index"),
- },
- {
- path: "/exchangeSuccess",
- name: "exchangeSuccess",
- component: () => import("../views/wallet/exchangeSuccess/index"),
- },
- {
- path: "/withdrawResult",
- name: "withdrawResult",
- component: () => import("../views/wallet/withdrawResult/index"),
- },
- ];
- const router = new VueRouter({
- mode: "history",
- base: process.env.BASE_URL,
- routes,
- });
- // router.beforeEach((to,from,next)=>{
- // console.log(to,from)
- // if(to.name==='test'){
- // next();
- // }
- // if(!localStorage.getItem('user')){
- // if(to.name==='login'||(from.name==='login'&&to.name==='loginByPhone')||(from.name==='loginByPhone'&&to.name==='loginByCode')){
- // next();
- // }
- // else {
- // next({path:'/'});
- // }
- // }
- // else{
- // next();
- // }
-
- // });
- export default router;
|