|
@@ -22,6 +22,7 @@ class AccountAuth {
|
|
this._socket.on('disconnect', this.onDisconnect);
|
|
this._socket.on('disconnect', this.onDisconnect);
|
|
|
|
|
|
this.authed = false;
|
|
this.authed = false;
|
|
|
|
+ this.sqlauthed = false;
|
|
}
|
|
}
|
|
|
|
|
|
onConnect = () => {
|
|
onConnect = () => {
|
|
@@ -37,9 +38,17 @@ class AccountAuth {
|
|
}, (data) => {
|
|
}, (data) => {
|
|
// console.log("OK, got into login-callback");
|
|
// console.log("OK, got into login-callback");
|
|
// console.log(JSON.stringify(data));
|
|
// console.log(JSON.stringify(data));
|
|
|
|
+ this.sqlauthed = true;
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ console.log("检查获取数据上传权限 ", this.sqlauthed);
|
|
|
|
+ if(!this.sqlauthed){
|
|
|
|
+ alert("获取数据上传权限失败!")
|
|
|
|
+ }
|
|
|
|
+ }, 5000);
|
|
|
|
+
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
let token = localStorage.getItem("user_token");
|
|
let token = localStorage.getItem("user_token");
|
|
if(token){
|
|
if(token){
|
|
@@ -223,6 +232,10 @@ class AccountAuth {
|
|
}
|
|
}
|
|
|
|
|
|
cteateMapData(user_id, map_name = 'map'){
|
|
cteateMapData(user_id, map_name = 'map'){
|
|
|
|
+ if(!this.sqlauthed){
|
|
|
|
+ console.log("未获取数据上传权限!");
|
|
|
|
+ alert("未获取数据上传权限!");
|
|
|
|
+ }
|
|
var sql = `INSERT INTO
|
|
var sql = `INSERT INTO
|
|
medba.dat_map
|
|
medba.dat_map
|
|
(map_name, map_data, user_id, update_time, create_time, map_uuid)
|
|
(map_name, map_data, user_id, update_time, create_time, map_uuid)
|
|
@@ -247,6 +260,10 @@ class AccountAuth {
|
|
}
|
|
}
|
|
|
|
|
|
updateMapData(data){
|
|
updateMapData(data){
|
|
|
|
+ if(!this.sqlauthed){
|
|
|
|
+ console.log("未获取数据上传权限!");
|
|
|
|
+ alert("未获取数据上传权限!");
|
|
|
|
+ }
|
|
var sql = `UPDATE medba.dat_map
|
|
var sql = `UPDATE medba.dat_map
|
|
SET
|
|
SET
|
|
map_data = '${data.map_data}',
|
|
map_data = '${data.map_data}',
|
|
@@ -292,6 +309,10 @@ class AccountAuth {
|
|
}
|
|
}
|
|
|
|
|
|
deleteMapData(map_id){
|
|
deleteMapData(map_id){
|
|
|
|
+ if(!this.sqlauthed){
|
|
|
|
+ console.log("未获取数据上传权限!");
|
|
|
|
+ alert("未获取数据上传权限!");
|
|
|
|
+ }
|
|
var sql = `DELETE FROM medba.dat_map
|
|
var sql = `DELETE FROM medba.dat_map
|
|
WHERE
|
|
WHERE
|
|
map_id = ${map_id}`;
|
|
map_id = ${map_id}`;
|