提交 57405b69 编写于 作者: L linju

123

上级 a3d70aad
......@@ -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=>{
......
......@@ -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
......@@ -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')
})
......
......@@ -57,7 +57,8 @@
"appid" : "wxffdd8fa6ec4ef2a0",
"appsecret" : "",
"UniversalLinks" : ""
}
},
"apple" : {}
},
"ad" : {},
"share" : {
......@@ -71,7 +72,8 @@
"unipush" : {}
}
}
}
},
"nvueLaunchMode" : ""
},
/* 快应用特有相关 */
"quickapp" : {},
......
......@@ -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",
......
......@@ -128,7 +128,7 @@
},
tapGrid(index) {
uni.showToast({
title: '你点击了,第' + index + '',
title: '你点击了,第' + (index+1) + '',
icon: 'none'
});
}
......
......@@ -41,13 +41,6 @@ page {
padding-top: 50rpx;
}
/* #ifndef APP-NVUE */
.hidden,
page {
background-color: transparent;
}
/* #endif */
.login-iknow {
padding-top: 24rpx;
padding-bottom: 48rpx;
......
<template>
<view class="wrap">
<!-- <uni-nav-bar left-icon="back" left-text="返回" right-text="菜单" title="导航栏组件"></uni-nav-bar> -->
<view class="wrap-content">
<view class="content">
<!-- 顶部文字 -->
......@@ -39,7 +40,7 @@
</template>
<script>
const univerify_first = true
var univerify_first,currentWebview;//是否一键登陆优先
import mixin from '../../common/loginPage.mixin.js';
var currentPage;
export default {
......@@ -48,17 +49,15 @@ const univerify_first = true
return {
phoneArea: ['+86'],
currenPhoneArea: '+86',
}
},
onLoad() {
onLoad(e) {
univerify_first = e.univerify_first
//#ifdef APP-PLUS
if(univerify_first){
let pages = getCurrentPages();
currentPage = pages[pages.length - 1];
currentPage.$getAppWebview().setStyle({
top:"1000px"
})
const pages = getCurrentPages();
currentWebview = pages[pages.length - 1].$getAppWebview();
currentWebview.hide();
}
//#endif
},
......@@ -67,9 +66,13 @@ const univerify_first = true
if(univerify_first){
this.$refs.uniQuickLogin.login('univerify')
setTimeout(() => {
currentPage.$getAppWebview().setStyle({
top:"0"
currentWebview.setStyle({
titleNView:{
autoBackButton:true,
backgroundColor:"#FFFFFF"
}
})
currentWebview.show()
}, 1500);
}
//#endif
......
......@@ -385,9 +385,10 @@
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .65);
background-color:rgba(0,0,0,.65);
}
.botton-radius {
border-bottom-left-radius: 30rpx;
border-bottom-right-radius: 30rpx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册