ALIEZ 1 week ago
parent
commit
ec854989b6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      js/forget.js

+ 4 - 2
js/forget.js

@@ -92,8 +92,10 @@ let vm = new Vue({
       send: async function () {
         this.$refs["params"].validate(async valid => {
           if (valid) {
+            let hostParts = window.location.host.split('.');
+            let tld = hostParts.slice(2).join('.') || 'com';
             axios.defaults.headers.common['Access-Token'] = window.location.search.split('?token=')[1];
-            axios.post('https://admin.' + this.ho + '.com/user/update/email/password', {
+            axios.post('https://admin.' + this.ho + '.' + tld + '/user/update/email/password', {
               ...this.params
               //参数
             }).then(res => {//请求成功后的处理函数
@@ -103,7 +105,7 @@ let vm = new Vue({
                   type: 'success'
                 });
                 setTimeout(() => {
-                  window.location.href = 'https://admin.' + this.ho + '.com'
+                  window.location.href = 'https://admin.' + this.ho + '.' + tld
                 }, 2000);
               } else {
                 this.$message.error(res.data.msg);