From 333013dd5c2c79971169627b955e8efa0252b184 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 6 Apr 2023 17:36:10 +0800 Subject: [PATCH] fix --- config/request.js | 4 ++-- pages/login/login.vue | 2 +- pages/reg/reg.vue | 21 +++++++++++++++------ team/article/article.vue | 2 +- team/scheme/scheme.vue | 2 +- team/send/send.vue | 5 ++++- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/config/request.js b/config/request.js index 3656ab0..1d9b09f 100644 --- a/config/request.js +++ b/config/request.js @@ -6,8 +6,8 @@ export default { // baseURL: 'https://huorantech.cn/', - baseURL: 'http://192.168.31.151:9000/', - // baseURL: 'http://121.37.12.51/', + // baseURL: 'http://192.168.31.117:9000/', + baseURL: 'http://121.37.12.51/', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, diff --git a/pages/login/login.vue b/pages/login/login.vue index ccf7e94..2261921 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -45,7 +45,7 @@ } }, onShow() { - uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjgwNTgwODQ5LCJleHAiOjE2ODA2MjQwNDksImFjY291bnRJZCI6IjIxNiJ9.oyssva0Fdvs0i8ud1mU_TF693qMGzx76xyYJiBbzeBI') + // uni.setStorageSync('token', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiaWF0IjoxNjgwNTgwODQ5LCJleHAiOjE2ODA2MjQwNDksImFjY291bnRJZCI6IjIxNiJ9.oyssva0Fdvs0i8ud1mU_TF693qMGzx76xyYJiBbzeBI') // 先授权用户信息,再授权手机号 this.checkLogin() }, diff --git a/pages/reg/reg.vue b/pages/reg/reg.vue index 6d567d0..0be5b25 100644 --- a/pages/reg/reg.vue +++ b/pages/reg/reg.vue @@ -126,13 +126,22 @@ this.toIndex() }).catch(res => {}) } else { // 新用户,注册。or 成员,创建自己的团队 - partnerAccountApplication(form).then(res => { + partnerAccountApplication(form).then(({ token, teamId }) => { this.$util.sucMsg(form.isTeam === 0 ? '创建成功' : '注册成功') - setTimeout(() => { - uni.redirectTo({ - url: '../login/login' - }) - }, 1500) + // 如果返回了token,直接登录,并且把teamId存在缓存里,到了首页后直接选中该团队 + if (token) { + teamId && uni.setStorageSync('teamId', teamId) + uni.setStorageSync('token', token) + setTimeout(() => { + this.toIndex() + }, 1500) + } else { + setTimeout(() => { + uni.redirectTo({ + url: '../login/login' + }) + }, 1500) + } }).catch(res => {}) } }, diff --git a/team/article/article.vue b/team/article/article.vue index cb0ebdc..4d25b21 100644 --- a/team/article/article.vue +++ b/team/article/article.vue @@ -63,7 +63,7 @@ }, // 下载附件 download(item) { - this.$util.to(`../send/send?url=${item.filePath}`) + this.$util.to(`../send/send?url=${item.filePath}©Writing=${item.fileName}`) // uni.showLoading({ // title: '正在下载...', // mask: true diff --git a/team/scheme/scheme.vue b/team/scheme/scheme.vue index 630d805..4884b82 100644 --- a/team/scheme/scheme.vue +++ b/team/scheme/scheme.vue @@ -44,7 +44,7 @@ }, // 下载方案文件 download() { - this.$util.to(`../send/send?url=${this.form.schemeFile}`) + this.$util.to(`../send/send?url=${this.form.schemeFile}©Writing=${this.form.fileName}`) // uni.showLoading({ // title: '加载中', // mask: true diff --git a/team/send/send.vue b/team/send/send.vue index c9904b9..d5cddf1 100644 --- a/team/send/send.vue +++ b/team/send/send.vue @@ -25,6 +25,7 @@ export default { data() { return { + copyWriting: '', url: '', email: '', otherEmail: '', @@ -40,6 +41,7 @@ const pages = getCurrentPages() const { options } = pages[pages.length - 1] this.url = options.url + this.copyWriting = options.copyWriting this.getInfo() }, methods: { @@ -65,7 +67,8 @@ if (this.myVal && !this.email) return this.$util.errMsg('请选择其他邮箱!') if (this.otherVal && !otherEmail) return this.$util.errMsg('请输入邮箱!') mailFileSend({ - copyWriting: this.url, + url: this.url, + copyWriting: this.copyWriting, mail: this.myVal ? this.email : otherEmail }).then(res => { this.$util.sucMsg('发送成功!')