|
@@ -131,6 +131,11 @@ Page({
|
|
|
article,
|
|
|
brief
|
|
|
} = this.data;
|
|
|
+ const Authorization = wx.getStorageSync('token') || undefined;
|
|
|
+ if (Authorization) return wx.showToast({
|
|
|
+ title: '请登录后在提交',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
let baseArea = this.data.multiArray[0][this.data.multiIndex[0]] + this.data.multiArray[1][this.data.multiIndex[1]];
|
|
|
if (this.data.multiArray[2] && this.data.multiArray[2][this.data.multiIndex[2]]) baseArea += this.data.multiArray[2][this.data.multiIndex[2]]
|
|
|
if (isNaN(phone)) return wx.showToast({
|
|
@@ -148,7 +153,7 @@ Page({
|
|
|
filePath: local_image_url,
|
|
|
name: 'file',
|
|
|
header: {
|
|
|
- Authorization: wx.getStorageSync('token') || undefined,
|
|
|
+ Authorization
|
|
|
},
|
|
|
formData: {
|
|
|
name: author,
|
|
@@ -167,7 +172,7 @@ Page({
|
|
|
wx.hideLoading()
|
|
|
},
|
|
|
success: res => {
|
|
|
- if(res.statusCode !== 200) {
|
|
|
+ if (res.statusCode !== 200) {
|
|
|
const data = JSON.parse(res.data || "{}")
|
|
|
wx.showToast({
|
|
|
title: data.message || "保存失败",
|
|
@@ -192,6 +197,14 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
+ if (!wx.getStorageSync('phone')) {
|
|
|
+ const pages = getCurrentPages();
|
|
|
+ const thisPage = pages[pages.length - 1];
|
|
|
+ wx.reLaunch({
|
|
|
+ url: "/pages/login/index?backurl=" + thisPage.route
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.getArea();
|
|
|
|
|
|
},
|
|
@@ -242,6 +255,9 @@ Page({
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage() {
|
|
|
-
|
|
|
+ return {
|
|
|
+ title: __wxConfig.accountInfo.nickname,
|
|
|
+ path: "/pages/index/index"
|
|
|
+ }
|
|
|
}
|
|
|
})
|