123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <div id="app">
- <router-view />
- </div>
- </template>
- <script>
- import { createNamespacedHelpers } from 'vuex';
- import _ from 'lodash';
- const { mapActions } = createNamespacedHelpers('login');
- export default {
- name: 'App',
- components: {},
- created() {
- this.toLogin();
- },
- methods: {
- ...mapActions(['login']),
- async toLogin() {
- let object = { mobile: '13089419811', passwd: '12345678' };
- let res = await this.login(object);
- if (_.isBoolean(res)) console.log('登陆成功');
- else this.$message.warning(res.errmsg);
- },
- },
- };
- </script>
- <style lang="less">
- html {
- overflow: hidden;
- body {
- margin: 0;
- padding: 0;
- }
- margin: 0;
- padding: 0;
- p {
- margin: 0;
- padding: 0;
- }
- }
- </style>
|