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