腾讯云 appid 腾讯云怎么用

LightSNS 腾讯云储存COS配置教程

腾讯云储存

1、创建储存桶

储存桶名称随便填,这个填写的名称需要填到LightSNS后台(不需要带后面的APPID)

权限选择私有

2、LightSNS后台填写

存储桶名称:就是上方的名称

储存桶所属地域:如果你选择南京就是ap-nanjing

腾讯云APPID:

腾讯云SecretId和腾讯云SecretKey

cos自定义域名:

这里需要域名别名解析

我这里配置的是CDN加速域名,你也可以配置自定义源站域名

鉴权:内网上传下行需要服务器和cos在同一地域,并且需要服务器鉴权

防盗链:

语音合成工具启动会话失败,请检查appid是否可用是怎么回事

系统问题或网络延迟

在win10都出现这个问题,win7都正常使用。这东西必须在连接网络的情况选使用,否则就会提示启动会话失败,可以检查网络,保持网络畅通的情况下使用,如果用的而是win10的系统,更换系统即可。

语音核城这些软件大都是调用的云服务,例如腾讯云或者阿里云的语音合成服务。在阿里云开发文档中找到语音合成相关文档,可以根据自己擅长的语言选择合适的sdk进行开发,调试的时候在各个demo里面修改自己accessKeyId的和在阿里云申请的相关accessKeySecret值。

扩展资料:

语音合成作为自媒体语音合成软件背后的技术,是很多程序员都需要的技术。如阿里云有应用场景和发音人供选择,而且可以细调语速和语调,目前阿里云的接口可以免费试用。

但是一次合成的文字不能超过300字。网络调试助手:在线语音合成功能,需要通过网络给阿里云发送合成请求,这个软件就是用来发送网络报文的。

uni-app 使用腾讯云im开发app聊天室

组件地址:

哪找教程引入就行,开发什么端看什么端文档

npm install tim-wx-sdk@2.15.0--save

npm install cos-wx-sdk-v5@0.7.11--save

----------------------------------------------------------

import TIM from'tim-wx-sdk';

import COS from"cos-wx-sdk-v5";

import logger from'./utils/logger';// app.js

import{ genTestUserSig} from'./debug/GenerateTestUserSig.js'

在app.vue文件下onLaunch周期里面:

/// userInfo为判断用户是否登录

if( userInfo!=''|| userInfo!= undefined){

if( uni.getStorageSync('zuserInfo').role== 1|| uni.getStorageSync('zuserInfo').role== 2){

//连接im

//如果您已经接入 tim,请将 uni.tim修改为 uni.$TUIKit。

uni.$TUIKit= TIM.create({

  SDKAppID:'  '  //填写你申请的AppID

});

uni.$TUIKit.registerPlugin({

 'cos-wx-sdk': COS

});

uni.$resetLoginData= this.resetLoginData(userInfo)

uni.$TUIKitTIM= TIM;

uni.$TUIKitEvent= TIM.EVENT;

uni.$TUIKitVersion= TIM.VERSION;

uni.$TUIKitTypes= TIM.TYPES;//监听系统级事件

uni.$TUIKit.on(uni.$TUIKitEvent.SDK_NOT_READY, this.onSdkNotReady);

uni.$TUIKit.on(uni.$TUIKitEvent.KICKED_OUT, this.onKickedOut);

uni.$TUIKit.on(uni.$TUIKitEvent.ERROR, this.onTIMError);

uni.$TUIKit.on(uni.$TUIKitEvent.NET_STATE_CHANGE, this.onNetStateChange);

uni.$TUIKit.on(uni.$TUIKitEvent.SDK_RELOAD, this.onSDKReload);

uni.$TUIKit.on(uni.$TUIKitEvent.SDK_READY, this.onSDKReady);

}

}

// TODO:

  resetLoginData(info){

let _this= this

   this.globalData.expiresIn='';

   this.globalData.sessionID='';

   this.globalData.userInfoIm={

    userID: info.userId,

    userSig: info.txSig,

    token: info.token,

    phone: info.phone

  };

   this.globalData.userProfile= null;

uni.$TUIKit.login({userID: info.userId.toString(), userSig: info.txSig.toString()})

.then(function(imResponse){

 // console.log(imResponse.data);//登录成功

// _this.getUpdateMyProfile()

  if(imResponse.data.repeatLogin=== true){

  //标识帐号已登录,本次登录操作为重复登录。v2.5.1起支持

  // console.log(imResponse.data.errorInfo);

 }

})

.catch(function(imError){

  console.warn('login error:', imError);//登录失败的相关信息

});

 },

onTIMError(){},

  onNetStateChange(){},

  onSDKReload(){},

  onSDKReady(event){

let _this= this

_this.getUpdateMyProfile()

_this.getImUnread()

},

  onSdkNotReady(){

this.getImLogin()

},

  onKickedOut(){

   uni.showToast({

    title:'您被踢下线',

    icon:'error'

  });

let userinfo=''

uni.setStorageSync('zuserInfo', userinfo)

setTimeout(()=>{

uni.redirectTo({

  url:'/pages/login/login'

});

},2000)

  // uni.navigateTo({

  //  url:'./pages/TUI-Login/login'

  //});

 },

logoutTim(){

uni.$TUIKit.logout()

},

uni.navigateTo({

url:'/pages/TUI-Chat/chat?conversationID=C2C'+ this.info.user_id

});

getImUnread(){

uni.$TUIKit.getConversationList().then(res=>{

// console.log(res.data.conversationList)

for( let i of res.data.conversationList){

if( i.unreadCount!= 0){

uni.showTabBarRedDot({index:2})

return

}

}

}).catch(fail=>{

// console.log(fail)

});

},

阅读剩余
THE END