|
|
@@ -1,10 +1,19 @@
|
|
|
-import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
|
|
+import {
|
|
|
+ createRouter,
|
|
|
+ createWebHistory,
|
|
|
+ createWebHashHistory
|
|
|
+} from 'vue-router';
|
|
|
import store from '../store';
|
|
|
-import { Page } from './Page';
|
|
|
-import { Dialog } from 'vant';
|
|
|
+import {
|
|
|
+ Page
|
|
|
+} from './Page';
|
|
|
+import {
|
|
|
+ Dialog
|
|
|
+} from 'vant';
|
|
|
import http from '../plugins/http';
|
|
|
|
|
|
jsapiSign();
|
|
|
+
|
|
|
function jsapiSign() {
|
|
|
return;
|
|
|
// eslint-disable-next-line no-unreachable
|
|
|
@@ -15,7 +24,9 @@ function jsapiSign() {
|
|
|
}
|
|
|
let isIOS = /iphone|ipad/i.test(navigator.userAgent);
|
|
|
http.http
|
|
|
- .get('/wx/jsapiSign', { url: isIOS ? store.state.firstUrl : location.origin + location.href })
|
|
|
+ .get('/wx/jsapiSign', {
|
|
|
+ url: isIOS ? store.state.firstUrl : location.origin + location.href
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
wx.config({
|
|
|
debug: false,
|
|
|
@@ -40,14 +51,12 @@ function jsapiSign() {
|
|
|
title: '拉索宇宙',
|
|
|
desc: '全球首个基于区块链的游戏资产集换中心',
|
|
|
link: location.origin + '/9th',
|
|
|
- imgUrl:
|
|
|
- 'https://9space-2021.oss-cn-shenzhen.aliyuncs.com/nft/2021-11-05-15-58-30YwqLzMjy.jpg'
|
|
|
+ imgUrl: 'https://9space-2021.oss-cn-shenzhen.aliyuncs.com/nft/2021-11-05-15-58-30YwqLzMjy.jpg'
|
|
|
});
|
|
|
wx.updateTimelineShareData({
|
|
|
title: '拉索宇宙-全球首个基于区块链的游戏资产集换中心',
|
|
|
link: location.origin + '/9th',
|
|
|
- imgUrl:
|
|
|
- 'https://9space-2021.oss-cn-shenzhen.aliyuncs.com/nft/2021-11-05-15-58-30YwqLzMjy.jpg'
|
|
|
+ imgUrl: 'https://9space-2021.oss-cn-shenzhen.aliyuncs.com/nft/2021-11-05-15-58-30YwqLzMjy.jpg'
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
@@ -56,8 +65,7 @@ function jsapiSign() {
|
|
|
}, 200);
|
|
|
}
|
|
|
jsapiSign();
|
|
|
-const routes = [
|
|
|
- {
|
|
|
+const routes = [{
|
|
|
path: '/',
|
|
|
redirect: 'home'
|
|
|
},
|
|
|
@@ -65,8 +73,7 @@ const routes = [
|
|
|
path: '/',
|
|
|
name: 'index',
|
|
|
component: () => import('../views/Index.vue'),
|
|
|
- children: [
|
|
|
- {
|
|
|
+ children: [{
|
|
|
path: '/home',
|
|
|
name: 'home',
|
|
|
component: () => import('../views/Home.vue'),
|
|
|
@@ -102,7 +109,8 @@ const routes = [
|
|
|
component: () => import('../views/Store.vue'),
|
|
|
meta: {
|
|
|
menuPage: true,
|
|
|
- title: '拉索宇宙'
|
|
|
+ title: '拉索宇宙',
|
|
|
+ needBack: true
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -644,13 +652,14 @@ const routes = [
|
|
|
];
|
|
|
|
|
|
const router = createRouter({
|
|
|
- history:
|
|
|
- process.env.VUE_APP_CORDOVA === 'true'
|
|
|
- ? createWebHashHistory()
|
|
|
- : createWebHistory(process.env.VUE_APP_PUBLIC_PATH),
|
|
|
+ history: process.env.VUE_APP_CORDOVA === 'true' ?
|
|
|
+ createWebHashHistory() : createWebHistory(process.env.VUE_APP_PUBLIC_PATH),
|
|
|
routes,
|
|
|
scrollBehavior(to, from, savedPosition) {
|
|
|
- return { x: 0, y: 0 };
|
|
|
+ return {
|
|
|
+ x: 0,
|
|
|
+ y: 0
|
|
|
+ };
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -685,12 +694,13 @@ router.beforeEach((to, from, next) => {
|
|
|
})
|
|
|
.catch(() => {
|
|
|
Dialog.confirm({
|
|
|
- title: '提示',
|
|
|
- message: '用户未登录,是否立即登录'
|
|
|
- })
|
|
|
+ title: '提示',
|
|
|
+ message: '用户未登录,是否立即登录'
|
|
|
+ })
|
|
|
.then(() => {
|
|
|
let url = '/login';
|
|
|
if (to.meta.needBack) {
|
|
|
+ console.log(to)
|
|
|
store.commit('setLoginBackUrl', to.fullPath);
|
|
|
}
|
|
|
next('/login');
|
|
|
@@ -722,4 +732,4 @@ function backNext(to) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
-export default router;
|
|
|
+export default router;
|