删除对 chrome 版本的判断

This commit is contained in:
2025-02-19 19:14:17 +08:00
parent 96f51ebeff
commit 77b5acef0c
4 changed files with 171 additions and 126 deletions

View File

@@ -152,11 +152,11 @@ export function decode(bytes?: string) {
)
}
function getChromeVersion() {
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)
return raw ? parseInt(raw[2], 10) : 0
}
// function getChromeVersion() {
// var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)
// return raw ? parseInt(raw[2], 10) : 0
// }
export const isLowVersion = getChromeVersion() < 80
// export const isLowVersion = getChromeVersion() < 80
export const protocol = isLowVersion ? "http" : "https"
// export const protocol = isLowVersion ? "http" : "https"

View File

@@ -1,8 +1,8 @@
import axios from "axios"
import { decode, encode, protocol } from "./functions"
import { decode, encode } from "./functions"
import { Code } from "./types"
const http = axios.create({ baseURL: `${protocol}://judge0api.xuyue.cc` })
const http = axios.create({ baseURL: `https://judge0api.xuyue.cc` })
export async function createTestSubmission(code: Code, input: string) {
const encodedCode = encode(code.value)