新增邮件发送和管理员功能
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
import attService from './att-service';
|
||||
import constant from '../const/constant';
|
||||
|
||||
const r2Service = {
|
||||
async putObj(c, key, content, metadata) {
|
||||
const body = typeof content === 'string'
|
||||
? new TextEncoder().encode(content)
|
||||
: content;
|
||||
await c.env.r2.put(key, body, {
|
||||
await c.env.r2.put(key, content, {
|
||||
httpMetadata: {...metadata}
|
||||
});
|
||||
},
|
||||
|
||||
async getObj(c, key) {
|
||||
return await c.env.r2.get(key);
|
||||
},
|
||||
|
||||
async delete(c, key) {
|
||||
await c.env.r2.delete(key);
|
||||
}
|
||||
|
||||
};
|
||||
export default r2Service;
|
||||
|
||||
Reference in New Issue
Block a user