Browse Source

clever登录

natasha 8 months ago
parent
commit
5941a70da9
1 changed files with 5 additions and 8 deletions
  1. 5 8
      src/views/login/index.vue

+ 5 - 8
src/views/login/index.vue

@@ -459,13 +459,9 @@ export default {
       this.browserRedirect();
     },
     // clever登录
-    getLoginClever() {
+    getLoginClever(code) {
       this.loading = true;
-      let MethodName = "login_control-Login_Clever";
-      let data = {
-        code: this.$route.query.code,
-      };
-      getLogin(MethodName, data)
+      getLogin("login_control-Login_Clever", { code })
         .then((res) => {
           this.loading = false;
           if (res.status == -5) {
@@ -557,8 +553,9 @@ export default {
       ],
     });
     this.isData = true;
-    if (this.$route.query.code) {
-      this.getLoginClever();
+    const code = window.location.search.split("?")[1]?.split("=")[1]; // 获取识别码
+    if (code) {
+      this.getLoginClever(code);
     }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)