|
@@ -42,35 +42,35 @@ Package.prototype = {
|
|
|
|
|
|
let _t = this;
|
|
|
if (localStorage.getItem("token")) {
|
|
|
- $.ajax({
|
|
|
- type: 'PUT',
|
|
|
- url: this.settings.URL + '/videoService/accounts/token/keepalive',
|
|
|
- contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
|
|
|
- dateType: 'json',
|
|
|
- data: JSON.stringify({
|
|
|
- token: localStorage.getItem('token'),
|
|
|
- duration: 86400,
|
|
|
- }),
|
|
|
- beforeSend: function(xhr) {
|
|
|
- xhr.setRequestHeader(
|
|
|
- 'X-Subject-Token',
|
|
|
- localStorage.getItem('token'),
|
|
|
- );
|
|
|
- xhr.setRequestHeader(
|
|
|
- 'Content-Type',
|
|
|
- 'application/json;charset=UTF-8',
|
|
|
- );
|
|
|
- },
|
|
|
- success: function(jsonResult) {
|
|
|
- // setTimeout(function() {
|
|
|
- // _t.keepalive();
|
|
|
- // }, 20000);
|
|
|
- },
|
|
|
- error: function(data) {
|
|
|
- localStorage.removeItem('token');
|
|
|
- _t.login();
|
|
|
- },
|
|
|
- });
|
|
|
+ // $.ajax({
|
|
|
+ // type: 'PUT',
|
|
|
+ // url: this.settings.URL + '/videoService/accounts/token/keepalive',
|
|
|
+ // contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
|
|
|
+ // dateType: 'json',
|
|
|
+ // data: JSON.stringify({
|
|
|
+ // token: localStorage.getItem('token'),
|
|
|
+ // duration: 86400,
|
|
|
+ // }),
|
|
|
+ // beforeSend: function(xhr) {
|
|
|
+ // xhr.setRequestHeader(
|
|
|
+ // 'X-Subject-Token',
|
|
|
+ // localStorage.getItem('token'),
|
|
|
+ // );
|
|
|
+ // xhr.setRequestHeader(
|
|
|
+ // 'Content-Type',
|
|
|
+ // 'application/json;charset=UTF-8',
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ // success: function(jsonResult) {
|
|
|
+ // // setTimeout(function() {
|
|
|
+ // // _t.keepalive();
|
|
|
+ // // }, 20000);
|
|
|
+ // },
|
|
|
+ // error: function(data) {
|
|
|
+ // localStorage.removeItem('token');
|
|
|
+ // _t.login();
|
|
|
+ // },
|
|
|
+ // });
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
|
_t.login();
|