From 547939398c28027ec92314c29663fa309d37fe4c Mon Sep 17 00:00:00 2001 From: lzx <2602107437@qq.com> Date: Sun, 3 Sep 2023 22:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env.js | 26 +++++++++++------------ pages/jianhua/index.vue | 7 ++++++- pages/my/login-kehu.vue | 56 ++++++++++++++++++++++++------------------------- 3 files changed, 47 insertions(+), 42 deletions(-) diff --git a/env.js b/env.js index ecdeb1f..89ad530 100644 --- a/env.js +++ b/env.js @@ -1,24 +1,24 @@ // .env.js 文件 // 不同环境访问不同的路径 // import store from '@/common/store/index' -// const ENV_API_URL = { -// development: 'https://jobadmin.java996.icu', //开发环境 -// production: 'https://jobadmin.java996.icu', //生产环境 -// } -// const ENV_BASE_URL = { -// development: 'https://jobadmin.java996.icu', //开发环境 -// production: 'https://jobadmin.java996.icu', //生产环境 -// } - const ENV_API_URL = { - development: 'http://localhost:8091', //开发环境 - production: 'http://localhost:8091', //生产环境 + development: 'https://jobadmin.java996.icu', //开发环境 + production: 'https://jobadmin.java996.icu', //生产环境 } const ENV_BASE_URL = { - development: 'http://localhost:8091', //开发环境 - production: 'http://localhost:8091', //生产环境 + development: 'https://jobadmin.java996.icu', //开发环境 + production: 'https://jobadmin.java996.icu', //生产环境 } +// const ENV_API_URL = { +// development: 'http://localhost:8091', //开发环境 +// production: 'http://localhost:8091', //生产环境 +// } +// const ENV_BASE_URL = { +// development: 'http://localhost:8091', //开发环境 +// production: 'http://localhost:8091', //生产环境 +// } + export const BASE_URL = ENV_BASE_URL[process.env.NODE_ENV || 'development']; //后台根域名 diff --git a/pages/jianhua/index.vue b/pages/jianhua/index.vue index cf9dd88..4cad513 100644 --- a/pages/jianhua/index.vue +++ b/pages/jianhua/index.vue @@ -79,6 +79,7 @@ shopList:[], params:{ classId:'1623505640888492033', + labelClass:'1623505640888492033', pageNo:1, pageSize:10, total: null, @@ -145,7 +146,11 @@ //获取兼职信息 getShopList(){ uni.showLoading() - this.$api('getJobShopList',this.params) + this.$api('getJobShopList',{ + labelClass:'1623505640888492033', + pageNo:this.params.pageNo, + pageSize:this.params.pageSize, + }) .then(res=>{ uni.hideLoading(); if(res.code == 200){ diff --git a/pages/my/login-kehu.vue b/pages/my/login-kehu.vue index 54e57bf..6067b95 100644 --- a/pages/my/login-kehu.vue +++ b/pages/my/login-kehu.vue @@ -72,28 +72,28 @@ }) }, logionClick(){ - let actoken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTA4NjAxNjgsInVzZXJuYW1lIjoib2ROdHc2dEJVNmMxenlnU1lmb2d4ZWdTX2xxbyJ9.OfGbI5WQJYA_wMUUz-BlGHunkLTO0aNoTyOgEdyt8UQ"; - this.$store.commit('set_userToken',actoken); - uni.switchTab({ - url:'/pages/my/index' - }) - let did = uni.getStorageSync("did"); - if (did) { - uni.navigateTo({ - url:'/pages/home/course-detial?id=' + did - }) - } else { - uni.switchTab({ - url:'/pages/my/index' - }) - } - // if(this.code){ - // //直接去登录发起请求 - // this.toWxLogin() + // let actoken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTA4NjAxNjgsInVzZXJuYW1lIjoib2ROdHc2dEJVNmMxenlnU1lmb2d4ZWdTX2xxbyJ9.OfGbI5WQJYA_wMUUz-BlGHunkLTO0aNoTyOgEdyt8UQ"; + // this.$store.commit('set_userToken',actoken); + // uni.switchTab({ + // url:'/pages/my/index' + // }) + // let did = uni.getStorageSync("did"); + // if (did) { + // uni.navigateTo({ + // url:'/pages/home/course-detial?id=' + did + // }) // } else { - // //获取code 静默授权 - // this.getwx_authorize(); + // uni.switchTab({ + // url:'/pages/my/index' + // }) // } + if(this.code){ + //直接去登录发起请求 + this.toWxLogin() + } else { + //获取code 静默授权 + this.getwx_authorize(); + } }, toWxLogin(code){ this.vid= uni.getStorageSync("ivcode"); @@ -124,14 +124,14 @@ }, getwx_authorize(){ console.log("进入了这") - this.logionClick() - // let vid = uni.getStorageSync("ivcode"); - // //授权的回调地址 - // let redirect_uri = encodeURIComponent('https://job.java996.icu/pages/my/login-kehu'); - // //这是我们公众号的appid - // let appid = 'wx6fb4a17b28186d58'; - // //修改授权参数 - // window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+'&redirect_uri='+redirect_uri+'&response_type=code&scope=snsapi_userinfo&state='+vid+'&connect_redirect=1#wechat_redirect'; + // this.logionClick() + let vid = uni.getStorageSync("ivcode"); + //授权的回调地址 + let redirect_uri = encodeURIComponent('https://job.java996.icu/pages/my/login-kehu'); + //这是我们公众号的appid + let appid = 'wx6fb4a17b28186d58'; + //修改授权参数 + window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+'&redirect_uri='+redirect_uri+'&response_type=code&scope=snsapi_userinfo&state='+vid+'&connect_redirect=1#wechat_redirect'; }, //获取url中参数的方法 GetQueryString(name) {