Selaa lähdekoodia

注册自动登录

natasha 1 vuosi sitten
vanhempi
commit
db2fd6ee3d
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      src/views/register.vue

+ 2 - 0
src/views/register.vue

@@ -106,6 +106,7 @@ import Upload from "@/components/Upload.vue"
 import { getLogin } from "@/api/ajax";
 import Cookies from 'js-cookie'
 import { mapState } from 'vuex';
+import { setToken } from "@/utils/auth";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { Header, Upload },
@@ -287,6 +288,7 @@ export default {
             getLogin(MethodName, data)
             .then((res) => {
                 if(res.status===1){
+                    setToken(res);
                     this.$message.success('注册成功!');
                     this.$router.push({ path: "/EnterSys" });
                 }