Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/utils/aidFn.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const getImgsUrl = (html) => {
export const customizeTimer = {
intervalTimer: null,
timeoutTimer: null,
setTimeout(cb, interval) {
setTimeout (cb, interval) {
const { now } = Date
const stime = now()
let etime = stime
Expand All @@ -78,10 +78,10 @@ export const customizeTimer = {
this.timeoutTimer = requestAnimationFrame(loop)
return this.timeoutTimer
},
clearTimeout() {
clearTimeout () {
cancelAnimationFrame(this.timeoutTimer)
},
setInterval(cb, interval) {
setInterval (cb, interval) {
const { now } = Date
let stime = now()
let etime = stime
Expand All @@ -97,9 +97,9 @@ export const customizeTimer = {
this.intervalTimer = requestAnimationFrame(loop)
return this.intervalTimer
},
clearInterval() {
clearInterval () {
cancelAnimationFrame(this.intervalTimer)
},
}
}

export const isDecimal = (value) => {
Expand Down Expand Up @@ -188,7 +188,7 @@ export const formatRomanNumeral = (num) => {
{ value: 9, numeral: 'IX' },
{ value: 5, numeral: 'V' },
{ value: 4, numeral: 'IV' },
{ value: 1, numeral: 'I' },
{ value: 1, numeral: 'I' }
]
let result = ''
for (const { value, numeral } of romanMap) {
Expand Down Expand Up @@ -336,13 +336,13 @@ export const oneApiChat = (chatList, token, signal) =>
signal,
headers: {
Authorization: token,
'Content-Type': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gpt-3.5-turbo',
messages: chatList,
stream: true,
}),
stream: true
})
})

export const getCurrentDate = () => {
Expand Down Expand Up @@ -370,7 +370,7 @@ export const saveHtmlToPng = async (eleHtml, successFun, errorFun) => {
try {
const ele = eleHtml ?? document.getElementById('image-wrapper')
const canvas = await html2canvas(ele, {
useCORS: true,
useCORS: true
})
const imgUrl = canvas.toDataURL('image/png')
const tempLink = document.createElement('a')
Expand Down
Loading