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,7 +53,7 @@ App({ | ||
| 53 | wx.login({ | 53 | wx.login({ |
| 54 | success: res => { | 54 | success: res => { |
| 55 | wx.request({ | 55 | wx.request({ |
| 56 | - url: `${this.globalData.domain}/open-api/login`, | 56 | + url: `${this.globalData.domain}/open-api/mp/login`, |
| 57 | data: { | 57 | data: { |
| 58 | code: res.code, | 58 | code: res.code, |
| 59 | appid: 'wx330e54aa6000516d' | 59 | appid: 'wx330e54aa6000516d' |
| @@ -92,50 +92,14 @@ App({ | @@ -92,50 +92,14 @@ App({ | ||
| 92 | }); | 92 | }); |
| 93 | }, | 93 | }, |
| 94 | globalData: { | 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 | getTypeList(){ | 97 | getTypeList(){ |
| 98 | return [ | 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 | desc: '女声一', | 100 | desc: '女声一', |
| 113 | createUrl(text){ | 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,7 +58,7 @@ Page({ | ||
| 58 | }); | 58 | }); |
| 59 | const result = await new Promise((resolve, reject) => { | 59 | const result = await new Promise((resolve, reject) => { |
| 60 | app.request({ | 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 | data: { | 62 | data: { |
| 63 | appid: 'wx330e54aa6000516d', | 63 | appid: 'wx330e54aa6000516d', |
| 64 | content: text, | 64 | content: text, |
project.config.json
| 1 | { | 1 | { |
| 2 | "description": "项目配置文件。", | 2 | "description": "项目配置文件。", |
| 3 | "setting": { | 3 | "setting": { |
| 4 | - "urlCheck": false, | 4 | + "urlCheck": true, |
| 5 | "es6": true, | 5 | "es6": true, |
| 6 | "enhance": true, | 6 | "enhance": true, |
| 7 | "postcss": true, | 7 | "postcss": true, |
| @@ -27,7 +27,6 @@ | @@ -27,7 +27,6 @@ | ||
| 27 | "disablePlugins": [], | 27 | "disablePlugins": [], |
| 28 | "outputPath": "" | 28 | "outputPath": "" |
| 29 | }, | 29 | }, |
| 30 | - "enableEngineNative": false, | ||
| 31 | "useIsolateContext": false, | 30 | "useIsolateContext": false, |
| 32 | "userConfirmedBundleSwitch": false, | 31 | "userConfirmedBundleSwitch": false, |
| 33 | "packNpmManually": false, | 32 | "packNpmManually": false, |
| @@ -36,13 +35,13 @@ | @@ -36,13 +35,13 @@ | ||
| 36 | "disableUseStrict": false, | 35 | "disableUseStrict": false, |
| 37 | "minifyWXML": true, | 36 | "minifyWXML": true, |
| 38 | "showES6CompileOption": false, | 37 | "showES6CompileOption": false, |
| 39 | - "useCompilerPlugins": false | 38 | + "useCompilerPlugins": false, |
| 39 | + "ignoreUploadUnusedFiles": true | ||
| 40 | }, | 40 | }, |
| 41 | "compileType": "miniprogram", | 41 | "compileType": "miniprogram", |
| 42 | "libVersion": "2.21.3", | 42 | "libVersion": "2.21.3", |
| 43 | "appid": "wx330e54aa6000516d", | 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 | "packOptions": { | 45 | "packOptions": { |
| 47 | "ignore": [], | 46 | "ignore": [], |
| 48 | "include": [] | 47 | "include": [] |
| @@ -50,5 +49,6 @@ | @@ -50,5 +49,6 @@ | ||
| 50 | "editorSetting": { | 49 | "editorSetting": { |
| 51 | "tabIndent": "insertSpaces", | 50 | "tabIndent": "insertSpaces", |
| 52 | "tabSize": 2 | 51 | "tabSize": 2 |
| 53 | - } | 52 | + }, |
| 53 | + "condition": {} | ||
| 54 | } | 54 | } |
| 55 | \ No newline at end of file | 55 | \ No newline at end of file |