From 848d02e9c5dc5db8c7ab73faec959dd9f9adb027 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 5 Aug 2021 17:08:11 +0800 Subject: [PATCH] docs: uni-id indexes & ssr --- docs/collocation/_sidebar.md | 1 + docs/{ => collocation}/ssr.md | 76 +++++++++++++++++------------------ docs/uniCloud/uni-id.md | 6 +++ 3 files changed, 45 insertions(+), 38 deletions(-) rename docs/{ => collocation}/ssr.md (98%) diff --git a/docs/collocation/_sidebar.md b/docs/collocation/_sidebar.md index a2c677392..82ef063ea 100644 --- a/docs/collocation/_sidebar.md +++ b/docs/collocation/_sidebar.md @@ -13,6 +13,7 @@ * [生命周期](collocation/frame/lifecycle.md) * [页面](collocation/frame/window.md) * [页面通讯](collocation/frame/communication.md) +* [SSR服务端渲染](collocation/ssr.md) * [国际化](collocation/i18n.md) * 自动化测试 * [快速开始](collocation/auto/quick-start.md) diff --git a/docs/ssr.md b/docs/collocation/ssr.md similarity index 98% rename from docs/ssr.md rename to docs/collocation/ssr.md index 78f814b72..60330aa61 100644 --- a/docs/ssr.md +++ b/docs/collocation/ssr.md @@ -126,33 +126,33 @@ export function createApp() { 3. 在页面或组件中使用 ```html - - - ``` @@ -162,20 +162,20 @@ export default { * 开通[uniCloud](https://unicloud.dcloud.net.cn)以及[前端网页托管](https://uniapp.dcloud.net.cn/uniCloud/hosting) * 配置`vite.config.js`中的`base`为`前端网页托管`地址 ```js -import { - defineConfig -} from 'vite' -import uni from '@dcloudio/vite-plugin-uni' -// https://vitejs.dev/config/ -export default defineConfig({ - base: 'https://static-xxxx.bspapp.com/', // uniCloud 前端网页托管资源地址(主要是应用编译后的js,图片等静态资源,可以配置为二级目录) - plugins: [ - uni(), - ], +import { + defineConfig +} from 'vite' +import uni from '@dcloudio/vite-plugin-uni' +// https://vitejs.dev/config/ +export default defineConfig({ + base: 'https://static-xxxx.bspapp.com/', // uniCloud 前端网页托管资源地址(主要是应用编译后的js,图片等静态资源,可以配置为二级目录) + plugins: [ + uni(), + ], }) ``` * 编译: - > cli工程:`npm run build:h5:ssr`或通过`HBuilderX`的`发行菜单->网站 PC-Web或手机H5`、勾选`ssr` + > cli工程:`npm run build:h5:ssr`或通过`HBuilderX 3.1.16及以上版本`的`发行菜单->网站 PC-Web或手机H5`、勾选`ssr` ![以ssr模式发行](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/d7574ced-e253-4b73-8187-86d6a8811364.jpg) diff --git a/docs/uniCloud/uni-id.md b/docs/uniCloud/uni-id.md index aa8181726..6611975dd 100644 --- a/docs/uniCloud/uni-id.md +++ b/docs/uniCloud/uni-id.md @@ -2925,6 +2925,12 @@ const res = await uniID.forbidAppLogin({ } ``` +### 用户表索引@uni-id-users-indexes + +目前opendb内提供的uni-id-users表包含完整的索引,数据库在索引量多且频繁更新的情况下可能会出现写入缓慢的情况,因此推荐开发者在使用uni-id-users表时可以适当删除部分没有用到的索引。 + +例:项目内只使用了微信登录,不使用其他登录方式,可以只保留`wx_unionid、wx_openid.mp-weixin、wx_openid.app-plus`这些账号相关的索引,删除其他账号的索引 + ## 验证码表 表名:`opendb-verify-codes` -- GitLab