wuhongyu 5 vuotta sitten
vanhempi
commit
2320c03b47
4 muutettua tiedostoa jossa 63 lisäystä ja 2 poistoa
  1. 1 1
      src/layout/live/head.vue
  2. 5 0
      src/router/index.js
  3. 1 1
      src/views/login.vue
  4. 56 0
      src/views/newlogin.vue

+ 1 - 1
src/layout/live/head.vue

@@ -95,7 +95,7 @@ export default {
       else return this.$route.path.includes(`/${type}`);
     },
     btnLogin() {
-      this.$router.push({ path: '/login' });
+      this.$router.push({ path: '/newlogin' });
     },
     stnmae() {
       if (this.user.role == '2' || this.user.role == '3') {

+ 5 - 0
src/router/index.js

@@ -13,6 +13,11 @@ const live = [
         meta: { title: '登陆' },
         component: () => import('../views/login.vue'),
       },
+      {
+        path: '/newlogin',
+        meta: { title: '登陆' },
+        component: () => import('../views/newlogin.vue'),
+      },
       {
         path: '/live/detail',
         meta: { title: '信息详情', subSite: true },

+ 1 - 1
src/views/login.vue

@@ -30,7 +30,7 @@ export default {
       if (res.uid) {
         if (res.role == '2' || res.role == '3') this.$router.push('/market/marketfabu');
         else if (res.role == '5') this.$router.push('/hallList/index');
-        else this.$router.push('/market/index');
+        else history.back();
       }
     },
     async submitRegister(forms) {

+ 56 - 0
src/views/newlogin.vue

@@ -0,0 +1,56 @@
+<template>
+  <div id="login">
+    <login-detail :info="info" :form="form" @submitDate="submitnewLogin" :forms="forms" @submitDates="submitRegisters"></login-detail>
+  </div>
+</template>
+
+<script>
+import loginDetail from '@/layout/login.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapMarket } = createNamespacedHelpers('market');
+const { mapActions: login } = createNamespacedHelpers('login');
+export default {
+  name: 'login',
+  props: {},
+  components: { loginDetail },
+  data: () => {
+    return {
+      info: {},
+      form: {},
+      forms: {},
+    };
+  },
+  created() {},
+  methods: {
+    // ...mapSite(['showInfo', 'toGetUser']),
+    ...mapMarket({ userFetch: 'fetch', userCreate: 'create', userUpdate: 'update' }),
+    ...login({ toLogin: 'login' }),
+    async submitnewLogin(form) {
+      let res = await this.toLogin({ user: form });
+      if (res.uid) {
+        history.back();
+      }
+    },
+    async submitRegisters(forms) {
+      let data = this.forms;
+      let res = await this.userCreate(data);
+      let msg = `注册成功`;
+      this.$checkRes(res, msg);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+    redirect_uri() {
+      return `${this.$route.query.redirect_uri}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>