瀏覽代碼

logout after update your password or secret token

MHSanaei 1 年之前
父節點
當前提交
6a33a48a9a
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      web/html/xui/setting.html

+ 9 - 7
web/html/xui/setting.html

@@ -323,6 +323,7 @@
                     this.loading(false);
                     this.loading(false);
                     if (msg.success) {
                     if (msg.success) {
                         this.user = {};
                         this.user = {};
+                        window.location.replace("/logout")
                     }
                     }
                 },
                 },
                 async restartPanel() {
                 async restartPanel() {
@@ -350,17 +351,18 @@
                     this.user = user_msg.obj;
                     this.user = user_msg.obj;
                 }
                 }
                 this.loading(false);
                 this.loading(false);
-            },
-            async updateSecret(){
+                },
+                async updateSecret(){
                 this.loading(true);
                 this.loading(true);
                 const msg = await HttpUtil.post("/xui/setting/updateUserSecret", this.user);
                 const msg = await HttpUtil.post("/xui/setting/updateUserSecret", this.user);
                 if (msg.success){
                 if (msg.success){
                     this.user = msg.obj;
                     this.user = msg.obj;
+                    window.location.replace("/logout")
                 }
                 }
                 this.loading(false);
                 this.loading(false);
                 await this.updateAllSetting();
                 await this.updateAllSetting();
-            },
-            async getNewSecret(){
+                },
+                async getNewSecret(){
                 this.loading(true);
                 this.loading(true);
                 await PromiseUtil.sleep(1000);
                 await PromiseUtil.sleep(1000);
                 var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
                 var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
@@ -372,13 +374,13 @@
                 this.user.loginSecret = string;
                 this.user.loginSecret = string;
                 document.getElementById('token').value =this.user.loginSecret; 
                 document.getElementById('token').value =this.user.loginSecret; 
                 this.loading(false);
                 this.loading(false);
-            },
-            async toggleToken(value){
+                },
+                async toggleToken(value){
                 if(value)
                 if(value)
                   this.getNewSecret();
                   this.getNewSecret();
                 else 
                 else 
                   this.user.loginSecret = "";
                   this.user.loginSecret = "";
-            },
+                },
                 async resetXrayConfigToDefault() {
                 async resetXrayConfigToDefault() {
                     this.loading(true);
                     this.loading(true);
                     const msg = await HttpUtil.get("/xui/setting/getDefaultJsonConfig");
                     const msg = await HttpUtil.get("/xui/setting/getDefaultJsonConfig");