|
@@ -3,8 +3,9 @@ import store from './store'
|
|
|
import App from './App'
|
|
|
|
|
|
// 后端api地址
|
|
|
-Vue.prototype.$unishow = "https://81f.dev.ytxxjs.cn/addons/unishop";
|
|
|
-// Vue.prototype.$unishow = "https://81fdev.dev.ytxxjs.cn/addons/unishop";
|
|
|
+//Vue.prototype.$unishow = "https://81f.dev.ytxxjs.cn/addons/unishop";
|
|
|
+//Vue.prototype.$unishow = "https://81fdev.dev.ytxxjs.cn/addons/unishop";
|
|
|
+Vue.prototype.$unishow = "https://81f.ytxxjs.cn/addons/unishop";
|
|
|
|
|
|
// 为了方便每次上传的时候忘记修改上面的参数
|
|
|
uni.getSystemInfo({
|
|
@@ -101,7 +102,7 @@ const request = async (url, method = 'GET', data = {}, showMsg = true) => {
|
|
|
'lang': Vue.prototype.$store.state.lang,
|
|
|
'platform': Vue.prototype.$platform
|
|
|
};
|
|
|
- if (Vue.prototype.$store.state.userInfo.token) {
|
|
|
+ if (Vue.prototype.$store.state.userInfo && Vue.prototype.$store.state.userInfo.token) {
|
|
|
header.token = Vue.prototype.$store.state.userInfo.token;
|
|
|
}
|
|
|
if (Vue.prototype.$store.state.cookie) {
|
|
@@ -184,6 +185,11 @@ Vue.prototype.$api = {
|
|
|
// 微信小程序
|
|
|
const wechatMiniLogin = async (noMsg = false) => {
|
|
|
if (!noMsg) msg('登录中');
|
|
|
+ if (Vue.wechatMiniLoginLock) return;
|
|
|
+ Vue.wechatMiniLoginLock = true;
|
|
|
+ Vue.wechatMiniLoginTag = setTimeout(() => {
|
|
|
+ Vue.wechatMiniLoginLock = false;
|
|
|
+ }, 10000);
|
|
|
let [error, loginRes] = await uni.login({
|
|
|
provider: 'weixin'
|
|
|
});
|
|
@@ -206,6 +212,8 @@ const wechatMiniLogin = async (noMsg = false) => {
|
|
|
return false;
|
|
|
}
|
|
|
};
|
|
|
+Vue.wechatMiniLoginLock = false;
|
|
|
+Vue.wechatMiniLoginTag = 0;
|
|
|
Vue.prototype.$wechatMiniLogin = wechatMiniLogin;
|
|
|
// #endif
|
|
|
|