diff --git a/changelog.md b/changelog.md index a9b30ca1a154e90672becd22eab5a02a42747ab3..00d8412251aa2e48df4fd565c1d54facf9888a12 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## 1.0.40(2021-07-22) +1. 调整使用正则表达式配置强制登陆功能的写法,解决在小程序端的兼容问题。 +2. 新增签到功能(培养用户习惯,提升用户粘性)。支持:每日签到奖励、周期性连续7日签到,奖励翻倍。 ## 1.0.39(2021-07-19) 1. 强制登陆配置,新增白名单模式 2. 强制登陆配置,支持正则表达式 diff --git a/common/appInit.js b/common/appInit.js index a896d02279f27cfb5330666c6a605e8f83d5f903..47eac34567a0b7914be92467d394f00f438de43b 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -337,9 +337,9 @@ export default async function() { let pass = true //pattern if (needLogin) { - pass = needLogin.every((item) => { - if (item.slice(0, 8) == 'pattern:') { - return !eval(item.slice(8, item.length)).test(url) + pass = needLogin.every((item) => { + if(typeof(item) == 'object' && item.pattern){ + return !item.pattern.test(url) } return url != item }) @@ -347,8 +347,8 @@ export default async function() { } if (visitor&&!inLoginPage) { pass = visitor.some((item) => { - if (item.slice(0, 8) == 'pattern:') { - return eval(item.slice(8, item.length)).test(url) + if(typeof(item) == 'object' && item.pattern){ + return item.pattern.test(url) } return url == item }) diff --git a/package.json b/package.json index 2fcb64ba7cab2299c5612170d66e7a312864fdc8..952dafaa5bf133e39e2d084e2f49cecfba58121e 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,13 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.0.39", + "version": "1.0.40", "description": "云端一体应用快速开发基本项目模版", "keywords": [ - "uni-starter", "login", - "登录模版", - "uniCloud", - "搜索" + "登录", + "搜索", + "uni-id例子" ], "repository": "https://codechina.csdn.net/dcloud/uni-starter.git", "engines": { diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue index 346d1bef50add8f7d04384f9ba879ec039461d3f..367c1a241dc906104d968aec622fb4d738323fc0 100644 --- a/pages/grid/grid.vue +++ b/pages/grid/grid.vue @@ -23,7 +23,7 @@ - diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index 5c43bc2fb72660c7961f3e1d3b0c86b2095fbd58..922316fcfc7de06bfbfcc324afb00a15bd1e5a7a 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -1,5 +1,6 @@