refactor(app): 重构获取 appId 方法

- 使用 uni.getAccountInfoSync().miniProgram 替代 uni.getExtConfigSync()
- 更新相关页面和组件中的 appId 获取逻辑
- 修改 ext.json 中的 app_id 字段为 appId
- 统一代码风格,提高代码可维护性
lu_quan_dev
Tuzki 8 months ago
parent 114befaa04
commit 50b1c70a40
  1. 5
      components/f-login/f-login.js
  2. 4
      components/f-login/f-login.vue
  3. 6
      ext.json
  4. 2
      subPageA/components/sy-audio/utils/jweixin.js
  5. 4
      subPageC/Ai/index.vue
  6. 4
      subPageC/bookHomestay/bookHomestay.vue
  7. 4
      subPageC/bookShop/bookShop.vue
  8. 4
      subPageC/bookTicket/bookTicket.vue
  9. 5
      subPageC/order/order.vue
  10. 4
      subPageC/orderHomestay/orderList.vue
  11. 4
      subPageC/orderShop/orderList.vue

@ -6,10 +6,11 @@ import HttpConfig from '@/common/config'
function getPhoneInfo(info, successCallback, errCallback) {
let httpData = {}
// #ifdef MP-WEIXIN
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
// const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : uni.getAccountInfoSync();//创巨圆商户平台管理
const extConfig = uni.getAccountInfoSync();
console.log(extConfig,'获取appiod')
httpData = {
appId: extConfig.app_id,
appId: extConfig.appId,
code: info.code, //小程序code
iv: info.iv, //小程序加密算法的初始向量
encryptedData: info.encryptedData, //包括敏感数据在内的完整用户信息的加密数据

@ -105,8 +105,8 @@ export default {
// token
let phone = res.phone;
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
uni.login({
success: (ras) => {
HttpRequest.post(

@ -1,8 +1,8 @@
{
"extEnable": true,
"extEnable": false,
"extAppid": "wx43f2232676218ce3",
"directCommit": true,
"directCommit": false,
"ext": {
"app_id": "wx43f2232676218ce3"
"appId": "wx43f2232676218ce3"
}
}

File diff suppressed because one or more lines are too long

@ -127,8 +127,8 @@
},
onShow() {
const userInfo = uni.getStorageSync("userInfo");
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
this.param.openid = userInfo.openid
this.param.appid = appId

@ -158,8 +158,8 @@
orderSubmit() {
this.$refs.form.validate().then(res => {
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
var data = {
"hotelId": this.orderInfo.hotelId,

@ -119,8 +119,8 @@
orderSubmit() {
this.$refs.form.validate().then(res => {
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
console.log("|this.formData", this.formData, this.orderInfo)
var data = {

@ -1238,8 +1238,8 @@ export default {
}
// }
const userInfo = uni.getStorageSync("userInfo");
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
const params = {
openid: userInfo.openid,
appid: appId,

@ -354,9 +354,8 @@ export default {
loadData(pageNo) {
let that = this
const userInfo = uni.getStorageSync("userInfo");
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
console.log(uni.getExtConfigSync(), 'extConfigextConfigextConfig')
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
let httpData = {
openid: userInfo.openid,

@ -165,8 +165,8 @@
loadData() {
// TODO: appId openId
const userInfo = uni.getStorageSync("userInfo");
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
this.param.openid = userInfo.openid
this.param.appid = appId

@ -141,8 +141,8 @@ export default {
loadData() {
// TODO: appId openId
const userInfo = uni.getStorageSync("userInfo");
const extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {};
let appId = extConfig.app_id
const extConfig = uni.getAccountInfoSync().miniProgram;
let appId = extConfig.appId
this.param.openid = userInfo.openid
this.param.appid = appId
// this.param.openid = "oohzD5b7g4hNA1qJyAwlSA5H4NCY"

Loading…
Cancel
Save