diff --git a/common/locales/en.js b/common/locales/en.js index ee437ea..9500db0 100644 --- a/common/locales/en.js +++ b/common/locales/en.js @@ -130,6 +130,7 @@ export default { times:'Time', address:'Address', emailerr:'Email cannot be empty', + emailerr1:'Email format error', passworerr:'Password cannot be empty', passworerr1:'Password inconsistency', agreementarr:'Please first check and agree to the User Service Agreement and Privacy Policy', diff --git a/common/locales/zh.js b/common/locales/zh.js index bb94c95..d4f7985 100644 --- a/common/locales/zh.js +++ b/common/locales/zh.js @@ -129,6 +129,7 @@ export default { times:'时间', address:'地址', emailerr:'邮箱不能为空', + emailerr1:'邮箱格式错误', passworerr:'密码不能为空', passworerr1:'密码不一致', agreementarr:'请先勾选同意用户服务协议以及隐私政策', diff --git a/pages/customer/add.vue b/pages/customer/add.vue index 3a07f4b..92a2da7 100644 --- a/pages/customer/add.vue +++ b/pages/customer/add.vue @@ -3,7 +3,7 @@ - {{$t('customer.CustomerChannel')}} + {{$t('customer.CustomerChannel')}} * {{channel_name || $t('customer.CustomerChannelinput')}} @@ -60,7 +60,7 @@ - {{$t('customer.Customerph')}} + {{$t('customer.Customerph')}} * {{car_type_name || $t('customer.Customerphinput')}} @@ -312,14 +312,7 @@ saveFn(){ if(this.form.contacts==''){ uni.showToast({ - title:'客户名称不能为空', - icon: 'none' - }); - return false - } - if(this.form.phone==''){ - uni.showToast({ - title:'联系方式不能为空', + title:this.$t('customer.CustomerNameinput'), icon: 'none' }); return false diff --git a/pages/customer/editdetile.vue b/pages/customer/editdetile.vue index 57440d1..907e82b 100644 --- a/pages/customer/editdetile.vue +++ b/pages/customer/editdetile.vue @@ -3,7 +3,7 @@ - {{$t('customer.CustomerChannel')}} + {{$t('customer.CustomerChannel')}} * {{channel_name || $t('customer.CustomerChannelinput')}} @@ -60,7 +60,7 @@ - {{$t('customer.Customerph')}} + {{$t('customer.Customerph')}} * {{car_type_name || $t('customer.Customerphinput')}} diff --git a/pages/customer/followup.vue b/pages/customer/followup.vue index 97152d2..f6bb6b3 100644 --- a/pages/customer/followup.vue +++ b/pages/customer/followup.vue @@ -435,7 +435,7 @@ url: 'http://219.157.255.213:9007/upload/uploadImage', filePath: imgUrl, name: 'files', - // header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')}, + header:{'Authorization': 'Bearer ' + uni.getStorageSync('token')}, success: (uploadFileRes) => { const path=JSON.parse(uploadFileRes.data) if(path.code==-1){ diff --git a/pages/index/mine.vue b/pages/index/mine.vue index 086d498..b077ca0 100644 --- a/pages/index/mine.vue +++ b/pages/index/mine.vue @@ -7,7 +7,7 @@ - + diff --git a/pages/index/webview.vue b/pages/index/webview.vue index bf52e8b..7292774 100644 --- a/pages/index/webview.vue +++ b/pages/index/webview.vue @@ -36,19 +36,32 @@ url:'feishu/getinfo', method:'post', }).then(res => { - var data = res.data.data; - this.datas = data - console.log(data) - - code_url += 'https://open.feishu.cn/open-apis/authen/v1/authorize' - code_url += '?app_id=' + data.app_id - code_url += '&redirect_uri=' + data.redirect_uri - code_url += '&scope=' + data.scope - code_url += '&state=' + data.state; + uni.showToast({ + title: res.data.message, + icon: 'none' + }); + if(res.data.code ==0){ + var data = res.data.data; + this.datas = data + console.log(data) + + code_url += 'https://open.feishu.cn/open-apis/authen/v1/authorize' + code_url += '?app_id=' + data.app_id + code_url += '&redirect_uri=' + data.redirect_uri + code_url += '&scope=' + data.scope + code_url += '&state=' + data.state; + + console.log(code_url) + // return; + window.location.href = code_url; + }else{ + setTimeout(() => { + uni.reLaunch({ + url: '/pages/index/mine',// 替换为你要跳转的页面路径 + }); + }, 1000); + } - console.log(code_url) - // return; - window.location.href = code_url; }) } else { this.getOpenId(code,state) diff --git a/pages/login/register.vue b/pages/login/register.vue index c67b2ff..bc933b9 100644 --- a/pages/login/register.vue +++ b/pages/login/register.vue @@ -78,7 +78,13 @@ }, methods: { leftClick(){ - uni.navigateBack({}) + uni.reLaunch({ + url: '/pages/login/index',// 替换为你要跳转的页面路径 + }); + }, + validateEmail(email) { + const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; + return regex.test(email); }, login() { if(this.email==''){ @@ -141,6 +147,13 @@ }); return false } + if (!this.validateEmail(this.email)) { + uni.showToast({ + title:this.$t('emailerr1'), + icon: 'none' + }); + return false; + } this.vcodeTime = 60 this.vcodeTimer = setInterval(() => { if (this.vcodeTime > 0) { diff --git a/pages/mine/changinfo.vue b/pages/mine/changinfo.vue index ea84d46..666ce10 100644 --- a/pages/mine/changinfo.vue +++ b/pages/mine/changinfo.vue @@ -4,7 +4,7 @@ - + {{$t('mine.changeavatar')}} @@ -105,7 +105,11 @@ url:'user/getInfo', method:'get', }).then(res => { + if(res.data.data.position=='null'){ + res.data.data.position='' + } that.userinfo = res.data.data; + that.select1() }) }, @@ -166,7 +170,7 @@ url: 'http://219.157.255.213:9007/upload/uploadImage', filePath: imgUrl, name: 'files', - // header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')}, + header:{'Authorization': 'Bearer ' + uni.getStorageSync('token')}, success: (uploadFileRes) => { const path=JSON.parse(uploadFileRes.data) if(path.code==-1){ diff --git a/pages/mine/resetPwd.vue b/pages/mine/resetPwd.vue index 87c27ee..7da1fb7 100644 --- a/pages/mine/resetPwd.vue +++ b/pages/mine/resetPwd.vue @@ -80,6 +80,10 @@ leftClick(){ uni.navigateBack({}) }, + validateEmail(email) { + const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; + return regex.test(email); + }, login() { if(this.email==''){ uni.showToast({ @@ -134,6 +138,13 @@ }); return false } + if (!this.validateEmail(this.email)) { + uni.showToast({ + title:this.$t('emailerr1'), + icon: 'none' + }); + return false; + } this.vcodeTime = 60 this.vcodeTimer = setInterval(() => { if (this.vcodeTime > 0) {