Browse Source

替换https

Pchen. 1 year ago
parent
commit
b38e6defe5
2 changed files with 11 additions and 11 deletions
  1. 9 9
      lib/IC/IC.js
  2. 2 2
      plugin/Browser/IcCookie.js

+ 9 - 9
lib/IC/IC.js

@@ -69,7 +69,7 @@ class IC {
             const { beginDate, endDate, page, pageNum } = data
 
             try {
-                const url = `https://ic.ctbu.edu.cn/ic-web/reserve/resvInfo?beginDate=${beginDate}&endDate=${endDate}&needStatus=150&page=${page}&pageNum=${pageNum}&orderKey=gmt_create&orderModel=desc`
+                const url = `http://ic.ctbu.edu.cn/ic-web/reserve/resvInfo?beginDate=${beginDate}&endDate=${endDate}&needStatus=150&page=${page}&pageNum=${pageNum}&orderKey=gmt_create&orderModel=desc`
                 const res = await axios.get(url, {
                     headers: {
                         'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
@@ -105,7 +105,7 @@ class IC {
                 const captcha = await this.getCaptcha(cookie)
                 data = { ...data, captcha, resvMember: [accNo], appAccNo: accNo, sysKind: 8, memberKind: 1, testName: '', resvProperty: 0, memo: '' }
 
-                const url = `https://ic.ctbu.edu.cn/ic-web/reserve`
+                const url = `http://ic.ctbu.edu.cn/ic-web/reserve`
 
                 const res = await axios.post(url, data, {
                     headers: {
@@ -138,7 +138,7 @@ class IC {
     async deleteSeat(cookie, uuid) {
         return new Promise(async (resolve, reject) => {
 
-            const url = 'https://ic.ctbu.edu.cn/ic-web/reserve/delete'
+            const url = 'http://ic.ctbu.edu.cn/ic-web/reserve/delete'
 
             try {
                 const res = await axios.post(url, { uuid }, {
@@ -166,7 +166,7 @@ class IC {
     async endAhead(cookie, uuid) {
         return new Promise(async (resolve, reject) => {
 
-            const url = 'https://ic.ctbu.edu.cn/ic-web/reserve/endAhaed'
+            const url = 'http://ic.ctbu.edu.cn/ic-web/reserve/endAhaed'
 
             try {
                 const res = await axios.post(url, { uuid }, {
@@ -194,7 +194,7 @@ class IC {
 
     async getCaptcha(cookie) {
         return new Promise(async (resolve, reject) => {
-            const url = `https://ic.ctbu.edu.cn/ic-web/captcha?id=${new Date().getTime()}`
+            const url = `http://ic.ctbu.edu.cn/ic-web/captcha?id=${new Date().getTime()}`
 
             try {
                 const res = await axios.get(url, {
@@ -226,7 +226,7 @@ class IC {
 
     async getUserInfo(cookie) {
         return new Promise(async (resolve, reject) => {
-            const url = 'https://ic.ctbu.edu.cn/ic-web/auth/userInfo';
+            const url = 'http://ic.ctbu.edu.cn/ic-web/auth/userInfo';
 
             try {
                 const res = await axios.get(url, {
@@ -253,7 +253,7 @@ class IC {
 
     async getSeatMenu(cookie) {
         return new Promise(async (resolve, reject) => {
-            const url = 'https://ic.ctbu.edu.cn/ic-web/seatMenu';
+            const url = 'http://ic.ctbu.edu.cn/ic-web/seatMenu';
 
             try {
                 const res = await axios.get(url, {
@@ -280,7 +280,7 @@ class IC {
 
     async getOpenScope(cookie, roomId) {
         return new Promise(async (resolve, reject) => {
-            const url = `https://ic.ctbu.edu.cn/ic-web/seatRoom/openScope?roomId=${roomId}`;
+            const url = `http://ic.ctbu.edu.cn/ic-web/seatRoom/openScope?roomId=${roomId}`;
 
             try {
                 const res = await axios.get(url, {
@@ -304,7 +304,7 @@ class IC {
 
     async getSeatInfo(cookie, roomId, date) {
         return new Promise(async (resolve, reject) => {
-            const url = `https://ic.ctbu.edu.cn/ic-web/reserve?roomIds=${roomId}&resvDates=${date}&sysKind=8`;
+            const url = `http://ic.ctbu.edu.cn/ic-web/reserve?roomIds=${roomId}&resvDates=${date}&sysKind=8`;
 
             try {
                 const res = await axios.get(url, {

+ 2 - 2
plugin/Browser/IcCookie.js

@@ -10,7 +10,7 @@ class icCookie {
 
     async getLoginUrl() {
         return new Promise(async (resolve, reject) => {
-            const url1 = 'https://ic.ctbu.edu.cn/ic-web/auth/address?finalAddress=https:%2F%2Fic.ctbu.edu.cn&errPageUrl=https:%2F%2Fic.ctbu.edu.cn%2F%23%2Ferror&manager=false&consoleType=16';
+            const url1 = 'http://ic.ctbu.edu.cn/ic-web/auth/address?finalAddress=http:%2F%2Fic.ctbu.edu.cn&errPageUrl=http:%2F%2Fic.ctbu.edu.cn%2F%23%2Ferror&manager=false&consoleType=16';
 
             try {
                 const res1 = await axios.get(url1, {
@@ -173,7 +173,7 @@ class icCookie {
     async getCookie (page) {
         return new Promise((resolve, reject) => {
             page.on('response', async response => {
-                if (response.url().includes('https://ic.ctbu.edu.cn/ic-web//auth/token?uuid=')) {
+                if (response.url().includes('http://ic.ctbu.edu.cn/ic-web//auth/token?uuid=')) {
                     // 获取响应头中的 Set-Cookie
                     const cookies = response.headers()['set-cookie'];