MCPcopy Create free account
hub / github.com/chavyleung/scripts / getquestion

Function getquestion

wps/wps.js:116–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115// 获取问题
116function getquestion() {
117 return new Promise((resove) => {
118 const url = { url: 'https://zt.wps.cn/2018/clock_in/api/get_question?award=wps', headers: { sid: $.sid } }
119 $.get(url, (error, response, data) => {
120 try {
121 if (error) throw new Error(error)
122 $.question = JSON.parse(data).data
123 } catch (e) {
124 $.log(`❗️ ${$.name}, 执行失败!`, ` error = ${error || e}`, `response = ${JSON.stringify(response)}`, `data = ${data}`, '')
125 } finally {
126 resove()
127 }
128 })
129 })
130}
131
132// 回答问题
133function answerquestion(optIdx) {

Callers 2

wps.jsFile · 0.85
answerwxFunction · 0.85

Calls 2

getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected