Since users hope that more managers can participate in the management and monitoring of different channels of the platform, we have upgraded the existing video platform and added the function of binding roles and permissions. Therefore, in order to adapt to the new functions of the platform, the new software system, TSINGSEE Video has modified the token authentication mechanism in its existing cloud side architecture products. Thanks to the new version of this mechanism, the way we integrate calls has also changed.

This article shares the following example of interface invocation after the token mechanism of the video platform is modified:

1. Obtain the login token

$(" # login "). Click (function () {/ / login $. Ajax ({type: "GET", url: "http://218.92.168.42:10800/api/v1/login? username=easynvr&password=94d06a22efb9259da3a712cf125ef26d", success: function(data) { token=data.EasyDarwin.Body.Token console.log(data); }}); });Copy the code

2. Bind the obtained token for use

You can directly access the token of the login interface through get in subsequent authentication. The Key name is the token. Vlaue is the data obtained after a successful login.

$(" # modify "). Click (function () {$. Ajax ({type: "Get", url: "http://218.92.168.42:10800/api/v1/getchannelsconfig? token="+token, success: function (data) { console.log(data); }})});Copy the code

Effect display after successful call: