puge 5 anni fa
parent
commit
ea9b9d03db
3 ha cambiato i file con 3 aggiunte e 4 eliminazioni
  1. 0 1
      background.js
  2. 2 2
      js/options.js
  3. 1 1
      manifest.json

+ 0 - 1
background.js

@@ -31,7 +31,6 @@ if (username && password) {
     })
   }).then((response) => {return response.json();}).then((res) => {
     if (res.err === 0) {
-      alert(res.data)
       userInfo = res.data
     }
   })

+ 2 - 2
js/options.js

@@ -27,13 +27,13 @@ document.getElementsByClassName('login-button')[0].onclick = function () {
   }).then((response) => {return response.json();}).then((res) => {
     if (res.err === 0) {
       bg.userInfo = res.data
-      bg.saveUser(username, password)
+      if (bg) bg.saveUser(username, password)
       location.reload();
     }
   })
 }
 
-if (bg.userInfo) {
+if (bg && bg.userInfo) {
   document.querySelector('.login-box').style.display = 'none'
   let newHtml = `<table border="0"><thead><tr><th>编号</th><th>脚本名称</th><th>开启状态</th></tr></thead><tbody>`
   fetch('https://going.run/assist?route=getList').then((response) => {return response.json();}).then((res) => {

+ 1 - 1
manifest.json

@@ -1,7 +1,7 @@
 {
 	"manifest_version": 2,
 	"name": "脚本助手",
-	"version": "1.1.0",
+	"version": "1.1.1",
 	"description": "脚本助手",
 	"icons": {
 		"16": "./img/16.png",