所有页面res.code替换为res.success

This commit is contained in:
mabo
2021-05-17 16:04:36 +08:00
parent a4f2fc1381
commit eeb2e94d52
49 changed files with 82 additions and 84 deletions

View File

@@ -99,7 +99,7 @@ export default {
if (this.id) {
editMemberAddress(params).then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success('编辑地址成功');
this.$emit('change', true);
this.hide();
@@ -108,7 +108,7 @@ export default {
} else {
newMemberAddress(params).then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success('新增地址成功');
this.$emit('change', true);
this.hide();
@@ -121,7 +121,7 @@ export default {
getAddrById (id) {
// 获取地址详情
getAddrDetail(id).then((res) => {
if (res.code === 200) {
if (res.success) {
console.log(res);
const data = res.result;
data.address = res.result.consigneeAddressPath.replace(/,/g, ' ');
@@ -131,7 +131,6 @@ export default {
},
getAddress (item) {
// 获取地图选择信息
console.log(item);
this.mapMsg = item;
this.$set(this.formData, 'address', item.addr);
this.$set(this.formData, 'consigneeAddressIdPath', item.addrId);

View File

@@ -164,7 +164,7 @@ export default {
// 删除商品
delGoods (id) {
delCartGoods({ skuIds: id }).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('删除成功');
this.getCartList();
cartCount().then(res => {
@@ -231,7 +231,7 @@ export default {
this.loading = true;
addCartGoods(params).then(res => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success('商品已成功添加到购物车')
} else {
this.$Message.warning(res.message);

View File

@@ -224,7 +224,7 @@ export default {
this.loading = true;
addCartGoods(params).then(res => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$router.push({path: '/shoppingCart', query: {detail: this.skuDetail, count: this.count}});
} else {
this.$Message.warning(res.message);
@@ -240,7 +240,7 @@ export default {
this.loading1 = true;
addCartGoods(params).then(res => {
this.loading1 = false;
if (res.code === 200) {
if (res.success) {
this.$router.push({path: '/pay', query: {way: 'BUY_NOW'}});
} else {
this.$Message.warning(res.message);

View File

@@ -144,13 +144,13 @@ export default {
getList () { // 获取评论列表
this.commentParams.goodsId = this.skuDetail.goodsId;
goodsComment(this.commentParams).then(res => {
if (res.code === 200) {
if (res.success) {
this.commentList = res.result.records;
this.commentTotal = res.result.total;
}
});
goodsCommentNum(this.skuDetail.goodsId).then(res => {
if (res.code === 200) {
if (res.success) {
this.commentTypeNum = res.result;
}
});

View File

@@ -72,7 +72,7 @@ export default {
if (this.useApi) {
handleRegion(params).then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.showMap = false;
this.addrContent.addr = res.result.name.replace(/,/g, ' ');
this.addrContent.addrId = res.result.id;

View File

@@ -358,7 +358,7 @@ export default {
getFilterList (params) {
// 筛选、分类 列表
APIGoods.filterList(params).then((res) => {
if (res.code === 200) {
if (res.success) {
const data = res.result;
this.tagsContent = [{
key: '品牌',

View File

@@ -221,7 +221,7 @@ export default {
content: '<p>确定要删除该商品吗?</p>',
onOk: () => {
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('删除成功');
this.getCartList();
} else {
@@ -237,7 +237,7 @@ export default {
content: '<p>确定要清空购物车吗?清空后不可恢复</p>',
onOk: () => {
APICart.clearCart().then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('清空购物车成功');
this.getCartList();
} else {
@@ -264,7 +264,7 @@ export default {
console.log(val, id);
APICart.setCartGoodsNum({ skuId: id, num: val }).then((res) => {
console.log(res);
if (res.code === 200) {
if (res.success) {
this.getCartList();
}
});
@@ -288,7 +288,7 @@ export default {
async receiveShopCoupon (item) { // 领取优惠券
let res = await APIMember.receiveCoupon(item.id)
if (res.code === 200) {
if (res.success) {
this.$set(item, 'disabled', true)
this.$Message.success('领取成功')
} else {
@@ -301,7 +301,7 @@ export default {
try {
let res = await APICart.cartGoodsAll();
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.cartList = res.result.cartList;
this.priceDetailDTO = res.result.priceDetailDTO;
this.skuList = res.result.skuList;

View File

@@ -70,7 +70,7 @@ export default {
const params = this.$route.query
goodsSkuDetail(params).then((res) => {
this.isLoading = false;
if (res.code === 200) {
if (res.success) {
const result = res.result;
const cateName = res.result.categoryName;
const cateId = result.data.categoryPath.split(',');

View File

@@ -170,7 +170,7 @@ export default {
apiGoods.goodsList(this.params)
.then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.goodsList = res.result.content;
this.total = res.result.totalElements;
}

View File

@@ -185,7 +185,7 @@ export default {
code: [{ required: true, message: '请输入手机验证码' }]
},
codeMsg: '发送验证码', // 验证码文字
interval: '', // 定时器
interval: null, // 定时器
time: 60, // 倒计时
logoImg: '' // logo图片
};
@@ -201,12 +201,12 @@ export default {
let data = JSON.parse(JSON.stringify(this.formSms));
apiLogin.smsLogin(data).then((res) => {
this.$refs.verify.show = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success('登录成功');
storage.setItem('accessToken', res.result.accessToken);
storage.setItem('refreshToken', res.result.refreshToken);
apiLogin.getMemberMsg().then((res) => {
if (res.code === 200) {
if (res.success) {
storage.setItem('userInfo', res.result);
let query = this.$route.query;
if (query.rePath) {
@@ -241,11 +241,10 @@ export default {
verificationEnums: 'LOGIN'
};
sendSms(params).then(res => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('验证码发送成功');
let that = this;
this.interval = setInterval(() => {
console.log(that.time);
that.time--;
if (that.time === 0) {
that.time = 60;
@@ -271,13 +270,13 @@ export default {
this.$refs.verify.show = false;
this.$Spin.show();
apiLogin.login(data).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('登录成功');
storage.setItem('accessToken', res.result.accessToken);
storage.setItem('refreshToken', res.result.refreshToken);
apiLogin.getMemberMsg().then((res) => {
this.$Spin.hide();
if (res.code === 200) {
if (res.success) {
storage.setItem('userInfo', res.result);
let query = this.$route.query;
if (query.rePath) {
@@ -313,12 +312,12 @@ export default {
if (uuid) {
storage.setItem('uuid', uuid);
loginCallback(uuid).then(res => {
if (res.code === 200) {
if (res.success) {
const result = res.result;
storage.setItem('accessToken', result.accessToken);
storage.setItem('refreshToken', result.refreshToken);
apiLogin.getMemberMsg().then((res) => {
if (res.code === 200) {
if (res.success) {
storage.setItem('userInfo', res.result);
let query = this.$route.query;
if (query.rePath) {

View File

@@ -120,7 +120,7 @@ export default {
},
getGoodsList () { // 商品信息
goodsList(this.params).then((res) => {
if (res.code === 200) {
if (res.success) {
this.goodsList = res.result.content;
this.total = res.result.totalElements;
}

View File

@@ -147,7 +147,7 @@ export default {
let data = JSON.parse(JSON.stringify(this.formRegist));
data.password = md5(data.password);
apiLogin.regist(data).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('注册成功!');
this.$router.push('login');
} else {
@@ -172,7 +172,7 @@ export default {
verificationEnums: 'REGISTER'
};
sendSms(params).then(res => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('验证码发送成功');
let that = this;
this.interval = setInterval(() => {

View File

@@ -160,7 +160,7 @@ export default {
let data = JSON.parse(JSON.stringify(this.formFirst));
apiLogin.validateCode(data).then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
// this.$Message.success('');
this.step = 1;
} else {
@@ -186,7 +186,7 @@ export default {
apiLogin.resetPassword(params).then(res => {
this.loading1 = false;
console.log(res);
if (res.code === 200) {
if (res.success) {
this.$Message.success('修改密码成功');
this.$router.push('login');
}
@@ -209,7 +209,7 @@ export default {
verificationEnums: 'FIND_USER'
};
sendSms(params).then(res => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('验证码发送成功');
let that = this;
this.interval = setInterval(() => {

View File

@@ -88,14 +88,14 @@ export default {
this.loading = true;
if (this.$route.query.id) {
editMemberAddress(params).then((res) => {
if (res.code === 200) {
if (res.success) {
this.loading = false;
this.$router.push('/home/MyAddress');
}
}).catch(() => { this.loading = false; });
} else {
newMemberAddress(params).then((res) => {
if (res.code === 200) {
if (res.success) {
this.loading = false;
this.$router.push('/home/MyAddress');
}
@@ -107,7 +107,7 @@ export default {
getAddrById (id) {
// 获取地址详情
getAddrDetail(id).then((res) => {
if (res.code === 200) {
if (res.success) {
console.log(res);
const data = res.result;
data.address = res.result.consigneeAddressPath.replace(/,/g, ' ');

View File

@@ -58,7 +58,7 @@ export default {
content: '你确定删除这个收货地址',
onOk: () => {
delMemberAddress(id).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('删除成功');
this.getAddrList();
}
@@ -73,7 +73,7 @@ export default {
// 获取地址列表
memberAddress().then((res) => {
console.log(res);
if (res.code === 200) {
if (res.success) {
this.list = res.result.records;
}
});

View File

@@ -311,7 +311,7 @@ export default {
content: '你确定删除这个收货地址',
onOk: () => {
delMemberAddress(item.id).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('删除成功');
this.getAddress();
}

View File

@@ -34,7 +34,7 @@
<span v-if="storeDisable == 'OPEN'">申请已通过请联系管理员</span>
<span v-if="storeDisable == 'CLOSED'">店铺已关闭重申请联系管理员</span>
</div>
<Button v-if="currentIndex == 3" @click="currentIndex = 2">返回</Button>
<Button v-if="currentIndex == 3" @click="$router.push('/')">返回</Button>
</div>
<Modal

View File

@@ -168,7 +168,7 @@ function getTokenDebounce () {
lock = true
let oldRefreshToken = Storage.getItem('refreshToken');
handleRefreshToken(oldRefreshToken).then(res => {
if (res.code === 200) {
if (res.success) {
let {
accessToken,
refreshToken