Commit e6152cb2f64c494869ecd6e0ad81f9cd5edf58ac
1 parent
3eb382a7
feat: use new api & fix dead textToAudio api #1
Showing
3 changed files
with
11 additions
and
47 deletions
app.js
... | ... | @@ -53,7 +53,7 @@ App({ |
53 | 53 | wx.login({ |
54 | 54 | success: res => { |
55 | 55 | wx.request({ |
56 | - url: `${this.globalData.domain}/open-api/login`, | |
56 | + url: `${this.globalData.domain}/open-api/mp/login`, | |
57 | 57 | data: { |
58 | 58 | code: res.code, |
59 | 59 | appid: 'wx330e54aa6000516d' |
... | ... | @@ -92,50 +92,14 @@ App({ |
92 | 92 | }); |
93 | 93 | }, |
94 | 94 | globalData: { |
95 | - // domain: 'http://localhost:3001', | |
96 | - domain: 'https://jilegeji.xwenliang.cn', | |
95 | + // domain: 'http://localhost:3003', | |
96 | + domain: 'https://api.xwenliang.cn', | |
97 | 97 | getTypeList(){ |
98 | 98 | return [ |
99 | 99 | { |
100 | - desc: '男声一', | |
101 | - createUrl(text){ | |
102 | - return `https://fanyi.sogou.com/reventondc/synthesis?text=${text}&speed=1&lang=zh-CHS&from=translateweb&speaker=1` | |
103 | - } | |
104 | - }, | |
105 | - { | |
106 | - desc: '男声二', | |
107 | - createUrl(text){ | |
108 | - return `https://fanyi.sogou.com/reventondc/synthesis?text=${text}&speed=1&lang=zh-CHS&from=translateweb&speaker=4` | |
109 | - } | |
110 | - }, | |
111 | - { | |
112 | 100 | desc: '女声一', |
113 | 101 | createUrl(text){ |
114 | - return `https://fanyi.sogou.com/reventondc/synthesis?text=${text}&speed=1&lang=zh-CHS&from=translateweb&speaker=2` | |
115 | - } | |
116 | - }, | |
117 | - { | |
118 | - desc: '女声二', | |
119 | - createUrl(text){ | |
120 | - return `https://fanyi.sogou.com/reventondc/synthesis?text=${text}&speed=1&lang=zh-CHS&from=translateweb&speaker=3` | |
121 | - } | |
122 | - }, | |
123 | - { | |
124 | - desc: '女声三', | |
125 | - createUrl(text){ | |
126 | - return `https://fanyi.sogou.com/reventondc/synthesis?text=${text}&speed=1&lang=zh-CHS&from=translateweb&speaker=5` | |
127 | - } | |
128 | - }, | |
129 | - { | |
130 | - desc: '女声四', | |
131 | - createUrl(text){ | |
132 | - return `https://fanyi.sogou.com/reventondc/synthesis?text=${text}&speed=1&lang=zh-CHS&from=translateweb&speaker=6` | |
133 | - } | |
134 | - }, | |
135 | - { | |
136 | - desc: '女声五', | |
137 | - createUrl(text){ | |
138 | - return `https://tts.youdao.com/fanyivoice?word=${text}&le=zh&keyfrom=speaker-target` | |
102 | + return `https://api.oick.cn/txt/apiz.php?text=${text}&spd=10`; | |
139 | 103 | } |
140 | 104 | } |
141 | 105 | ]; | ... | ... |
pages/index/index.js
... | ... | @@ -58,7 +58,7 @@ Page({ |
58 | 58 | }); |
59 | 59 | const result = await new Promise((resolve, reject) => { |
60 | 60 | app.request({ |
61 | - url: `${app.globalData.domain}/open-api/wechat-msg-sec-check`, | |
61 | + url: `${app.globalData.domain}/open-api/mp/msg-sec-check`, | |
62 | 62 | data: { |
63 | 63 | appid: 'wx330e54aa6000516d', |
64 | 64 | content: text, | ... | ... |
project.config.json
1 | 1 | { |
2 | 2 | "description": "项目配置文件。", |
3 | 3 | "setting": { |
4 | - "urlCheck": false, | |
4 | + "urlCheck": true, | |
5 | 5 | "es6": true, |
6 | 6 | "enhance": true, |
7 | 7 | "postcss": true, |
... | ... | @@ -27,7 +27,6 @@ |
27 | 27 | "disablePlugins": [], |
28 | 28 | "outputPath": "" |
29 | 29 | }, |
30 | - "enableEngineNative": false, | |
31 | 30 | "useIsolateContext": false, |
32 | 31 | "userConfirmedBundleSwitch": false, |
33 | 32 | "packNpmManually": false, |
... | ... | @@ -36,13 +35,13 @@ |
36 | 35 | "disableUseStrict": false, |
37 | 36 | "minifyWXML": true, |
38 | 37 | "showES6CompileOption": false, |
39 | - "useCompilerPlugins": false | |
38 | + "useCompilerPlugins": false, | |
39 | + "ignoreUploadUnusedFiles": true | |
40 | 40 | }, |
41 | 41 | "compileType": "miniprogram", |
42 | 42 | "libVersion": "2.21.3", |
43 | 43 | "appid": "wx330e54aa6000516d", |
44 | - "projectname": "%E8%AF%AD%E9%9F%B3%E5%8A%A9%E6%89%8B", | |
45 | - "condition": {}, | |
44 | + "projectname": "text-to-audio", | |
46 | 45 | "packOptions": { |
47 | 46 | "ignore": [], |
48 | 47 | "include": [] |
... | ... | @@ -50,5 +49,6 @@ |
50 | 49 | "editorSetting": { |
51 | 50 | "tabIndent": "insertSpaces", |
52 | 51 | "tabSize": 2 |
53 | - } | |
52 | + }, | |
53 | + "condition": {} | |
54 | 54 | } |
55 | 55 | \ No newline at end of file | ... | ... |