CRMEB多商户适配最新小程序授权方案

该博客详细介绍了如何为CRMEB多商户系统配置最新的小程序授权方案。主要内容包括移动端的代码修改,提供了未进行二开时的完整代码示例,以及指定文件中方法的修改后代码。
摘要由CSDN通过智能技术生成

##############################################

点击查看详情

##############################################

对照下图修改对应文件中的代码

一. 移动端修改,如下图对应位置修改;

  1. 文件位置 : components/Authorize.vue

在这里插入图片描述

如果未做二开,完整代码如下:

<template>
	<view>
		<view class='Popup' v-if='isShowAuth'>
			<view class="logo-auth">
				<image :src='logoUrl' mode="aspectFit"></image>
			</view>
			<view class='title'>授权提醒</view>
			<view class='tip'>请授权头像等信息,以便为您提供更好的服务</view>
			<view class='bottom flex'>
				<view class='item' @click='close'>随便逛逛</view>
				<!-- #ifdef APP-PLUS -->
				<button class='item grant' @click="setUserInfo">去授权</button>
				<!-- #endif -->
				<!-- #ifdef MP -->
				<button v-if="canUseGetUserProfile" class="item grant" hover-class="none"
					@tap="getUserProfile">去授权</button>
				<button v-else class='item grant' type="primary" open-type="getUserInfo" lang="zh_CN"
					@getuserinfo="setUserInfo">去授权</button>
				<!-- #endif -->
			</view>
		</view>
		<view class='mask' v-if='isShowAuth' @click='close'></view>
	</view>
</template>

<script>
	const app = getApp();
	import Cache from '../utils/cache';
	import {
		getLogo
	} from '../api/public';
	import {
		LOGO_URL
	} from '../config/cache';
	import {
		mapGetters
	} from 'vuex';
	import Routine from '../libs/routine';

	export default {
		name: 'Authorize',
		props: {
			isAuto: {
				type: Boolean,
				default: true
			},
			isGoIndex: {
				type: Boolean,
				default: true
			},
			isShowAuth: {
				type: Boolean,
				default: false
			}
		},
		data() {
			r
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值