p13uni-starter 项目创建与功能介绍

301 阅读1分钟

cloudfunctions/common/uni-config-center

  • 整个unistarter 配置中心
  • 在这个目录下新建一个a/config.json
{
  "test": 123455
}
  • 然后新建一个云函数test1,然后右键选择管理公共模块依赖,选择uni-config-center test1/index.js
'use strict';
const uniConfigCent = require('uni-config-center')
const aConfig = uniConfigCent({pluginId:"a"}).config()
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	
	//返回数据给客户端
	return aConfig
};

  • 本地运行一下就能拿到配置

uni-starter的登录调的是uni-id的云函数

  • 可以直接在uni-config-center下的uni-id/config.json配置登录

列表页演示

  • 搜索,下拉刷新等
  • 以及获取文章列表时通过联查获取作者信息

宫格页面掩饰了对不同用户可见的操作

router前置登录页面

  • 目前需要通过uniIdRouter去做
  • 在pages.json中进行配置
"uniIdRouter": {
		"loginPage": "uni_modules/uni-id-pages/pages/login/login-withoutpwd",
		"needLogin": [
			"/uni_modules/uni-id-pages/pages/userinfo/userinfo"
		],
		"resToLogin": true
	}

about关于的配置

  • md右键一键分享,复制链接,直接把用户服务协议贴上去
  • 隐私协议有模板