index.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import ElementUI from 'element-ui'
  4. import 'element-ui/lib/theme-chalk/index.css'
  5. import locale from 'element-ui/lib/locale/lang/en'
  6. import login from '@/components/login'
  7. import index from '@/components/index'
  8. import indexGM from '@/components/GM/indexGM'
  9. import studentIndex from '@/components/studentIndex'
  10. import studioIndex from '@/components/studio/index'
  11. import courseDetail from '@/components/courseDetail'
  12. import courseDetailS from '@/components/student/courseDetail'
  13. import courseDetailStudio from '@/components/studio/courseDetail'
  14. import courseDetailNT from '@/components/noTerminal/courseDetail'
  15. import courseDetailGM from '@/components/GM/courseDetailGM'
  16. import mine from '@/components/mine'
  17. import project from '@/components/project'
  18. import works from '@/components/works'
  19. import worksGM from '@/components/GM/worksGM'
  20. import score from '@/components/score'
  21. import notice from '@/components/notice'
  22. import noticeDetail from '@/components/noticeDetail'
  23. import study from '@/components/study'
  24. import liveRoom from '@/components/liveRoom'
  25. import liveProjectDetail from '@/components/liveProjectDetail'
  26. import audioDemo from '@/components/audioDemo'
  27. import cameraDemo from '@/components/cameraDemo'
  28. import studyStudent from '@/components/studyStudent'
  29. import studyStudentS from '@/components/student/studyStudent'
  30. import studyStudentStudio from '@/components/studio/studyStudent'
  31. import studyStudentNT from '@/components/noTerminal/studyStudent'
  32. import studyStudentE from '@/components/easy/studyStudent'
  33. import studyStudentE2 from '@/components/easy2/studyStudent'
  34. import studyStudentE3 from '@/components/easy3/studyStudent'
  35. import studySutdentClass from '@/components/studySutdentClass/studyStudent'
  36. import studyStudentGM from '@/components/GM/studyStudentGM'
  37. import pdf from '@/components/pdf'
  38. import courseDetailTrain from '@/components/trainCourse/courseDetail'
  39. import studyStudentTrain from '@/components/trainCourse/studyStudent'
  40. import studyStudentE2Train from '@/components/trainCourse/easy2/studyStudent'
  41. import studyStudentE3Train from '@/components/trainCourse/easy3/studyStudent'
  42. import pptEasyClass from '@/components/pptEasyClass'
  43. import pptEasyClassPS from '@/components/pptEasyClass/indexPS'
  44. import dataBoardStudent from '@/components/pptEasyClass/dataBoard/student'
  45. import dataBoardTeacher from '@/components/pptEasyClass/dataBoard/teacher'
  46. import cn from "../lang/cn.json";
  47. import hk from "../lang/hk.json";
  48. import en from "../lang/en.json";
  49. // 全局修改默认配置,点击空白处不能关闭弹窗
  50. ElementUI.Dialog.props.closeOnClickModal.default = false
  51. Vue.use(Router)
  52. let lang = new Object();
  53. let domain_name = "";
  54. let region = 'cn'
  55. if (window.location.href.includes('beta') || window.location.href.includes('localhost')) {
  56. domain_name="cn";
  57. region = 'beta'
  58. lang = cn;
  59. }else if (window.location.href.includes("cocorobo.cn")) {
  60. domain_name="cn";
  61. region = 'cn'
  62. lang = cn;
  63. } else if (window.location.href.includes("cocorobo.hk")) {
  64. domain_name="hk";
  65. region = 'hk'
  66. lang = hk;
  67. } else if (window.location.href.includes("cocorobo.com")) {
  68. domain_name="com";
  69. region = 'com'
  70. lang=en;
  71. }else{
  72. region = 'cn'
  73. domain_name="cn";
  74. lang=cn;
  75. }
  76. Vue.prototype.lang =lang;
  77. Vue.prototype.$region = region
  78. if(domain_name==='com'){//英文版
  79. Vue.use(ElementUI,{locale})
  80. }else{
  81. Vue.use(ElementUI)
  82. }
  83. export default new Router({
  84. routes: [
  85. // {
  86. // path: '/login',
  87. // name: 'login',
  88. // component: login
  89. // },
  90. {
  91. path: '/',
  92. redirect: '/index'
  93. },
  94. {
  95. path: '/index',
  96. name: 'index',
  97. component: index,
  98. requireAuth: ''
  99. },
  100. {
  101. path: '/studentIndex',
  102. name: 'studentIndex',
  103. component: studentIndex,
  104. requireAuth: ''
  105. },
  106. {
  107. path: '/indexGM',
  108. name: 'indexGM',
  109. component: indexGM,
  110. requireAuth: ''
  111. },
  112. {
  113. path: '/courseDetail',
  114. name: 'courseDetail',
  115. component: courseDetail,
  116. requireAuth: ''
  117. },
  118. {
  119. path: '/courseDetailGM',
  120. name: 'courseDetailGM',
  121. component: courseDetailGM,
  122. requireAuth: ''
  123. },
  124. {
  125. path: '/mine',
  126. name: 'mine',
  127. component: mine,
  128. requireAuth: ''
  129. },
  130. {
  131. path: '/project',
  132. name: 'project',
  133. component: project,
  134. requireAuth: ''
  135. },
  136. {
  137. path: '/works',
  138. name: 'works',
  139. component: works,
  140. requireAuth: ''
  141. },
  142. {
  143. path: '/worksGM',
  144. name: 'worksGM',
  145. component: worksGM,
  146. requireAuth: ''
  147. },
  148. {
  149. path: '/score',
  150. name: 'score',
  151. component: score,
  152. requireAuth: ''
  153. },
  154. {
  155. path: '/notice',
  156. name: 'notice',
  157. component: notice,
  158. requireAuth: ''
  159. },
  160. {
  161. path: '/noticeDetail',
  162. name: 'noticeDetail',
  163. component: noticeDetail,
  164. requireAuth: ''
  165. },
  166. {
  167. path: '/study',
  168. name: 'study',
  169. component: study,
  170. requireAuth: ''
  171. },
  172. {
  173. path: '/liveRoom',
  174. name: 'liveRoom',
  175. component: liveRoom,
  176. requireAuth: ''
  177. },
  178. {
  179. path: '/liveProjectDetail',
  180. name: 'liveProjectDetail',
  181. component: liveProjectDetail,
  182. requireAuth: ''
  183. },
  184. {
  185. path: '/audioDemo',
  186. name: 'audioDemo',
  187. component: audioDemo,
  188. requireAuth: ''
  189. },
  190. {
  191. path: '/cameraDemo',
  192. name: 'cameraDemo',
  193. component: cameraDemo,
  194. requireAuth: ''
  195. },
  196. {
  197. path: '/studyStudent',
  198. name: 'studyStudent',
  199. component: studyStudent,
  200. requireAuth: ''
  201. },{
  202. path: '/studyStudentGM',
  203. name: 'studyStudentGM',
  204. component: studyStudentGM,
  205. requireAuth: ''
  206. },{
  207. path: '/pdf',
  208. name: 'pdf',
  209. component: pdf,
  210. requireAuth: ''
  211. },
  212. {
  213. path: '/studyStudentS',
  214. name: 'studyStudentS',
  215. component: studyStudentS,
  216. requireAuth: ''
  217. }, {
  218. path: '/courseDetailS',
  219. name: 'courseDetailS',
  220. component: courseDetailS,
  221. requireAuth: ''
  222. },
  223. {
  224. path: '/studyStudentNT',
  225. name: 'studyStudentNT',
  226. component: studyStudentNT,
  227. requireAuth: ''
  228. }, {
  229. path: '/courseDetailNT',
  230. name: 'courseDetailNT',
  231. component: courseDetailNT,
  232. requireAuth: ''
  233. },{
  234. path: '/studyStudentE',
  235. name: 'studyStudentE',
  236. component: studyStudentE,
  237. requireAuth: ''
  238. },{
  239. path: '/studyStudentE2',
  240. name: 'studyStudentE2',
  241. component: studyStudentE2,
  242. requireAuth: ''
  243. },{
  244. path: '/studyStudentE3',
  245. name: 'studyStudentE3',
  246. component: studyStudentE3,
  247. requireAuth: ''
  248. },{
  249. path: '/studySutdentClass',
  250. name: 'studySutdentClass',
  251. component: studySutdentClass,
  252. requireAuth: ''
  253. },{
  254. path: '/studioIndex',
  255. name: 'studioIndex',
  256. component: studioIndex,
  257. requireAuth: ''
  258. }, {
  259. path: '/courseDetailStudio',
  260. name: 'courseDetailStudio',
  261. component: courseDetailStudio,
  262. requireAuth: ''
  263. }, {
  264. path: '/studyStudentStudio',
  265. name: 'studyStudentStudio',
  266. component: studyStudentStudio,
  267. requireAuth: ''
  268. }, {
  269. path: '/courseDetailTrain',
  270. name: 'courseDetailTrain',
  271. component: courseDetailTrain,
  272. requireAuth: ''
  273. }, {
  274. path: '/studyStudentTrain',
  275. name: 'studyStudentTrain',
  276. component: studyStudentTrain,
  277. requireAuth: ''
  278. }, {
  279. path: '/studyStudentE2Train',
  280. name: 'studyStudentE2Train',
  281. component: studyStudentE2Train,
  282. requireAuth: ''
  283. }, {
  284. path: '/studyStudentE3Train',
  285. name: 'studyStudentE3Train',
  286. component: studyStudentE3Train,
  287. requireAuth: ''
  288. },{
  289. path: '/pptEasyClass',
  290. name: 'pptEasyClass',
  291. component: pptEasyClass,
  292. requireAuth: ''
  293. },{
  294. path: '/pptEasyClassPS',
  295. name: 'pptEasyClassPS',
  296. component: pptEasyClassPS,
  297. requireAuth: ''
  298. },
  299. {
  300. path: '/dataBoardStudent',
  301. name: 'dataBoardStudent',
  302. component: dataBoardStudent,
  303. requireAuth: ''
  304. },{
  305. path: '/dataBoardTeacher',
  306. name: 'dataBoardTeacher',
  307. component: dataBoardTeacher,
  308. requireAuth: ''
  309. }
  310. ]
  311. })