-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add huoshan translate service #780
base: main
Are you sure you want to change the base?
Conversation
add huoshan translate service
fix: fix 443, add huoshan translate service
package.json
Outdated
@@ -35,6 +35,7 @@ | |||
"franc": "^6.1.0", | |||
"iso639-js": "^1.1.3", | |||
"jsencrypt": "^3.3.2", | |||
"volcengine-sdk": "^0.0.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volcengine-sdk is not actively maintained. Any reason to choose this package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在新的提交中,我按照volcengine-sdk中的方法使用crypto-js替代了volcengine-sdk
typings/global.d.ts
Outdated
@@ -12,6 +12,8 @@ declare const _globalThis: { | |||
addon: typeof addon; | |||
}; | |||
|
|||
declare module "volcengine-sdk"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果不增加这一句,会导致无法找到该模块
The encryption algorithm in volcengine-sdk is implemented using crypto-js
删除了volcengine-sdk依赖
整体ok,两个小建议/问题:
|
在之后我尝试使用crypto.ts重写 |
add crypto-js dependencies
在使用crypto.ts时,它的hmacSha256Digest返回的为一个Promise,而crypto-js中HmacSHA256返回的是一个object,我不知道要怎样解决,所以暂时在package.json添加了crypto-js依赖 |
Promise是JavaScript的原生对象,用于异步。可通过类似 |
add huoshan translate service