gy-webcode2 1.1.8 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@
25
25
  .right{
26
26
  overflow: auto;
27
27
  }
28
- .left,.right{
28
+ .left{
29
29
 
30
30
  ul{
31
31
  padding:10px;
@@ -53,4 +53,31 @@
53
53
  }
54
54
  }
55
55
  }
56
+ .right{
57
+ >ul{
58
+ padding:10px;
59
+ li{
60
+ height: 25px;
61
+ margin-bottom: 5px;
62
+ display: flex;
63
+ font-size: 14px;
64
+ line-height: 25px;
65
+ div:nth-of-type(1){
66
+ border: 1px solid #efefef;
67
+ flex: 1;
68
+ color:#666666;
69
+ padding-left: 10px;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ white-space: nowrap;
73
+ }
74
+ div:nth-of-type(2){
75
+ width: 30px;
76
+ text-align:center;
77
+ color:#a5becf;
78
+ cursor: pointer;
79
+ }
80
+ }
81
+ }
82
+ }
56
83
  }
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div >
3
+ <router-view/>
4
+ <div class="canvas_syBox " :style="`background-image:url(${vuex_watermarkImg})`" ref="canvasBox">
5
+ </div>
6
+ </div>
7
+ </template>
8
+ <script>
9
+ export default {
10
+ data() {
11
+ return {
12
+ }
13
+ },
14
+ components: {
15
+ // dashboards
16
+ },
17
+ created(){
18
+ },
19
+ computed:{
20
+ data() {
21
+ return this.$store.state.menu.data;
22
+ }
23
+ },
24
+ watch:{
25
+ },
26
+ methods:{
27
+ },
28
+
29
+ }
30
+ </script>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div>
3
+ </div>
4
+ </template>
5
+
6
+ <script>
7
+
8
+ export default {
9
+ data() {
10
+ return {}
11
+ },
12
+ computed: {
13
+ menuListAll() {
14
+ return this.$store.state.menu.data;
15
+ },
16
+ },
17
+ watch: {
18
+ },
19
+
20
+ created() {
21
+ let redirect = this.$route.query.redirect;
22
+ if(redirect && redirect != '/' && redirect != '/login'){
23
+
24
+ let myPath = this.$router.resolve(redirect);
25
+ this.$router.replace(myPath).catch(()=>{})
26
+
27
+ // let query = {...this.$route.query}
28
+ // delete query.redirect;
29
+ // this.$router.replace({
30
+ // path: redirect,
31
+ // query:query
32
+ // }).catch(()=>{})
33
+ }
34
+ else if(this.menuListAll.length > 0){
35
+ this.$router.replace({
36
+ path:this.menuListAll[0].list[0].list[0].list[0].path
37
+ }).catch(err => ()=>{})
38
+ }
39
+
40
+ },
41
+ mounted() {
42
+ },
43
+ components: {
44
+ },
45
+ }
46
+ </script>
47
+
48
+ <style lang="scss" scoped>
49
+ </style>
@@ -0,0 +1,227 @@
1
+ <template>
2
+ <div v-if="showHtml">
3
+ <div class="loginBody" ref="loginBody">
4
+ <canvas ref="Mycanvas" border='0'></canvas>
5
+ <div class="loginBox">
6
+ <div class="logo" :style="`background-image:url(${logoURL})`"></div>
7
+ <div class="projectName">
8
+ {{projectName}}
9
+ </div>
10
+ <div class="nrBox">
11
+ <div v-show="loginOption == 2">
12
+ <div class="login_inputBox">
13
+ <input autocomplete="text" @keyup="username_error=false" @keyup.13="login()"
14
+ v-model="username" id="username" placeholder="请输入用户名" type="text"/>
15
+ <div class="inputInfo">
16
+ <div class="error" v-show="username_error" id="username_error">{{errorText}}
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div class="login_inputBox">
21
+ <input autocomplete="password" @keyup.13="login()" @keyup="user_pwd_error=false" v-model="user_pwd" id="user_pwd" placeholder="请输入密码" type="password"/>
22
+ <div class="inputInfo">
23
+ <div class="error fl" v-show="user_pwd_error" id="user_pwd_error">{{errorText}}
24
+ </div>
25
+ <div class="fr">
26
+ <!-- <a href="#" class="wjmm">忘记密码?</a> -->
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <el-button type="primary" class="login_btn" @click="login()">登录</el-button>
31
+ <!-- <input type="button" class="login_btn cp" value="登录"> -->
32
+ </div>
33
+ </div>
34
+ <!-- <div class="tr loginOption">
35
+ <i v-show="loginOption!=1" @click="loginOption = 1" class="common_iconfont common_icon-saoma"></i>
36
+ <i v-show="loginOption!= 2" @click="loginOption = 2" class="common_iconfont common_icon-yonghu"></i>
37
+ <i v-show="loginOption!=3" @click="loginOption = 3" class="common_iconfont common_icon-phone"></i>
38
+ </div> -->
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ import md5 from '@/assets/scripts/md5'
46
+ import crypto from "gy-webcode2/scripts/crypto"
47
+ import canvasBg from '@/assets/scripts/canvasBg'
48
+
49
+ export default {
50
+ data() {
51
+ return {
52
+ showHtml: true,
53
+ username: "",
54
+ user_pwd: "",
55
+ username_error: false,
56
+ user_pwd_error: false,
57
+ errorText: "",
58
+ slogan: "",
59
+ yyname: defaultConfig.yyName ? defaultConfig.yyName : '',
60
+ logoURL: defaultConfig.logoURL ? defaultConfig.logoURL : '/static/img/yh_logo_white.png',
61
+ projectName: defaultConfig.ProjectName ? defaultConfig.ProjectName : "医院数据治理平台",
62
+ loginOption: 2,
63
+ phone: "",
64
+ yzm: ""
65
+ }
66
+ },
67
+ created() {
68
+ if (defaultConfig.loginLogoURL) {
69
+ this.logoURL = defaultConfig.loginLogoURL
70
+ } else if (defaultConfig.logoURL) {
71
+ this.logoURL = defaultConfig.logoURL;
72
+ } else {
73
+ this.logoURL = '/static/img/yh_logo_white.png';
74
+ }
75
+ if (singin) { //开启单点登录1
76
+ var utype = this.getUrlKey("utype");
77
+ var userid = this.getUrlKey("userid");
78
+
79
+ var token2 = this.getUrlKey("token");
80
+ var appId = this.getUrlKey("appId");
81
+
82
+ if ((this.singinCompany != "") && token2 && appId) {
83
+ this.showHtml = false;
84
+ this.$http.get(interfaceUrl + "/login/getThirdUser", {
85
+ params: {token: token2, appId: appId, url: singinUrl}
86
+ }).then((data) => {
87
+ if (data.status == 200) {
88
+ this.mmlogin(data.data);
89
+ } else {
90
+ this.showHtml = true;
91
+ this.$message.error("登录失败,请输入用户名密码登录!");
92
+ }
93
+ });
94
+ } else if (utype == 1) {//允许单点免密码登录,密码默认123
95
+ this.showHtml = false;
96
+ if (userid == null) {
97
+ this.$message.error("用户名不能为空!");
98
+ this.showHtml = true;
99
+ return false;
100
+ }
101
+ this.mmlogin(userid);
102
+ } else {
103
+ this.showHtml = true;
104
+ }
105
+ }
106
+ },
107
+ mounted() {
108
+ },
109
+ methods: {
110
+ login() {
111
+ var username = $.trim(this.username);
112
+ var user_pwd = this.user_pwd;
113
+ if (!username || !user_pwd) {
114
+
115
+ if (!username) {
116
+ this.username_error = true;
117
+ this.errorText = "请输入用户名";
118
+ // $("#username_error").show();
119
+ // $("#username_error").html("请输入用户名");
120
+ }
121
+ if (!user_pwd) {
122
+ this.user_pwd_error = true;
123
+ this.errorText = "请输入密码";
124
+ }
125
+
126
+ return false;
127
+ }
128
+ var postJSON = {
129
+ userid: username,
130
+ password: md5(user_pwd)
131
+ }
132
+
133
+
134
+ var vueThis = this;
135
+ var json = new URLSearchParams();
136
+ json.append("userid", username);
137
+ json.append("password", md5(user_pwd));
138
+
139
+ this.$http.post(interfaceUrl + "/login/exitLogin",
140
+ {
141
+ data: crypto.encrypt(JSON.stringify(postJSON))
142
+ }
143
+ ).then((json) => {
144
+ // console.log(JSON.parse(crypto.decrypt(json.data)));
145
+ json = JSON.parse(crypto.decrypt(json.data))
146
+
147
+ var logJson = {operationtype: 5, pagecode: "login", pagename: "登录页面"};
148
+ if (json.status == 200) {
149
+ Cookies.set('gy_login', JSON.stringify(json.data));
150
+ userInfo = json.data;
151
+
152
+ logJson.status = json.status;
153
+ let redirect = this.$route.query.redirect;
154
+ if (redirect) {
155
+ this.$router.push({
156
+ path: redirect
157
+ })
158
+ } else {
159
+ this.$router.push({
160
+ path: '/'
161
+ })
162
+ }
163
+
164
+ } else {
165
+ logJson.status = json.status;
166
+ logJson.errormsg = json.message;
167
+ vueThis.username_error = true;
168
+ vueThis.errorText = json.message;
169
+ }
170
+ golLog.setMenuLog(logJson, vueThis, userInfo);
171
+ });
172
+ },
173
+ mmlogin(userid) {
174
+ var vueThis = this;
175
+ var postJSON = {
176
+ userid: userid
177
+ }
178
+ this.$http.post(interfaceUrl + "/login/ssoLogin",
179
+ postJSON
180
+ ).then((json) => {
181
+ // console.log(JSON.parse(crypto.decrypt(json.data)));
182
+ // json = JSON.parse(crypto.decrypt(json.data))
183
+ if (json.data == null) {
184
+ this.$message.error("该用户不存在!");
185
+ this.showHtml = true;
186
+ return;
187
+ }
188
+ var logJson = {operationtype: 5, pagecode: "login", pagename: "登录页面"};
189
+ if (json.status == 200) {
190
+ Cookies.set('gy_login', JSON.stringify(json.data));
191
+ userInfo = json.data;
192
+
193
+ logJson.status = json.status;
194
+ let redirect = this.$route.query.redirect;
195
+ if (redirect) {
196
+ this.$router.push({
197
+ path: redirect
198
+ })
199
+ } else {
200
+ this.$router.push({
201
+ path: '/'
202
+ })
203
+ }
204
+
205
+ } else {
206
+ logJson.status = json.status;
207
+ logJson.errormsg = json.message;
208
+ vueThis.username_error = true;
209
+ vueThis.errorText = json.message;
210
+ }
211
+ golLog.setMenuLog(logJson, vueThis, userInfo);
212
+
213
+ });
214
+
215
+ },
216
+ getUrlKey: function (name) {
217
+ return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null;
218
+ }
219
+ },
220
+
221
+
222
+ }
223
+ </script>
224
+ <style lang="scss" src="gy-webcode2/css/login.scss" scoped></style>
225
+ <style lang="scss" scoped>
226
+
227
+ </style>