|
3198 | 3198 |
|
3199 | 3199 | const req = { |
3200 | 3200 | type: 0, // 登录方式,非必须 0-密码 1-验证码 |
| 3201 | + asDBAccount: ! isAdminOperation, // 直接 /execute 接口传 account, password |
3201 | 3202 | phone: this.account, |
3202 | 3203 | password: this.password, |
3203 | 3204 | version: 1, // 全局默认版本号,非必须 |
|
3267 | 3268 | // this.showUrl(isAdminOperation, '/login') |
3268 | 3269 |
|
3269 | 3270 | // vInput.value = JSON.stringify(req, null, ' ') |
3270 | | - this.type = REQUEST_TYPE_JSON |
3271 | | - this.showTestCase(false, this.isLocalShow) |
3272 | | - this.onChange(false) |
3273 | | - this.send(isAdminOperation, function (url, res, err) { |
| 3271 | + // this.type = REQUEST_TYPE_JSON |
| 3272 | + // this.showTestCase(false, this.isLocalShow) |
| 3273 | + // this.onChange(false) |
| 3274 | + this.request(isAdminOperation, REQUEST_TYPE_JSON, this.server + '/login', req, {},function (url, res, err) { |
3274 | 3275 | if (callback) { |
3275 | 3276 | callback(url, res, err) |
3276 | 3277 | return |
|
3401 | 3402 | } |
3402 | 3403 | else { |
3403 | 3404 | this.showUrl(isAdminOperation, '/logout') |
3404 | | - vInput.value = JSON.stringify(req, null, ' ') |
3405 | | - this.type = REQUEST_TYPE_JSON |
| 3405 | + // vInput.value = JSON.stringify(req, null, ' ') |
| 3406 | + // this.type = REQUEST_TYPE_JSON |
3406 | 3407 | this.showTestCase(false, this.isLocalShow) |
3407 | 3408 | this.onChange(false) |
3408 | | - this.send(isAdminOperation, callback) |
| 3409 | + this.request(isAdminOperation, REQUEST_TYPE_JSON, this.server + '/logout', req, {}, callback) |
3409 | 3410 | } |
3410 | 3411 | }, |
3411 | 3412 |
|
|
3867 | 3868 | header['Apijson-Delegate-Id'] = this.delegateId |
3868 | 3869 | } |
3869 | 3870 |
|
| 3871 | + var curUser = isAdminOperation ? null : this.getCurrentAccount() |
| 3872 | + if (curUser != null) { |
| 3873 | + if (req == null) { |
| 3874 | + req = {} |
| 3875 | + } |
| 3876 | + if (req.account == null) { |
| 3877 | + req.account = curUser.phone |
| 3878 | + } |
| 3879 | + if (req.password == null) { |
| 3880 | + req.password = curUser.password |
| 3881 | + } |
| 3882 | + } |
| 3883 | + |
3870 | 3884 | // axios.defaults.withcredentials = true |
3871 | 3885 | axios({ |
3872 | 3886 | method: (type == REQUEST_TYPE_PARAM ? 'get' : 'post'), |
|
0 commit comments