index.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. import Vue from 'vue';
  2. import VueRouter from 'vue-router';
  3. import store from '@/store/index';
  4. Vue.use(VueRouter);
  5. const routes = [
  6. {
  7. path: '/home',
  8. component: () => import('../views/home/index.vue'),
  9. },
  10. // 修改密码
  11. {
  12. path: '/uppasswd/index',
  13. component: () => import('../views/uppasswd/index.vue'),
  14. },
  15. // 个人信息管理
  16. {
  17. path: '/userInfo/index',
  18. component: () => import('../views/userInfo/index.vue'),
  19. },
  20. // 金融数字超市-债权产品
  21. {
  22. path: '/supermarket/debt',
  23. component: () => import('../views/supermarket/debt.vue'),
  24. },
  25. {
  26. path: '/supermarket/debtdetail',
  27. component: () => import('../views/supermarket/debtdetail.vue'),
  28. },
  29. {
  30. path: '/supermarket/debtdetails',
  31. component: () => import('../views/supermarket/debtdetails.vue'),
  32. },
  33. {
  34. path: '/finance/index',
  35. component: () => import('../views/finance/index.vue'),
  36. },
  37. //新闻中心
  38. {
  39. path: '/news/index',
  40. component: () => import('../views/news/index.vue'),
  41. },
  42. //新闻中心详情
  43. {
  44. path: '/news/detail',
  45. component: () => import('../views/news/detail.vue'),
  46. },
  47. // 金融数字超市 - 股权产品
  48. {
  49. path: '/supermarket/stock',
  50. component: () => import('../views/supermarket/stock.vue'),
  51. },
  52. // 金融机构
  53. {
  54. path: '/institution/index/:status',
  55. component: () => import('../views/institution/index.vue'),
  56. },
  57. // 金融机构添加
  58. {
  59. path: '/institution/detail',
  60. component: () => import('../views/institution/detail.vue'),
  61. },
  62. // 其他用户管理-列表
  63. {
  64. path: '/otheruser/index',
  65. component: () => import('../views/otheruser/index.vue'),
  66. },
  67. // 其他用户管理-添加
  68. {
  69. path: '/otheruser/detail',
  70. component: () => import('../views/otheruser/detail.vue'),
  71. },
  72. // 企业用户管理-详情
  73. {
  74. path: '/companyuser/index',
  75. component: () => import('../views/companyuser/index.vue'),
  76. },
  77. {
  78. path: '/companyuser/detail',
  79. component: () => import('../views/companyuser/detail.vue'),
  80. },
  81. //指导单位
  82. {
  83. path: '/zhidao/index',
  84. component: () => import('../views/zhidao/index.vue'),
  85. },
  86. {
  87. path: '/zhidao/detail',
  88. component: () => import('../views/zhidao/detail.vue'),
  89. },
  90. //合作机构
  91. {
  92. path: '/tCooperativeOrganization/index',
  93. component: () => import('../views/tCooperativeOrganization/index.vue'),
  94. },
  95. {
  96. path: '/tCooperativeOrganization/detail',
  97. component: () => import('../views/tCooperativeOrganization/detail.vue'),
  98. },
  99. // 企业信息管理-列表
  100. {
  101. path: '/companyup/index',
  102. component: () => import('../views/companyup/index.vue'),
  103. },
  104. // 企业信息管理-详情
  105. {
  106. path: '/companyup/detail',
  107. component: () => import('../views/companyup/detail.vue'),
  108. },
  109. // 企业认证管理
  110. {
  111. path: '/companyidentify/index',
  112. component: () => import('../views/companyidentify/index.vue'),
  113. },
  114. // 企业认证管理-审核
  115. {
  116. path: '/companyidentify/detail',
  117. component: () => import('../views/companyidentify/detail.vue'),
  118. },
  119. // 角色管理-列表
  120. {
  121. path: '/character/index',
  122. component: () => import('../views/character/index.vue'),
  123. },
  124. // 角色管理-详情
  125. {
  126. path: '/character/detail',
  127. component: () => import('../views/character/detail.vue'),
  128. },
  129. // 地区管理-列表
  130. {
  131. path: '/region/index',
  132. component: () => import('../views/region/index.vue'),
  133. },
  134. // 地区管理-详情
  135. {
  136. path: '/region/detail',
  137. component: () => import('../views/region/detail.vue'),
  138. },
  139. //数字延伸服务管理
  140. {
  141. path: '/financialService/index',
  142. component: () => import('../views/financialService/index.vue'),
  143. },
  144. {
  145. path: '/financialService/detail',
  146. component: () => import('../views/financialService/detail.vue'),
  147. },
  148. {
  149. path: '/digitalService/index',
  150. component: () => import('../views/digitalService/index.vue'),
  151. },
  152. {
  153. path: '/digitalService/detail',
  154. component: () => import('../views/digitalService/detail.vue'),
  155. },
  156. {
  157. path: '/legalService/index',
  158. component: () => import('../views/legalService/index.vue'),
  159. },
  160. {
  161. path: '/legalService/detail',
  162. component: () => import('../views/legalService/detail.vue'),
  163. },
  164. {
  165. path: '/technicalService/index',
  166. component: () => import('../views/technicalService/index.vue'),
  167. },
  168. {
  169. path: '/technicalService/detail',
  170. component: () => import('../views/technicalService/detail.vue'),
  171. },
  172. {
  173. path: '/marketService/index',
  174. component: () => import('../views/marketService/index.vue'),
  175. },
  176. {
  177. path: '/marketService/detail',
  178. component: () => import('../views/marketService/detail.vue'),
  179. },
  180. {
  181. path: '/specialist/index',
  182. component: () => import('../views/specialist/index.vue'),
  183. },
  184. {
  185. path: '/specialist/detail',
  186. component: () => import('../views/specialist/detail.vue'),
  187. },
  188. //政策服务管理
  189. {
  190. path: '/tInformationDelivery/index',
  191. component: () => import('../views/tInformationDelivery/index.vue'),
  192. },
  193. {
  194. path: '/tInformationDelivery/detail',
  195. component: () => import('../views/tInformationDelivery/detail.vue'),
  196. },
  197. {
  198. path: '/tPolicyInterpretation/index',
  199. component: () => import('../views/tPolicyInterpretation/index.vue'),
  200. },
  201. {
  202. path: '/tPolicyInterpretation/detail',
  203. component: () => import('../views/tPolicyInterpretation/detail.vue'),
  204. },
  205. {
  206. path: '/tDeclarationApproval/index',
  207. component: () => import('../views/tDeclarationApproval/index.vue'),
  208. },
  209. {
  210. path: '/tDeclarationApproval/detail',
  211. component: () => import('../views/tDeclarationApproval/detail.vue'),
  212. },
  213. // 债权产品列表
  214. {
  215. path: '/financeclaims/financeClaimIndex',
  216. component: () => import('../views/financeclaims/financeClaimIndex.vue'),
  217. },
  218. // 债权产品信息详情
  219. {
  220. path: '/financeclaims/financeLookClaimDetail',
  221. component: () => import('../views/financeclaims/financeLookClaimDetail.vue'),
  222. },
  223. // 数贷产品列表
  224. {
  225. path: '/financeclaims/loanProIndex',
  226. component: () => import('../views/financeclaims/loanProIndex.vue'),
  227. },
  228. // 数贷产品信息修改(添加)
  229. {
  230. path: '/financeclaims/loanProDetail',
  231. component: () => import('../views/financeclaims/loanProDetail.vue'),
  232. },
  233. // 数贷产品信息详情
  234. {
  235. path: '/financeclaims/loanProLookDetail',
  236. component: () => import('../views/financeclaims/loanProLookDetail.vue'),
  237. },
  238. // 数贷产品授信页面
  239. {
  240. path: '/financeclaims/loanFollowndex',
  241. component: () => import('../views/financeclaims/loanFollowndex.vue'),
  242. },
  243. // 数贷产品授信详情页面
  244. {
  245. path: '/financeclaims/loanfollowDetail',
  246. component: () => import('../views/financeclaims/loanfollowDetail.vue'),
  247. },
  248. {
  249. path: '/login',
  250. name: 'login',
  251. component: () => import('../views/login.vue'),
  252. },
  253. // 理财产品列表
  254. {
  255. path: '/financeclaims/manageMoneyIndex',
  256. component: () => import('../views/financeclaims/manageMoneyIndex.vue'),
  257. },
  258. // 理财产品信息详情
  259. {
  260. path: '/financeclaims/manageMoneyLookDetail',
  261. component: () => import('../views/financeclaims/manageMoneyLookDetail.vue'),
  262. },
  263. // 首页轮播管理-列表
  264. {
  265. path: '/banner/index',
  266. component: () => import('../views/banner/index.vue'),
  267. },
  268. // 首页轮播管理-详情
  269. {
  270. path: '/banner/detail',
  271. component: () => import('../views/banner/detail.vue'),
  272. },
  273. ];
  274. const router = new VueRouter({
  275. mode: 'history',
  276. base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROOT_URL,
  277. routes,
  278. });
  279. router.beforeEach((to, form, next) => {
  280. store.commit('setUser');
  281. if (to.name === 'login') {
  282. next();
  283. return;
  284. }
  285. let user = store.state.user;
  286. if (user) {
  287. next();
  288. }
  289. //下面是没登录的情况,需要跳转页面到用户未登录页
  290. else next({ name: 'login' });
  291. });
  292. export default router;