Browse Source

修改样式

master
前端-胡立永 5 months ago
parent
commit
8419b03a12
4 changed files with 27 additions and 10 deletions
  1. +3
    -3
      api/api.js
  2. +3
    -2
      api/http.js
  3. +4
    -0
      pages/login/login.vue
  4. +17
    -5
      utils/utils.js

+ 3
- 3
api/api.js View File

@ -13,13 +13,13 @@ const config = {
//获取商品信息
getPayShopOne : {url : '/pay-api/info/getPayShopOne', method : 'GET'},
//创建支付订单
createPayOrder : {url : '/pay-api/info/createPayOrder', method : 'POST', limit : 2000},
createPayOrder : {url : '/pay-api/info/createPayOrder', method : 'POST', limit : 2000, showLoading : true},
//获取个人信息
getInfo : {url : '/pay-api/info/getInfo', method : 'GET'},
getInfo : {url : '/pay-api/info/getInfo', method : 'GET', showLoading : true},
//获取订单列表
getPayOrderPage : {url : '/pay-api/info/getPayOrderPage', method : 'GET'},
//修改个人信息
updateInfo : {url : '/pay-api/info/updateInfo', method : 'POST', limit : 500},
updateInfo : {url : '/pay-api/info/updateInfo', method : 'POST', limit : 500, showLoading : true},
//获取隐私政策
getPrivacyPolicy : {url : '/pay-api/login/getPrivacyPolicy', method : 'GET', limit : 500},
//获取用户协议


+ 3
- 2
api/http.js View File

@ -6,7 +6,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
if(showLoading){
uni.showLoading({
title: title || '正在提交...'
title: title || '加载中...'
});
}
@ -25,7 +25,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
}
if(res.statusCode == 401 ||
res.data.message == '操作失败,token非法无效!'){
res.data.message == '操作失败,token非法无效!' ||
res.data.message == "操作失败,用户不存在!"){
uni.removeStorageSync('token')
console.error('登录过期');
uni.navigateTo({


+ 4
- 0
pages/login/login.vue View File

@ -66,6 +66,10 @@
icon:'none'
})
}
console.log(1);
this.$store.commit('login')
this.$store.commit('login')
},


+ 17
- 5
utils/utils.js View File

@ -34,19 +34,31 @@ function generateLightRandomColor() {
return color;
}
function verificationAll(data){
function verificationAll(data, msg){
let Msgs = {
default : msg || '表单数据未填写'
}
if(typeof msg == 'object'){
Msgs = {
default : '表单数据未填写',
...msg,
}
}
if (!data){
uni.showToast({
title: '表单数据未填写',
icon: "error"
title: Msgs.default,
icon: "none"
})
return true
}
for (let key in data) {
if (!data[key] || data[key] === "") {
uni.showToast({
title: '必填数据未填写' + key,
icon: "error"
title: (Msgs[key] || Msgs.default),
icon: "none"
})
return true
}


Loading…
Cancel
Save