From 350e85143acb1bf111bff75fc992681007b9d617 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 3 Nov 2022 09:52:23 +0800 Subject: [PATCH 01/12] bug --- src/project/tianfuxing/AppHome/Activity.vue | 4 ++-- src/project/tianfuxing/AppHome/AppHome.vue | 2 +- src/project/tianfuxing/AppHome/Culture.vue | 2 +- src/project/tianfuxing/AppHome/PhotoReport.vue | 4 ++-- src/project/tianfuxing/AppMy/AppMy.vue | 11 +++++++---- src/utils/axios.js | 4 ++-- src/utils/config.js | 2 +- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/project/tianfuxing/AppHome/Activity.vue b/src/project/tianfuxing/AppHome/Activity.vue index 1f38164..f072460 100644 --- a/src/project/tianfuxing/AppHome/Activity.vue +++ b/src/project/tianfuxing/AppHome/Activity.vue @@ -112,7 +112,7 @@ methods: { getInfo () { - this.$instance.post(`/appactivityinfo/queryDetailById?id=${this.id}`).then(res => { + this.$instance.post(`/api/appactivityinfo/queryDetailById?id=${this.id}`).then(res => { if (res.code === 0) { this.info = res.data @@ -163,7 +163,7 @@ if (!this.info.exitClock && (times > outSTimes && times < outETimes)) { type = 1 } - this.$instance.post(`/appactivityinfo/clock`, { + this.$instance.post(`/api/appactivityinfo/clock`, { address: this.address, activityId: this.id, clockTime: this.$dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), diff --git a/src/project/tianfuxing/AppHome/AppHome.vue b/src/project/tianfuxing/AppHome/AppHome.vue index d8df8bc..eeeb9a8 100644 --- a/src/project/tianfuxing/AppHome/AppHome.vue +++ b/src/project/tianfuxing/AppHome/AppHome.vue @@ -88,7 +88,7 @@ if (this.isMore) return this.$loading() - this.$instance.post(`/appactivityinfo/list`, null, { + this.$instance.post(`/api/appactivityinfo/list`, null, { withoutToken: true, params: { current: this.current, diff --git a/src/project/tianfuxing/AppHome/Culture.vue b/src/project/tianfuxing/AppHome/Culture.vue index 1a3bef7..4340f18 100644 --- a/src/project/tianfuxing/AppHome/Culture.vue +++ b/src/project/tianfuxing/AppHome/Culture.vue @@ -139,7 +139,7 @@ export default { complete: () => { this.$nextTick(() => { if (this.imgList.length === total && this.hideStatus) { - this.$instance.post(`/appwechatescalation/addOrUpdate`, { + this.$instance.post(`/api/appwechatescalation/addOrUpdate`, { type: type, openId: this.user.openId, accessUrl: this.imgList[0] diff --git a/src/project/tianfuxing/AppHome/PhotoReport.vue b/src/project/tianfuxing/AppHome/PhotoReport.vue index dde7505..216e56b 100644 --- a/src/project/tianfuxing/AppHome/PhotoReport.vue +++ b/src/project/tianfuxing/AppHome/PhotoReport.vue @@ -137,7 +137,7 @@ complete: () => { this.$nextTick(() => { if (this.imgList.length === total && this.hideStatus) { - this.$instance.post(`/appwechatescalation/addOrUpdate`, { + this.$instance.post(`/api/appwechatescalation/addOrUpdate`, { type: 0, listType: 0, openId: this.user.openId, @@ -166,7 +166,7 @@ getList () { if (this.isMore) return - this.$instance.post(`/appwechatescalation/list`, null, { + this.$instance.post(`/api/appwechatescalation/list`, null, { params: { current: this.current, size: 10, diff --git a/src/project/tianfuxing/AppMy/AppMy.vue b/src/project/tianfuxing/AppMy/AppMy.vue index e5f3900..6011d35 100644 --- a/src/project/tianfuxing/AppMy/AppMy.vue +++ b/src/project/tianfuxing/AppMy/AppMy.vue @@ -14,12 +14,12 @@

积分总额

- {{ user.integral }} + {{ user.integral || 0 }}

积分排名

- {{ user.integralOrder }} + {{ user.integralOrder || 0 }}
@@ -85,7 +85,10 @@ toLogin () { if (!this.token) { - this.autoLogin() + this.autoLogin().then(() => { + this.getList() + this.getUserInfo() + }) } else { this.getUserInfo() } @@ -94,7 +97,7 @@ getList () { if (this.isMore) return - this.$instance.post(`/appwechatintegraldetail/list`, null, { + this.$instance.post(`/api/appwechatintegraldetail/list`, null, { params: { current: this.current, size: 10 diff --git a/src/utils/axios.js b/src/utils/axios.js index 1189fef..45ee765 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -6,8 +6,8 @@ import instance from "dvcp-wui/utils/http"; instance.defaults.baseURL = setting.baseUrl instance.interceptors.request.use(config => { - if (config.baseURL === 'http://192.168.1.87:12421') { - config.url = '/api' + config.url.replace(/(app|auth|admin)\//, "") + if (config.baseURL === 'http://192.168.1.87:59998') { + config.url = config.url.replace(/(app|auth|admin|api)\//, "") } return config diff --git a/src/utils/config.js b/src/utils/config.js index c5da9df..f686029 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -16,7 +16,7 @@ const configs = { dev: { areaId: '341021104000', areaName: '郑村镇', - baseUrl: 'http://192.168.1.87:12421' + baseUrl: 'http://192.168.1.87:59998' } } // 当前选中配置 From 22ccf1081bfda6142bafe25e3f7d69a6baaffb53 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 3 Nov 2022 10:34:21 +0800 Subject: [PATCH 02/12] bug --- src/project/tianfuxing/AppHome/AppHome.vue | 2 +- src/project/tianfuxing/AppHome/Culture.vue | 4 +- .../tianfuxing/AppHome/PhotoReport.vue | 2 +- src/project/tianfuxing/AppMy/AppMy.vue | 9 +++- src/project/tianfuxing/AppMy/UserInfo.vue | 44 ++++++++++++------- 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/project/tianfuxing/AppHome/AppHome.vue b/src/project/tianfuxing/AppHome/AppHome.vue index eeeb9a8..6b7de3c 100644 --- a/src/project/tianfuxing/AppHome/AppHome.vue +++ b/src/project/tianfuxing/AppHome/AppHome.vue @@ -70,7 +70,7 @@ onLoad () { this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight uni.setNavigationBarColor({ - frontColor: '#000000' + frontColor: 'black' }) this.getList() diff --git a/src/project/tianfuxing/AppHome/Culture.vue b/src/project/tianfuxing/AppHome/Culture.vue index 4340f18..38f9cd7 100644 --- a/src/project/tianfuxing/AppHome/Culture.vue +++ b/src/project/tianfuxing/AppHome/Culture.vue @@ -120,7 +120,7 @@ export default { uploadFile (img, total, type) { uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/api/file/add', + url: this.$instance.defaults.baseURL + '/file/add', filePath: img, name: 'file', header: { @@ -162,7 +162,7 @@ export default { getList () { if (this.isMore) return - this.$instance.post(`/appwechatescalation/list`, null, { + this.$instance.post(`/api/appwechatescalation/list`, null, { params: { current: this.current, size: 10, diff --git a/src/project/tianfuxing/AppHome/PhotoReport.vue b/src/project/tianfuxing/AppHome/PhotoReport.vue index 216e56b..e98c824 100644 --- a/src/project/tianfuxing/AppHome/PhotoReport.vue +++ b/src/project/tianfuxing/AppHome/PhotoReport.vue @@ -118,7 +118,7 @@ uploadFile (img, total) { uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/api/file/add', + url: this.$instance.defaults.baseURL + '/file/add', filePath: img, name: 'file', header: { diff --git a/src/project/tianfuxing/AppMy/AppMy.vue b/src/project/tianfuxing/AppMy/AppMy.vue index 6011d35..ec6e3b7 100644 --- a/src/project/tianfuxing/AppMy/AppMy.vue +++ b/src/project/tianfuxing/AppMy/AppMy.vue @@ -70,6 +70,10 @@ this.getUserInfo() this.getList() } + + uni.$on('updateUserInfo', () => { + this.getUserInfo() + }) }, methods: { @@ -100,7 +104,8 @@ this.$instance.post(`/api/appwechatintegraldetail/list`, null, { params: { current: this.current, - size: 10 + size: 10, + openId: this.user.openId } }).then(res => { if (res.code === 0) { @@ -161,12 +166,12 @@ } p { + margin-top: 18px; color: #8891A1; font-size: 26px; } h2 { - margin-bottom: 18px; font-weight: 600; font-size: 34px; color: #1D2229; diff --git a/src/project/tianfuxing/AppMy/UserInfo.vue b/src/project/tianfuxing/AppMy/UserInfo.vue index f36e850..45a00c0 100644 --- a/src/project/tianfuxing/AppMy/UserInfo.vue +++ b/src/project/tianfuxing/AppMy/UserInfo.vue @@ -19,7 +19,7 @@
-
保存
+
保存
@@ -57,10 +57,37 @@ }) }, + save () { + if (!this.userInfo.avatarUrl) { + return this.$toast('请上传头像') + } + + if (!this.userInfo.nickName) { + return this.$toast('请输入昵称') + } + + this.$loading() + this.$instance.post('/api/appwechatuser/update-nickName', null, { + params: { + ...this.userInfo + } + }).then(res => { + if (res.code === 0) { + this.$toast('保存成功') + + uni.$emit('updateUserInfo') + + setTimeout(() => { + wx.navigateBack() + }, 600) + } + }) + }, + onChooseAvatar (e) { this.$loading() uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/api/file/add', + url: this.$instance.defaults.baseURL + '/file/add', filePath: e.detail.avatarUrl, name: 'file', header: { @@ -92,19 +119,6 @@ success: res => { } }) - }, - - save () { - this.$loading() - this.$http.post('/app/editUserInfo', null, { - params: { - ...this.userInfo - } - }).then(res => { - if (res.code === 0) { - this.$toast('保存成功') - } - }) } } } From d8569137e92c91005b7194bf57aeca028440ceb7 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 3 Nov 2022 10:44:55 +0800 Subject: [PATCH 03/12] bug --- src/manifest.json | 3 ++- src/project/tianfuxing/AppHome/Activity.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index 0aac863..e53f73f 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -17,6 +17,7 @@ "scope.userLocation": { "desc": "你的位置信息将用于当前事件发生地点" } - } + }, + "requiredPrivateInfos" : ["getLocation"] } } diff --git a/src/project/tianfuxing/AppHome/Activity.vue b/src/project/tianfuxing/AppHome/Activity.vue index f072460..0f1078d 100644 --- a/src/project/tianfuxing/AppHome/Activity.vue +++ b/src/project/tianfuxing/AppHome/Activity.vue @@ -222,7 +222,8 @@ } }) }, - fail: () => { + fail: e => { + console.log(e) } }) }, From 77111556bd03105742004be995b996095dc017d8 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 3 Nov 2022 11:00:03 +0800 Subject: [PATCH 04/12] bug --- src/project/tianfuxing/AppHome/Culture.vue | 2 +- src/project/tianfuxing/AppHome/PhotoReport.vue | 2 +- src/project/tianfuxing/AppMy/UserInfo.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/project/tianfuxing/AppHome/Culture.vue b/src/project/tianfuxing/AppHome/Culture.vue index 38f9cd7..34f0e12 100644 --- a/src/project/tianfuxing/AppHome/Culture.vue +++ b/src/project/tianfuxing/AppHome/Culture.vue @@ -120,7 +120,7 @@ export default { uploadFile (img, total, type) { uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/file/add', + url: this.$instance.defaults.baseURL + (process.env.NODE_ENV == 'production' ? 'api' : '') + '/file/add', filePath: img, name: 'file', header: { diff --git a/src/project/tianfuxing/AppHome/PhotoReport.vue b/src/project/tianfuxing/AppHome/PhotoReport.vue index e98c824..b7337ca 100644 --- a/src/project/tianfuxing/AppHome/PhotoReport.vue +++ b/src/project/tianfuxing/AppHome/PhotoReport.vue @@ -118,7 +118,7 @@ uploadFile (img, total) { uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/file/add', + url: this.$instance.defaults.baseURL + (process.env.NODE_ENV == 'production' ? 'api' : '') + '/file/add', filePath: img, name: 'file', header: { diff --git a/src/project/tianfuxing/AppMy/UserInfo.vue b/src/project/tianfuxing/AppMy/UserInfo.vue index 45a00c0..c97f482 100644 --- a/src/project/tianfuxing/AppMy/UserInfo.vue +++ b/src/project/tianfuxing/AppMy/UserInfo.vue @@ -87,7 +87,7 @@ onChooseAvatar (e) { this.$loading() uni.uploadFile({ - url: this.$instance.defaults.baseURL + '/file/add', + url: this.$instance.defaults.baseURL + (process.env.NODE_ENV == 'production' ? 'api' : '') + '/file/add', filePath: e.detail.avatarUrl, name: 'file', header: { From d5372942166a9fe8c2ac16431a0b260a3bd91f34 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 3 Nov 2022 11:28:10 +0800 Subject: [PATCH 05/12] bug --- src/project/tianfuxing/AppHome/AppHome.vue | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/project/tianfuxing/AppHome/AppHome.vue b/src/project/tianfuxing/AppHome/AppHome.vue index 6b7de3c..cf11acf 100644 --- a/src/project/tianfuxing/AppHome/AppHome.vue +++ b/src/project/tianfuxing/AppHome/AppHome.vue @@ -1,13 +1,13 @@