index.js 445 Bytes
'use strict';
const {
	getUserId
} = require('user-common')
exports.main = async (event, context) => {
	//event为客户端上传的参数
	let workerId = await getUserId(event.token)
	if (workerId) {
		await uniCloud.database().collection("user_upload_file").add({
			"user_id": workerId,
			"standard_id": event.standardId,
			url: "https://img2.banshouhui.com/" + event.url,
			create_date: new Date()
		})
		return true
	}
	return false

};