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

Method getCode

xiaosatonglu.js:82–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81 }
82 async getCode() {
83 try {
84 let options = {
85 fn: "获取登录code",
86 method: "post",
87 url: `https://passport.tmuyun.com/web/oauth/credential_auth`,
88 headers: {
89 'Host': 'passport.tmuyun.com',
90 'Content-Type': 'application/x-www-form-urlencoded',
91 'Accept-Encoding': 'gzip, deflate, br'
92 },
93 body: `client_id=10017&password=${encodeURIComponent(this.rsa_encrypt(this.password))}&phone_number=${this.mobile}`
94 };
95 let { body: result } = await httpRequest(options);
96 //console.log(options);
97 result = JSON.parse(result);
98 //console.log(result);
99 if (result.code == 0) {
100 //console.log(result.data.authorization_code.code)
101 this.code = result.data.authorization_code.code
102 } else {
103
104 }
105 } catch (e) {
106 console.log(e);
107 }
108 }
109 async login() {
110 try {
111 let host_data = `/api/zbtxz/login`

Callers 1

mainMethod · 0.95

Calls 3

rsa_encryptMethod · 0.95
httpRequestFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected