1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
| var httpConfig={
| webApiUrl: "http://127.0.0.1:8089/",
| //代理资源 图片/模型
| nginxUrl : "http://127.0.0.1:8088/",
| //中台地址
| webMidUrl: "http://192.168.0.102:8000/" ,
| access_token:"0038cf7cc6a34d80ac8c216205bb1f3d",
| }
|
| var layerPageStyle={
| offsetX: 100,
| offsetY:50
| }
|
|
| var vMsg = new Vue({
| methods: {
| success(msg) {
| this.$message({ message: msg, type: 'success' });
| },
| info(msg) {
| this.$message(msg);
| },
| warning(msg) {
| this.$message({ message: msg, type: 'warning' });
| },
| error(msg) {
| this.$message.error(msg);
| },
| iconSuccess(title,msg) {
| this.$notify({
| title: title,
| message: msg,
| type: 'success'
| });
| },
| iconWarning(title,msg) {
| this.$notify({
| title: title,
| message: msg,
| type: 'warning'
| });
| },
| iconWarningWithTime(title,msg,time) {
| this.$notify({
| duration:time,
| title: title,
| message: msg,
| type: 'warning'
| });
| },
| },
| });
|
|
| function getQueryString(name) {
| var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
| var r = decodeURI(window.location.search.substr(1)).match(reg);
| if (r != null) {
| return unescape(r[2]);
| }
| return null;
| }
| initToken();
| function initToken(){
| var userName = getQueryString("username");
| var JSESSIONID = getQueryString("JSESSIONID");
| window.localStorage.setItem("username", userName);
| window.localStorage.setItem("JSESSIONID", JSESSIONID);
| $("#username").append(userName);
|
| $.ajax({
| type: "post",
| async: false,
| url: httpConfig.webApiUrl + "landstamp/front/token?sessionId=" + JSESSIONID,
| contentType: "application/json;charset=utf-8",
| success: function (data) {
| if(data.code==0){
| window.localStorage.setItem("token", data.token);
| }
| console.log(data);
| },
| error: function (XMLHttpRequest, textStatus, errorThrown) {
| console.log("ajax请求失败!");
| }
| });
| var token = window.localStorage.getItem("token");
| $.ajax({
| type: "post",
| async: false,
| url: httpConfig.webApiUrl + "landstamp/front/userlogo" ,
| contentType: "application/json;charset=utf-8",
| beforeSend:function(request){
| request.setRequestHeader("token",token);
| },
| success: function (data) {
| document.getElementById("userlogo").setAttribute("src", data.avatar);
| },
| error: function (XMLHttpRequest, textStatus, errorThrown) {
| console.log("ajax请求失败!");
| }
| });
|
| }
|
|