Skip to content

Commit

Permalink
feat: 增加壁纸
Browse files Browse the repository at this point in the history
  • Loading branch information
Honye committed Jul 24, 2023
1 parent b0c57ac commit e67a2fd
Show file tree
Hide file tree
Showing 21 changed files with 1,236 additions and 71 deletions.
6 changes: 6 additions & 0 deletions cloudfunctions/fetch/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"permissions": {
"openapi": [
]
}
}
16 changes: 16 additions & 0 deletions cloudfunctions/fetch/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const cloud = require('wx-server-sdk')
const fetch = require('node-fetch')

cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV })

exports.main = async (event, context) => {
const { url, ...options } = event
return fetch(url, options)
.then((resp) => {
const data = resp.json()
if (resp.ok) {
return data
}
return Promise.reject(data)
})
}
15 changes: 15 additions & 0 deletions cloudfunctions/fetch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "fetch",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"node-fetch": "~2.6.12",
"wx-server-sdk": "~2.6.3"
}
}
Loading

0 comments on commit e67a2fd

Please sign in to comment.