Commit 9dea7b8c by yuzhenWang

修复验证码冲刷新,协议重刷新

parent 5d2d57c0
......@@ -4,6 +4,11 @@
import {baseURL,apiURL,cffpURL,companyInfo} from "@/environments/environment";
import api from './api/api';
export default {
data() {
return {
invitationHandled: false // 在data中明确定义
}
},
onLaunch: function() {
console.log('App Launch');
if(!uni.getStorageSync('loginType')){
......@@ -99,10 +104,12 @@
const pages = getCurrentPages();
if(pages.length > 0) {
const currentRoute = pages[pages.length - 1].route;
console.log('currentRoute',currentRoute);
const whiteList = [
'/myPackageA/login/login',
'/pages/invitationRegister/invitationlogin',
'/myPackageA/applyFranchise/applyFranchise',
'/pages/applyFranchise/applyFranchise',
'/myPackageA/ruleAndContract/clause',
'/pages/courselist/courselist',
'/pages/courseDetail/courseDetail',
......
......@@ -15,6 +15,12 @@
优质资源,专业服务
</view>
</view>
<!-- <resigter
:form="form"
:editNickName="editNickName"
:editMobile="editMobile"
@apply="gotoApply()"
/> -->
<view class="applyBox">
<view style="height: 550rpx;">
<view class="inputBox">
......@@ -109,6 +115,7 @@
</template>
<script>
import resigter from "./resigter.vue";
import everyJoinPopup from "@/components/commonPopup/everyJoinPopup.vue";
import api from '@/api/api';
import * as environment from "@/environments/environment";
......@@ -116,7 +123,8 @@
import dataHandling from "@/util/dataHandling";
export default {
components:{
everyJoinPopup
everyJoinPopup,
resigter
},
data() {
return {
......@@ -159,7 +167,9 @@
uni.clearStorageSync()
uni.setStorageSync('loginType', 'visitor')
}
},
onShow(){
if(uni.getStorageSync('loginType')){
......@@ -183,10 +193,7 @@
if(!this.inviteUserId&&this.loginType == 'codelogin'&&!this.form.nickName){
this.queryInfo()
}
// 邀请状态
// if(this.inviteUserId){
// this.getqueryById(this.shareId)
// }
},
methods: {
getqueryById(shareId){
......@@ -221,6 +228,7 @@
c_agreeFlag(){
this.agreeFlag=!this.agreeFlag;
},
delayTime() {
this.disabledSendBtn = true;
this.timer = setInterval(() => {
......@@ -233,27 +241,27 @@
clearInterval(this.timer);
}
}, 1000);
},
sendMessage(){
const params = {
mobileNo:this.form.mobile,
type:"1",
source: "cffp"
}
if(common.mobileNoValid(this.form.mobile)){
if(!this.disabledSendBtn){
api.verificationCode(params).then((res)=>{
if(res['success']){
this.delayTime()
}else{
common.errorDialog(2,res['message'])
}
})
}
}else{
common.errorDialog(2,'请填写手机号')
}
},
sendMessage(){
const params = {
mobileNo:this.form.mobile,
type:"1",
source: "cffp"
}
if(common.mobileNoValid(this.form.mobile)){
if(!this.disabledSendBtn){
api.verificationCode(params).then((res)=>{
if(res['success']){
this.delayTime()
}else{
common.errorDialog(2,res['message'])
}
})
}
}else{
common.errorDialog(2,'请填写手机号')
}
},
gotoApply(){
if(!this.form.nickName){
common.errorDialog(1,'请输入昵称');
......
<template>
<view class="">
11111
</view>
</template>
<script>
export default {
//项目中转页
onLoad(options){
if(options.invitationCode) {
uni.navigateTo({
url: `/myPackageA/applyFranchise/applyFranchise?shareId=${options.shareId}&invitationCode=${options.invitationCode}&inviteUserId=${options.inviteUserId}`
});
return;
}
}
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -27,7 +27,7 @@
"softinputMode": "adjustResize"
}
}
}, {
}, {
"path": "pages/product/product",
"style": {
"navigationBarTitleText": "SFP",
......@@ -502,10 +502,7 @@
},{
"path": "applyFranchise/applyFranchise",
"style": {
"navigationBarTitleText": "申请加盟",
"h5": {
"reload": false // 禁用自动重新加载
}
"navigationBarTitleText": "申请加盟"
}
},{
"path": "integralExchange/exchange",
......@@ -540,10 +537,12 @@
},{
"path": "ruleAndContract/clause",
"style": {
"navigationBarTitleText": "协议",
"h5": {
"reload": false // 禁用自动重新加载
}
"navigationBarTitleText": "协议"
}
},{
"path": "transformPage/transformPage",
"style": {
"navigationBarTitleText": "中转页"
}
}
]
......
import {apiURL,cffpURL} from "../environments/environment";
import {apiURL,cffpURL,sfpUrl} from "../environments/environment";
import api from "@/api/api";
// 白名单,不需要携带token就允许被访问的接口
const whiteApiList = [`${apiURL}/authorize/obtainToken`, `${apiURL}/authorize/checkToken`, `${cffpURL}/user/loginVerification`,`${apiURL}/appVersion/checkIsUpdate`,
`${cffpURL}/accessLog/accessLogSave`,`${cffpURL}/user/powerQuery`,`${cffpURL}/user/wxLogin`,`${cffpURL}/certificate/officialWebsiteDetail`];
const whiteApiList = [`${apiURL}/authorize/obtainToken`,
`${apiURL}/authorize/checkToken`,
`${cffpURL}/user/loginVerification`,
`${apiURL}/appVersion/checkIsUpdate`,
`${cffpURL}/accessLog/accessLogSave`,
`${cffpURL}/user/powerQuery`,`${cffpURL}/user/wxLogin`,
`${cffpURL}/certificate/officialWebsiteDetail`,
`${apiURL}/verificationCode`,
`${sfpUrl}/sfp/sfpMain/pocessTracking`,
`${cffpURL}/partner/queryById`,
];
export const interceptor = () => {
uni.addInterceptor('request', {
// 请求拦截器
......
......@@ -6,6 +6,7 @@ const whiteList = [
'/myPackageA/login/login',
'/pages/invitationRegister/invitationlogin',
'/myPackageA/applyFranchise/applyFranchise',
'/pages/applyFranchise/applyFranchise',
'/myPackageA/ruleAndContract/clause',
'/pages/orderDetail/orderDetail',
'/pages/courseDetail/courseDetail',
......@@ -16,15 +17,11 @@ const whiteList = [
export default function initApp(){
let date = Date.now()
uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) {
// 移除URL中的t_reload参数
let url = e.url;
if(url.includes('t_reload=')) {
url = url.split('?')[0] + (url.includes('?') ? '?' : '') +
url.split('?')[1].split('&').filter(param => !param.startsWith('t_reload=')).join('&');
}
console.log(e);
let pages = getCurrentPages()
let pagesLength = pages.length
......@@ -44,7 +41,7 @@ export default function initApp(){
uni.navigateTo({
url: '/myPackageA/login/login'
})
return
return true
}
// 保存用户得个人信息
if (res['success']) {
......@@ -68,8 +65,8 @@ export default function initApp(){
return params.get(key);
};
const fromParam = getQueryParam(url, 'from');
if(!hasPermission(url)){
const fromParam = getQueryParam(e.url, 'from');
if(!hasPermission(e.url)){
// 如果 from 参数在 whiteArr 中,说明是tabbar页带着tabbar的标志参数跳转到登录页,以便未登录状态下回到对应的tabbar页
if (fromParam && whiteArr.includes(fromParam)) {
uni.redirectTo({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment