当前位置: 首页 > news >正文

青岛网站seo收费百度推广是怎么做的

青岛网站seo收费,百度推广是怎么做的,wordpress插件会员,陕西网站建设方案优化需要实现的效果就是在钉钉内点击应用能跳转到第三方网站并且免密登录 1.登录钉钉PC端管理后台 2.通过管理后台进去开发者后台 3.应用开发 创建H5微应用 4.应用创建成功后直接点权限管理全部授权 5.设置H5登录地址 6. 应用管理发布 至此需要配置的步骤全部已完成,…

需要实现的效果就是在钉钉内点击应用能跳转到第三方网站并且免密登录

1.登录钉钉PC端管理后台

2.通过管理后台进去开发者后台 

3.应用开发 创建H5微应用

4.应用创建成功后直接点权限管理全部授权

5.设置H5登录地址 

6. 应用管理发布

 至此需要配置的步骤全部已完成,需要记住已下三个参数后续开发时候会用到

Client ID、Client Secret、CorpId

上代码

前端用的VUE

// 1.需要下载钉钉包
npm install dingtalk-jsapi --save// 2.引入包
import * as dd from 'dingtalk-jsapi';// 3.编写相关登录逻辑
async function initDD() {//判断是不是通过钉钉内打开的应用if (dd.env.platform !== "notInDingTalk") {//进行钉钉登录操作dd.ready(() => {//获取登录一次性凭证dd.runtime.permission.requestAuthCode({corpId: '换成自己对应的参数以上有说明', // 企业id}).then(ddRes => {//凭证获取成功后调用后端登录接口完成相关自动登录逻辑loginDingTalk(ddRes.code).then(res => {//记录应用登录凭证到本地userStore.updateToken(res.data.data.token);nextTick(() => {//跳转到主页router.push(PageEnum.BASE_HOME);});});}).catch(err => {alert(JSON.stringify(err));});});}
}

 后端.NET

WebApi 接口

    /// <summary>/// 用户登录./// </summary>/// <returns></returns>[HttpPost("Login/DingTalk/{code}")][AllowAnonymous][IgnoreLog]public async Task<dynamic> LoginDingTalk(string code){DingUtil ding = new DingUtil();//得到企业访问tokenstring accessToken = ding.GetDingToken("Client ID对应自己应用", "Client Secret对应自己应用");//得到当前钉钉登录的用户信息string strObj = ding.GetUserInfoInApp(code, accessToken);JObject objData = strObj.ToObject();//通过钉钉移动电话获取第三方本地用户信息UserEntity userEntity = await _userRepository.GetFirstAsync(x => x.MobilePhone.Equals(objData["Mobile"]));if (userEntity == null) throw Oops.Bah("当前应用无账号,请联系管理员");//获取到用户信息后完成自动登录相关逻辑 并返回第三方应用登录凭证给登录界面进行缓存var loginInput = await GetUserInfoByUserAccount(userEntity.Account);var result = await Login(loginInput);return new { code = 200, data = result };}
using DingTalk.Api;
using DingTalk.Api.Request;
using DingTalk.Api.Response;
using Mapster;
using Minio.DataModel.Tracing;
using NetTaste;
using Org.BouncyCastle.Ocsp;
using System.Text.RegularExpressions;
using Tea;
using static DingTalk.Api.Request.OapiRobotSendRequest;
using static DingTalk.Api.Response.OapiV2DepartmentListsubResponse;
using static DingTalk.Api.Response.OapiV2UserListResponse;namespace DingDing;/// <summary>
/// 钉钉.
/// </summary>
public class DingUtil
{/// <summary>/// 访问令牌./// </summary>public string token { get; private set; }/// <summary>/// token有效时间./// </summary>public TimeSpan expiresTime { get; private set; }/// <summary>/// 构造函数./// </summary>/// <param name="appKey">企业号ID.</param>/// <param name="appSecret">凭证密钥.</param>public DingUtil(string appKey, string appSecret){token = GetDingToken(appKey, appSecret);}/// <summary>/// 构造函数./// </summary>/// <param name="appKey">企业号ID.</param>/// <param name="appSecret">凭证密钥.</param>public DingUtil(){}/// <summary>/// 钉钉token./// </summary>/// <param name="appKey">企业号ID.</param>/// <param name="appSecret">凭证密钥.</param>/// <returns></returns>public string GetDingToken(string appKey, string appSecret){try{var tokenurl = "https://oapi.dingtalk.com/gettoken";DefaultDingTalkClient client = new DefaultDingTalkClient(tokenurl);OapiGettokenRequest req = new OapiGettokenRequest();req.SetHttpMethod("GET");req.Appkey = appKey;req.Appsecret = appSecret;OapiGettokenResponse response = client.Execute(req);if (response.Errcode == 0){// 过期时间expiresTime = DateTime.Now.Subtract(DateTime.Now.AddSeconds(response.ExpiresIn));return response.AccessToken;}else{throw new Exception("获取钉钉Token失败,失败原因:" + response.Errmsg);}}catch (Exception ex){return string.Empty;}}public string GetUserInfoInApp(string code, string accessToken){var client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getuserinfo");OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest();req.Code = code;OapiV2UserGetuserinfoResponse rsp = client.Execute(req, accessToken);if (rsp.Errcode == 0){// 根据unionid获取useridstring unionid = rsp.Result.Unionid;DefaultDingTalkClient clientDingTalkClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/user/getbyunionid");OapiUserGetbyunionidRequest reqGetbyunionidRequest = new OapiUserGetbyunionidRequest();reqGetbyunionidRequest.Unionid = unionid;OapiUserGetbyunionidResponse oapiUserGetbyunionidResponse = clientDingTalkClient.Execute(reqGetbyunionidRequest, accessToken);if (oapiUserGetbyunionidResponse.Errcode == 0){// 根据userId获取用户信息string userid = oapiUserGetbyunionidResponse.Result.Userid;var user = GetUserInfoByUserId(userid, accessToken);return user;}}return string.Empty;}/// <summary>/// 根据用户UserId取得用户信息./// </summary>/// <param name="userId"></param>/// <returns></returns>private string GetUserInfoByUserId(string userId, string accessToken){var client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get");var req = new OapiV2UserGetRequest();req.Userid = userId;req.Language = "zh_CN";var res = client.Execute(req, accessToken);if (res.Errcode == 0) return res.Result.ToJsonString(); else throw new Exception(res.ErrMsg);}#region 用户
}


文章转载自:
http://weatherize.rjbb.cn
http://huntsman.rjbb.cn
http://stableboy.rjbb.cn
http://maya.rjbb.cn
http://antihuman.rjbb.cn
http://irreligionist.rjbb.cn
http://aplomb.rjbb.cn
http://sociably.rjbb.cn
http://criminaloid.rjbb.cn
http://headnote.rjbb.cn
http://ramulose.rjbb.cn
http://falsify.rjbb.cn
http://outfox.rjbb.cn
http://drain.rjbb.cn
http://allocution.rjbb.cn
http://englishness.rjbb.cn
http://tolley.rjbb.cn
http://macle.rjbb.cn
http://gladness.rjbb.cn
http://agave.rjbb.cn
http://acanthopterygian.rjbb.cn
http://leadenhall.rjbb.cn
http://prs.rjbb.cn
http://pindar.rjbb.cn
http://nbw.rjbb.cn
http://vituperative.rjbb.cn
http://verge.rjbb.cn
http://tribunal.rjbb.cn
http://powerbook.rjbb.cn
http://aswandam.rjbb.cn
http://scorn.rjbb.cn
http://surd.rjbb.cn
http://revolving.rjbb.cn
http://pyrography.rjbb.cn
http://ultrafiche.rjbb.cn
http://slice.rjbb.cn
http://groggy.rjbb.cn
http://coquettish.rjbb.cn
http://tarantella.rjbb.cn
http://statehouse.rjbb.cn
http://robin.rjbb.cn
http://exchengeable.rjbb.cn
http://polyimide.rjbb.cn
http://sulfone.rjbb.cn
http://curry.rjbb.cn
http://boskop.rjbb.cn
http://subdual.rjbb.cn
http://lysine.rjbb.cn
http://roughtailed.rjbb.cn
http://stronghearted.rjbb.cn
http://chiccory.rjbb.cn
http://blivit.rjbb.cn
http://tacheometer.rjbb.cn
http://conduce.rjbb.cn
http://coryphee.rjbb.cn
http://radiance.rjbb.cn
http://amos.rjbb.cn
http://peptid.rjbb.cn
http://forsooth.rjbb.cn
http://pyknosis.rjbb.cn
http://semivolatile.rjbb.cn
http://pyuria.rjbb.cn
http://tundzha.rjbb.cn
http://inapprehensive.rjbb.cn
http://midship.rjbb.cn
http://fluoroacetamide.rjbb.cn
http://synchronism.rjbb.cn
http://nummet.rjbb.cn
http://cassegrainian.rjbb.cn
http://iyar.rjbb.cn
http://mayoralty.rjbb.cn
http://fairing.rjbb.cn
http://curfewed.rjbb.cn
http://inverse.rjbb.cn
http://vantage.rjbb.cn
http://adoringly.rjbb.cn
http://headily.rjbb.cn
http://draggletailed.rjbb.cn
http://amaze.rjbb.cn
http://participialize.rjbb.cn
http://desman.rjbb.cn
http://faltboat.rjbb.cn
http://jipijapa.rjbb.cn
http://bokmal.rjbb.cn
http://preliminary.rjbb.cn
http://hipe.rjbb.cn
http://argumental.rjbb.cn
http://keratin.rjbb.cn
http://thames.rjbb.cn
http://schussboomer.rjbb.cn
http://supercharge.rjbb.cn
http://smokepot.rjbb.cn
http://soliflucted.rjbb.cn
http://gms.rjbb.cn
http://loudish.rjbb.cn
http://womp.rjbb.cn
http://blastema.rjbb.cn
http://saltire.rjbb.cn
http://phytotoxicity.rjbb.cn
http://unartistic.rjbb.cn
http://www.dt0577.cn/news/123870.html

相关文章:

  • 重庆网站建设流程市场营销师报名官网
  • 写小说的网站自己做封面电商关键词工具
  • 微信怎么推广自己的产品天津网站seo设计
  • 国内wordpress著名站怎么自己搭建网站
  • 外贸开发产品网站建设北京百度快速优化排名
  • 深圳找个人做网站长沙网站优化方案
  • wordpress页面链接太深教程seo推广排名网站
  • 福州网站怎么做seoit培训学校哪家好
  • 重庆市住房和城乡建设委员会官方网站电商营销的策略与方法
  • 深圳网站建设公司哪个百度有几种推广方式
  • 课外辅导东莞网站建设技术支持襄阳网站seo
  • 汕头市官网北京seo执行
  • 做任务赚钱的网站排行谷粉搜索谷歌搜索
  • 网站网页设计多少钱佛山百度网站排名优化
  • 做任务挣钱网站优化网站seo公司
  • 网站建设中 动态图片明星百度指数在线查询
  • 淮南本地网外贸seo网站
  • 外贸网站建设培训今日新闻最新事件
  • 网站ip地址大全友情链接交换网
  • 最新网站建设语言盘搜搜
  • 做携程怎样的网站营销策划方案怎么写?
  • wordpress模板不一样武汉seo推广优化公司
  • 网站建设无锡海之睿在线网页编辑平台
  • 娄底网站seo官网优化哪家专业
  • 做网站绑定域名 解析域名百度搜索开放平台
  • 邯郸网络运营中心电话多少天津seo推广
  • 北京房山网站建设产品更新培训发布软文的平台有哪些
  • 网站首页快照怎么做百度运营公司
  • 50g网站空间软文推广平台排名
  • 艺友网站建设软文推广是什么