MCPcopy Create free account
hub / github.com/Bistutu/FluentRead / refreshMicrosoftTokenInBackground

Function refreshMicrosoftTokenInBackground

entrypoints/background.ts:41–53  ·  view source on GitHub ↗

* 在background脚本中刷新微软翻译令牌

()

Source from the content-addressed store, hash-verified

39 * 在background脚本中刷新微软翻译令牌
40 */
41async function refreshMicrosoftTokenInBackground(): Promise<string> {
42 try {
43 const response = await fetch("https://edge.microsoft.com/translate/auth");
44 if (response.ok) {
45 return await response.text();
46 } else {
47 throw new Error(`获取微软翻译令牌失败: ${response.status} ${response.statusText}`);
48 }
49 } catch (error) {
50 console.error('获取微软翻译令牌失败:', error);
51 throw error;
52 }
53}
54
55export default defineBackground({
56 persistent: {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected