Bladeren bron

短地址接口更换

laiguoran 5 jaren geleden
bovenliggende
commit
4c9fb833b3
1 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 4 3
      app/extend/helper.js

+ 4 - 3
app/extend/helper.js

@@ -965,13 +965,14 @@ module.exports = {
      * @returns {*}
      */
     async urlToShort(url) {
-        const apiUrl = 'https://api.uomg.com/api/long2dwz';
+        const apiUrl = 'http://mrw.so/api.htm';
         const data = {
-            dwzapi: 'mrwso',
+            format: 'json',
             url,
+            key: '5eccdd0144bb353b1cd45c31@0b0510deaba52dad36dc64dbecec5e54',
         };
         const result = await this.sendRequest(apiUrl, data, 'get');
-        return result && result.code && result.code === 1 ? result.ae_url : url;
+        return result && result.err === '' && result.url ? result.url : url;
     },
 
     /**