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

master
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

View File

@ -125,7 +125,7 @@ function getTokenDebounce() {
lock = true
let oldRefreshToken = getStore("refreshToken");
handleRefreshToken(oldRefreshToken).then(res => {
if (res.code === 200) {
if (res.success) {
let {
accessToken,
refreshToken

View File

@ -133,7 +133,7 @@ export default {
pageClientType: "PC",
};
API_floor.getHomeList(params).then((res) => {
if (res.code == 200) {
if (res.success) {
this.templateList = res.result.records;
}
});
@ -142,7 +142,7 @@ export default {
releaseTemplate(id) {
//
API_floor.releasePageHome(id).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success("发布模板成功");
this.getTemplateList();
}
@ -155,7 +155,7 @@ export default {
content: "<p>确定删除该模板吗?</p>",
onOk: () => {
API_floor.removePageHome(id).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success("删除模板成功");
this.getTemplateList();
}

View File

@ -153,7 +153,7 @@ export default {
pageClientType: "PC",
};
API_floor.getHomeList(params).then((res) => {
if (res.code == 200) {
if (res.success) {
this.list = res.result.records;
this.list.forEach(e => {
if (e.pageShow === 'OPEN') {
@ -169,7 +169,7 @@ export default {
releaseTemplate(id) {
//
API_floor.releasePageHome(id).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success("发布模板成功");
this.getTemplateList();
}
@ -178,7 +178,7 @@ export default {
delTemplate(id) {
API_floor.removePageHome(id).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success("删除模板成功");
this.getTemplateList();
}

View File

@ -51,7 +51,7 @@ export default {
pageData:modelForm,
}
API_floor.updateHome(this.$route.query.id, data).then(res=> {
if(res.code === 200) {
if(res.success) {
this.$Message.success('保存模板成功');
} else {
this.$Message.error(res.message)
@ -63,7 +63,7 @@ export default {
},
getTemplateItem(id){ //
API_floor.getHomeData(id).then(res => {
if (res.code === 200) {
if (res.success) {
let pageData = res.result.pageData;
if(pageData) {
pageData = JSON.parse(pageData);

View File

@ -136,7 +136,7 @@ export default {
})
.then((res) => {
this.num = 50;
if (res.code == 200) {
if (res.success) {
this.num = 80;
/**制作保存成功动画¸ */
setTimeout(() => {
@ -166,7 +166,7 @@ export default {
API_Other.setHomeSetup(submitWay)
.then((res) => {
this.num = 50;
if (res.code == 200) {
if (res.success) {
this.num = 80;
/**制作保存成功动画¸ */
setTimeout(() => {

View File

@ -430,7 +430,7 @@ export default {
content: "<p>确认禁用此会员?</p>",
onOk: () => {
API_Member.updateMemberStatus(params).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success("禁用成功");
this.getData();
} else {

View File

@ -421,7 +421,7 @@
content: '<p>确认禁用此会员?</p>',
onOk: () => {
API_Member.updateMemberStatus(params).then(res => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('禁用成功');
this.getData()
} else {
@ -446,7 +446,7 @@
content: '<p>启用用此会员?</p>',
onOk: () => {
API_Member.updateMemberStatus(params).then(res => {
if (res.code === 200) {
if (res.success) {
this.$Message.success('禁用成功');
this.getData()
} else {

View File

@ -58,7 +58,7 @@ methods: {
townName: this.addrContent.regeocode.addressComponent.township
}
getRegion(params).then(res=>{
if(res.code == 200) {
if(res.success) {
this.addrContent.addr = res.result.name.replace(/,/g," ")
this.addrContent.addrId = res.result.id
this.loading = false

View File

@ -254,7 +254,7 @@ export default {
content: "<p>您确定要收款吗?线下收款涉及库存变更,需异步进行,等待约一分钟刷新列表查看</p>",
onOk: () => {
API_Order.orderPay(v.sn).then((res) => {
if (res.code === 200) {
if (res.success) {
this.$Message.success("收款成功");
this.getDataList();
} else {

View File

@ -389,7 +389,7 @@ export default {
pass() {
API_Shop.pay(this.id).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success(res.message);
this.init();
}

View File

@ -761,7 +761,7 @@ export default {
API_Setting.addSmsTemplatePage(this.templateForm)
.then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success("添加成功");
this.loading = false;
this.templateModalVisible = false;
@ -775,7 +775,7 @@ export default {
API_Setting.editSmsTemplatePage(this.templateForm)
.then((res) => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success("修改成功");
this.loading = false;
this.templateModalVisible = false;

View File

@ -124,7 +124,7 @@
if (this.id == undefined) {
API_Setting.addSmsSign(this.form).then(res => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success('添加成功');
this.$router.back()
}
@ -134,7 +134,7 @@
} else {
API_Setting.editSmsSign(this.form).then(res => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.$Message.success('修改成功');
this.$router.back()
}
@ -150,7 +150,7 @@
getSmsSignDetail() {
API_Setting.smsSignDetail(this.id).then(res => {
this.loading = false;
if (res.code === 200) {
if (res.success) {
this.form = res.result
}
})

View File

@ -84,7 +84,7 @@ export default {
setSetting(this.type, {
qqConnectSettingItemList: this.formValidate,
}).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
this.$Modal.remove();
} else {

View File

@ -82,7 +82,7 @@ export default {
setSetting(this.type, {
wechatConnectSettingItems: this.formValidate,
}).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
this.$Modal.remove();
} else {

View File

@ -54,7 +54,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -104,7 +104,7 @@ export default {
setupSetting() {
setSetting(this.type, { paymentSupportItems: this.formValidate }).then(
(res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
this.$Modal.remove();
} else {

View File

@ -60,7 +60,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -103,7 +103,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -99,7 +99,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -47,7 +47,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -71,7 +71,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -53,7 +53,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -80,7 +80,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -50,7 +50,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -42,7 +42,7 @@ export default {
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -72,7 +72,7 @@
},
saveSetting() {
setSetting("SMS_SETTING", this.form).then((res) => {
if (res.code == 200) {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");

View File

@ -124,7 +124,7 @@ function getTokenDebounce() {
lock = true
let oldRefreshToken = getStore("refreshToken");
handleRefreshToken(oldRefreshToken).then(res => {
if (res.code === 200) {
if (res.success) {
let {
accessToken,
refreshToken

View File

@ -58,7 +58,7 @@ methods: {
townName: this.addrContent.regeocode.addressComponent.township
}
getRegion(params).then(res=>{
if(res.code == 200) {
if(res.success) {
this.addrContent.addr = res.result.name.replace(/,/g," ")
this.addrContent.addrId = res.result.id
this.loading = false

View File

@ -478,7 +478,7 @@ export default {
onOk: () => {
API_Shop.reconciliation(this.id).then((res) => {
this.$Modal.remove();
if (res.code == 200) {
if (res.success) {
this.$Message.success("账单核对成功");
this.init();
}

View File

@ -165,7 +165,7 @@
onOk: () => {
API_Shop.logisticsChecked(v.id).then((res) => {
this.$Modal.remove();
if (res.code == 200) {
if (res.success) {
this.$Message.success("物流公司开启成功");
this.init();
}
@ -183,7 +183,7 @@
onOk: () => {
API_Shop.logisticsUnChecked(v.selected).then((res) => {
this.$Modal.remove();
if (res.code == 200) {
if (res.success) {
this.$Message.success("物流公司关闭成功");
this.init();
}

View File

@ -320,7 +320,7 @@
onOk: () => {
API_Shop.deleteShopAddress(v.id).then((res) => {
this.$Modal.remove();
if (res.code == 200) {
if (res.success) {
this.$Message.success("此自自提地址已删除");
this.init();
}