diff --git a/App.vue b/App.vue index ee9513aacc4073e2760b7d184230c99b56afb0c2..7f8aa297c6a76c87a86c39aa97096ed96ed578e5 100644 --- a/App.vue +++ b/App.vue @@ -15,6 +15,12 @@ console.log(e); } }); + uni.preloadPage({ + url: "uni_modules/uni-login-page/pages/index/index", + complete:e=>{ + console.log(e); + } + }); // #ifdef APP-PLUS //预加载一键登录 plus.oauth.getServices(oauthServices=>{ diff --git a/baseapp.config.json b/baseapp.config.json index 980a5983c0d91bc6e82718bc06d288db403ad24d..3f9d764de4d1da9c9513475f959e57a9dae2fe9b 100644 --- a/baseapp.config.json +++ b/baseapp.config.json @@ -3,7 +3,8 @@ "needLogin":[ "/pages/ucenter/edit/edit", "/uni_modules/uni-login-page/pages/index/pwd-retrieve" - ] + ], + "login":["univerify","password","weixin","apple","code"] }, "about":{ "appName":"base-app", @@ -18,6 +19,7 @@ "title":"隐私政策", "url":"https://uniapp.dcloud.io/" } - ] + ], + "下载地址":"" } } \ No newline at end of file diff --git a/common/appInit.js b/common/appInit.js index 6d3b1270982ce0835a53429656f43296bf6234b7..fdcfeb544de29a6304ed106ba9c1885b8d8a6cf2 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -9,7 +9,7 @@ export default function() { initAppVersion(); //自定义路由拦截 - const {"router":{needLogin}} = baseappConfig //需要登陆的页面 + const {"router":{needLogin,login}} = baseappConfig //需要登陆的页面 // changeAction(["navigateTo", "redirectTo", "reLaunch", "switchTab"], { // before_action: e => { @@ -33,9 +33,11 @@ export default function() { list.forEach(item=>{ uni.addInterceptor(item,{ invoke(e){// 调用前拦截 - //console.log(e); - let token = uni.getStorageSync('uni-id-token') - let url = e.url.split('?')[0] + console.log(e); + const token = uni.getStorageSync('uni_id_token') + console.log(token); + const url = e.url.split('?')[0] + //拦截强制登陆页面 if (needLogin.includes(url) && token == '') { console.log('该页面需要登陆,即将跳转到login页面'); uni.showToast({title:'该页面需要登陆,即将跳转到login页面',icon:'none'}) @@ -44,9 +46,34 @@ export default function() { }) return false } + //控制登陆优先级 + if(url=='/uni_modules/uni-login-page/pages/index/index'){ + //一键登录(univerify)、密码登陆(password)、快捷登录&验证码登陆(!univerify&password) + if(login[0]=='univerify'){ + console.log(e.url,url); + if(e.url==url){ e.url+= '?' } + e.url += "univerify_first=true" + }else if(login[0]=='password'){ + e.url = "/uni_modules/uni-login-page/pages/index/pwd-login" + }else{ + //默认即是 + } + } return true + }, + success(){ // 成功回调拦截 + + }, + fail(){ // 失败回调拦截 + + }, + complete(e){ // 完成回调拦截 + console.log(e); + }, + returnValue(){// 返回结果拦截 + } - }) + })// 移除拦截器API removeInterceptor('request') }) diff --git a/manifest.json b/manifest.json index c8870f2086a6c22fac85d05e0bfb7739da83b761..9ff5fc4c71168047de675e3233bb8789b952ad88 100644 --- a/manifest.json +++ b/manifest.json @@ -57,7 +57,8 @@ "appid" : "wxffdd8fa6ec4ef2a0", "appsecret" : "", "UniversalLinks" : "" - } + }, + "apple" : {} }, "ad" : {}, "share" : { @@ -71,7 +72,8 @@ "unipush" : {} } } - } + }, + "nvueLaunchMode" : "" }, /* 快应用特有相关 */ "quickapp" : {}, diff --git a/pages.json b/pages.json index 4a3f1c6e2e4ce76d3dfd0d51e6cac375690cc5e0..ddcc79b4e034c9ba7131dad7675c33efba6560e6 100644 --- a/pages.json +++ b/pages.json @@ -23,7 +23,9 @@ "navigationBarTitleText": "", "app-plus": { "animationType": "none", - "popGesture": "none" + "popGesture": "none", + "navigationStyle": "custom", + "backgroundColor": "transparent" // "titleNView": { // "buttons": [{ // "text": "帮助", @@ -213,17 +215,20 @@ "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#F8F8F8" }, - // "condition": { - // "list": [ - // { - // "path": "uni_modules/uni-login-page/pages/index/index" - // }, - // { - // "path": "pages/test/test" - // } - // ], - // "current":0 - // }, + "condition": { + "list": [ + { + "path": "uni_modules/uni-login-page/pages/index/index" + }, + { + "path": "pages/test/test" + }, + { + "path":"pages/ucenter/settings/settings" + } + ], + "current":2 + }, "tabBar": { "color": "#7A7E83", "selectedColor": "#007AFF", diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index ff579b65a89f58bfc721e0cb5a6c7c6daeef1c8c..7376e7637b3696042621b712bf007812310224ac 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -128,7 +128,7 @@ }, tapGrid(index) { uni.showToast({ - title: '你点击了,第' + index + '个', + title: '你点击了,第' + (index+1) + '个', icon: 'none' }); } diff --git a/uni_modules/uni-login-page/common/loginPage.css b/uni_modules/uni-login-page/common/loginPage.css index 4ca73e867435b41d54d8f72038c3cd49326ff9c4..1c11710e307a0f1730beea3f722c26af00e84fbc 100644 --- a/uni_modules/uni-login-page/common/loginPage.css +++ b/uni_modules/uni-login-page/common/loginPage.css @@ -33,20 +33,13 @@ page { /* #endif */ width: 630rpx; flex-direction: column; -} +} .content-top-title { font-size: 32rpx; font-weight: 600; padding-top: 50rpx; -} - -/* #ifndef APP-NVUE */ -.hidden, -page { - background-color: transparent; } -/* #endif */ .login-iknow { padding-top: 24rpx; diff --git a/uni_modules/uni-login-page/pages/index/index.vue b/uni_modules/uni-login-page/pages/index/index.nvue similarity index 84% rename from uni_modules/uni-login-page/pages/index/index.vue rename to uni_modules/uni-login-page/pages/index/index.nvue index fa40d7d7ce00f2e2ee82e83a47d1785e9a524aaa..727e7285453cf64176f66b1c324b55af9bdf5e4b 100644 --- a/uni_modules/uni-login-page/pages/index/index.vue +++ b/uni_modules/uni-login-page/pages/index/index.nvue @@ -1,5 +1,6 @@ -