Browse Source

no message

zpj 2 năm trước cách đây
mục cha
commit
7b9230015d
1 tập tin đã thay đổi với 2 bổ sung và 2 xóa
  1. 2 2
      service/router.js

+ 2 - 2
service/router.js

@@ -18,7 +18,7 @@ const router = createRouter({
 });
 //全局路由前置守卫
 
-router.beforeEach((to, from, next) => {
+router.beforeEach( async (to, from, next) => {
 	if(to.query.shopCode){
 		uni.setStorageSync("invite_code", to.query.shopCode);
 	}
@@ -56,7 +56,7 @@ router.beforeEach((to, from, next) => {
 					invite_code:uni.getStorageSync("invite_code"),
 					memberCode:uni.getStorageSync("memberCode"),
 				}
-				userWxAppletLogin(from).then((res)=>{
+				await userWxAppletLogin(from).then((res)=>{
 					if (res.code === 1) {
 						uni.setStorageSync('userNmae',res.data.name)
 						uni.setStorageSync('token_str',res.data.token)