//cloudfunctions\common\hello-common\index.js
//hello-common被调用
module.exports = {
secret: 'abcdefg',
getVersion: function(){
return '1.0.0'
}
}
//uniCloud-aliyun\cloudfunctions\use-common\index.js
//云函数use-common
//需要设置管理公共模块依赖---hello-common
'use strict';
const {
secret,
getVersion
} = require('hello-common')
exports.main = async (event, context) => {
let version = getVersion()
console.log("secret: " + secret);
console.log("version: " + version);
return {
secret,
version
}
};