logo

ScriptCat

  • Trang chủ
  • Cộng đồng
  • Danh sách script
  • Tiện ích mở rộng
  1. /
  2. Chợ script
  3. /
  4. 微软积分商城签到
Script đã lưu trữ
Script này đã được tác giả lưu trữ. Script có thể không còn hoạt động và tác giả không còn bảo trì, nên bạn không thể gửi phản hồi nữa.
  • Trang chính
  • Mã nguồn
  • Phản hồi
    36
  • Đánh giá
  • Danh sách phiên bản
ScriptCat
GitHub
Nhật ký kiểm tra
Thỏa thuận dịch vụ
Chính sách bảo mật
Tuyên bố miễn trừ

© 2022-nay ScriptCat. Bảo lưu mọi quyền.

每次运行在初始化运行完成!用时 0.328 秒🔚后就不会继续执行了
Chờ xử lý#1491jhrccCreated at 10 tháng trước

Đang tải…
  • jhrcc10 tháng trước

    Đang tải…
  • 乐未殇9 tháng trước

    Đang tải…
  • wj898919 tháng trước

    Đang tải…
  • welldo7 tháng trước

    Đang tải…
  • BlindaNyida7 tháng trước

    Đang tải…
No data
Đăng nhập để bình luận
Nhãn
Theo dõi
Người tham gia

如题,每次定时任务之后就不进行后续的操作了,无法进行定时任务的签到

修改一下xhr的封装 修改为如下就可以正常使用了 xhr(options, only = false) { const self = this const DEBUG = true

const log = (...args) => {
    if (DEBUG) console.log('[XHR]', ...args)
}

return new Promise((resolve, reject) => {
    const start = self.getTimestamp()


    try {
        GM_xmlhttpRequest({
            ...options,
            timeout: 15000,

            ontimeout: () => {
                const cost = (self.getTimestamp() - start) / 1000
                reject(new Error(`请求超时!用时 ${cost} 秒`))
            },

            onload: (xhr) => {
                const cost = (self.getTimestamp() - start) / 1000

                if (xhr.status === 200) {
                    resolve(only ? xhr.finalUrl : xhr.responseText)
                    return
                }

                const redirectStatuses = [301, 302, 307, 308]
                if (redirectStatuses.includes(xhr.status)) {
                    const match = xhr.responseHeaders?.match(/Location:\s*(.*?)\s*\r?\n/i)
                    resolve(match ? match[1] : false)
                    return
                }

                reject(new Error(`请求失败,用时 ${cost} 秒,状态码:${xhr.status}`))
            },

            onerror: (err) => {
                const cost = (self.getTimestamp() - start) / 1000
                reject(new Error(`请求发生异常!用时 ${cost} 秒`))
            },
        })
    } catch (e) {
        // 只能捕获 GM_xmlhttpRequest 同步异常
        reject(e)
    }
}
)

}

感谢!有效,版本是3.6.10

作者已经 不继续更新了 ,大家有新的可用的吗

修改一下xhr的封装 修改为如下就可以正常使用了 xhr(options, only = false) { const self = this const DEBUG = true

const log = (...args) => {
    if (DEBUG) console.log('[XHR]', ...args)
}

return new Promise((resolve, reject) => {
    const start = self.getTimestamp()


    try {
        GM_xmlhttpRequest({
            ...options,
            timeout: 15000,

            ontimeout: () => {
                const cost = (self.getTimestamp() - start) / 1000
                reject(new Error(`请求超时!用时 ${cost} 秒`))
            },

            onload: (xhr) => {
                const cost = (self.getTimestamp() - start) / 1000

                if (xhr.status === 200) {
                    resolve(only ? xhr.finalUrl : xhr.responseText)
                    return
                }

                const redirectStatuses = [301, 302, 307, 308]
                if (redirectStatuses.includes(xhr.status)) {
                    const match = xhr.responseHeaders?.match(/Location:\s*(.*?)\s*\r?\n/i)
                    resolve(match ? match[1] : false)
                    return
                }

                reject(new Error(`请求失败,用时 ${cost} 秒,状态码:${xhr.status}`))
            },

            onerror: (err) => {
                const cost = (self.getTimestamp() - start) / 1000
                reject(new Error(`请求发生异常!用时 ${cost} 秒`))
            },
        })
    } catch (e) {
        // 只能捕获 GM_xmlhttpRequest 同步异常
        reject(e)
    }
}
)

}

2026-03-24 11:26:53 🟡Request Verification Token 获取失败!🔛<script

这个什么原因。。大佬

修改一下xhr的封装 修改为如下就可以正常使用了 xhr(options, only = false) { const self = this const DEBUG = true

const log = (...args) => {
    if (DEBUG) console.log('[XHR]', ...args)
}

return new Promise((resolve, reject) => {
    const start = self.getTimestamp()


    try {
        GM_xmlhttpRequest({
            ...options,
            timeout: 15000,

            ontimeout: () => {
                const cost = (self.getTimestamp() - start) / 1000
                reject(new Error(`请求超时!用时 ${cost} 秒`))
            },

            onload: (xhr) => {
                const cost = (self.getTimestamp() - start) / 1000

                if (xhr.status === 200) {
                    resolve(only ? xhr.finalUrl : xhr.responseText)
                    return
                }

                const redirectStatuses = [301, 302, 307, 308]
                if (redirectStatuses.includes(xhr.status)) {
                    const match = xhr.responseHeaders?.match(/Location:\s*(.*?)\s*\r?\n/i)
                    resolve(match ? match[1] : false)
                    return
                }

                reject(new Error(`请求失败,用时 ${cost} 秒,状态码:${xhr.status}`))
            },

            onerror: (err) => {
                const cost = (self.getTimestamp() - start) / 1000
                reject(new Error(`请求发生异常!用时 ${cost} 秒`))
            },
        })
    } catch (e) {
        // 只能捕获 GM_xmlhttpRequest 同步异常
        reject(e)
    }
}
)

}

专门注册个账号感谢大佬