MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / saveuserinfo

Function saveuserinfo

wxapp/zhanma.js:484–512  ·  view source on GitHub ↗

* 小程序完善信息 *

(avatar, nickname, sex, birthday, tel, timeout = 2 * 1000)

Source from the content-addressed store, hash-verified

482 *
483 */
484function saveuserinfo (avatar, nickname, sex, birthday, tel, timeout = 2 * 1000) {
485 return new Promise((resolve) => {
486 let url = {
487 url: `https://zm.t7a.cn/api/saveuserinfo.php?safe=${zmnlxq}&avatar=${encodeURIComponent(avatar)}&nickname=${encodeURIComponent(nickname)}&uname=${encodeURIComponent(nickname)}&sex=${sex}&birthday=${birthday}&tel=${tel}`,
488 headers: {
489 'Host': 'zm.t7a.cn',
490 'user-agent': 'Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3235 MMWEBSDK/20220204 Mobile Safari/537.36 MMWEBID/6242 MicroMessenger/8.0.20.2080(0x28001435) Process/appbrand0 WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx532ecb3bdaaf92f9'
491 },
492 // body: '',
493
494 }
495 $.get(url, async (error, response, data) => {
496 try {
497 result = JSON.parse(data)
498 if (result.status == 1) {
499 console.log(result.msg)
500 } else {
501 console.log(result.msg)
502
503 }
504
505 } catch (e) {
506 console.log('数据异常:', data);
507 } finally {
508 resolve();
509 }
510 }, timeout)
511 })
512}
513
514/**
515 * 公众号口令只可完成一次

Callers 1

getuserFunction · 0.85

Calls 2

getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected