|
@ -27,7 +27,7 @@ module.exports = function (app, opts) { |
|
|
appSecret: secret |
|
|
appSecret: secret |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (tokenRes.code == 200) { |
|
|
if (tokenRes.code == 200 && tokenRes.data) { |
|
|
const { accessToken, expireTime } = tokenRes.data |
|
|
const { accessToken, expireTime } = tokenRes.data |
|
|
await models.SecretYingshi.update({ |
|
|
await models.SecretYingshi.update({ |
|
|
token: accessToken, |
|
|
token: accessToken, |
|
@ -39,7 +39,11 @@ module.exports = function (app, opts) { |
|
|
}) |
|
|
}) |
|
|
return accessToken |
|
|
return accessToken |
|
|
} else { |
|
|
} else { |
|
|
throw tokenRes |
|
|
throw { |
|
|
|
|
|
msg: '未能获取萤石token', |
|
|
|
|
|
key, secret, |
|
|
|
|
|
tokenRes |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|