Commit 46de6851 by liang ce

token更新

parent 1644de7d
...@@ -38,6 +38,8 @@ function getToken () { ...@@ -38,6 +38,8 @@ function getToken () {
console.log(res.data.resultCode) console.log(res.data.resultCode)
if (res.data.resultCode === 0) { if (res.data.resultCode === 0) {
return res.data.data.mingUserId return res.data.data.mingUserId
} else if (res.data.resultCode === 40003) {
return Promise.reject(new Error('无权登录'))
} }
}).then((mingUserId) => { }).then((mingUserId) => {
let loginData = qs.stringify({ let loginData = qs.stringify({
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<label>分类名称:</label><a-input v-model="productCategoryName" placeholder="请输入分类名称"/> <label>分类名称:</label><a-input v-model="productCategoryName" placeholder="请输入分类名称"/>
</div> </div>
<div class="item"> <div class="item">
<label>排序值:</label><a-input v-model="sort" placeholder="排序值为数字"/> <label>排序值:</label><a-input v-model="sort" placeholder="排序值为正整数"/>
</div> </div>
</a-modal> </a-modal>
</div> </div>
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
let that = this let that = this
let reg = '^[0-9]*$' let reg = '^[0-9]*$'
if (!/^[0-9]*$/.test(this.sort)) { if (!/^[0-9]*$/.test(this.sort)) {
this.$message.error('排序值为数字') this.$message.error('排序值为正整数')
return false return false
} }
if (this.productCategoryName === '') { if (this.productCategoryName === '') {
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<label>设置价格:</label><a-input v-model="addProduct.productPrice" placeholder="请输入菜品单价(元/份))"/> <label>设置价格:</label><a-input v-model="addProduct.productPrice" placeholder="请输入菜品单价(元/份))"/>
</div> </div>
<div class="item"> <div class="item">
<label>排序值:</label><a-input v-model="addProduct.sort" placeholder="请输入"/> <label>排序值:</label><a-input v-model="addProduct.sort" placeholder="排序值为正整数"/>
</div> </div>
<div class="item"> <div class="item">
<label>上传图片:</label> <label>上传图片:</label>
...@@ -361,7 +361,7 @@ export default { ...@@ -361,7 +361,7 @@ export default {
return return
} }
if (!/^[0-9]*$/.test(this.addProduct.sort)) { if (!/^[0-9]*$/.test(this.addProduct.sort)) {
this.$message.error('排序值为数字') this.$message.error('排序值为正整数')
return false return false
} }
if (!this.addProduct.uploadSuccess || !this.addProduct.productName || !this.addProduct.productPrice || !this.addProduct.productIcon || !this.addProduct.sort) { if (!this.addProduct.uploadSuccess || !this.addProduct.productName || !this.addProduct.productPrice || !this.addProduct.productIcon || !this.addProduct.sort) {
......
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