diff --git a/config/app.js b/config/app.js
index d77d582..a1d384d 100644
--- a/config/app.js
+++ b/config/app.js
@@ -1,8 +1,8 @@
let BASE_URL
import store from "@/store/user.js"
// 环境
-let env = "dev"
-// let env = "prod"
+// let env = "dev"
+let env = "prod"
switch(env){
case 'prod': BASE_URL = 'https://ceshi-erp.lihaink.cn';break;
diff --git a/pages.json b/pages.json
index 515ed85..69412e3 100644
--- a/pages.json
+++ b/pages.json
@@ -9,20 +9,19 @@
}
},
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
- {
- "path": "pages/index/index",
- "style": {
- "navigationBarTitleText": "购物",
- "disableScroll": true,
- "navigationStyle": "custom"
- }
- },
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
-
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/index/index",
+ "style": {
+ "navigationBarTitleText": "购物",
+ "disableScroll": true,
"navigationStyle": "custom"
}
},
diff --git a/pages/login/login.vue b/pages/login/login.vue
index b38b91f..a0ebc1e 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -75,15 +75,23 @@
const isAgree = ref(false); //是否同意协议
const weixinLogin = () => {
- if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议')
-
+ if (!isAgree.value) return uni.$u.toast('请先阅读并同意协议');
+ uni.showLoading({
+ title: '登录中'
+ })
uni.login({
provider: 'weixin',
success: (res) => {
userLoginWeixinApi({
code: res.code
}).then(res=>{
- console.log(res);
+ userStore.setUserInfo(res.data);
+ userStore.setToken(res.data.token);
+ uni.hideLoading();
+ if(!res.data.supplier) uni.reLaunch({
+ url: '/pages/index/index'
+ })
+ else uni.$u.toast('功能开发中')
})
},
fail: (err) => {
diff --git a/pages/my/my.vue b/pages/my/my.vue
index d7041e3..6bbfaed 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -6,10 +6,10 @@
-
+
- 151****6699
- ID: 6655
+ {{userInfo.nickname}}
+ ID: {{userInfo.id}}
@@ -56,6 +56,11 @@