Annie 3 тижнів тому
батько
коміт
a88734b3c4

+ 1 - 5
src/views/dashboard/DailyOutput.vue

@@ -43,11 +43,7 @@ export default {
 
   methods: {
     goHome() {
-      if (process.env.NODE_ENV === 'production') {
-        this.$router.push({ path: '/admin/index' });
-      } else {
-        this.$router.push({ path: '/' });
-      }
+      this.$router.push({ name: 'Index' });
     },
 
     /** 初始化图表 */

+ 1 - 5
src/views/dashboard/DailyPerOutput.vue

@@ -57,11 +57,7 @@
   //s
   methods: {
     goHome() {
-      if (process.env.NODE_ENV === 'production') {
-        this.$router.push({ path: '/admin/index' });
-      } else {
-        this.$router.push({ path: '/' });
-      }
+      this.$router.push({ name: 'Index' });
     },
     async initChart() {
       try {

+ 1 - 5
src/views/dashboard/MonthTotal.vue

@@ -70,11 +70,7 @@ export default {
   },
   methods: {
     goHome() {
-      if (process.env.NODE_ENV === 'production') {
-        this.$router.push({ path: '/admin/index' });
-      } else {
-        this.$router.push({ path: '/' });
-      }
+      this.$router.push({ name: 'Index' });
     },
     timeFormate(timeStamp) { //显示当前时间
         let newDate = new Date(timeStamp);

+ 1 - 5
src/views/dashboard/PassRate.vue

@@ -46,11 +46,7 @@ mounted() {
 },
 methods: {
     goHome() {
-      if (process.env.NODE_ENV === 'production') {
-        this.$router.push({ path: '/admin/index' });
-      } else {
-        this.$router.push({ path: '/' });
-      }
+      this.$router.push({ name: 'Index' });
     },
     /** 初始化图表 */
     async initChart() {

+ 1 - 5
src/views/dashboard/Product.vue

@@ -50,11 +50,7 @@ export default {
   },
   methods: {
     goHome() {
-      if (process.env.NODE_ENV === 'production') {
-        this.$router.push({ path: '/admin/index' });
-      } else {
-        this.$router.push({ path: '/' });
-      }
+      this.$router.push({ name: 'Index' });
     },
     timeFormate(timeStamp) { //显示当前时间
       let newDate = new Date(timeStamp);