cloud-web-corejs 1.0.54-dev.436 → 1.0.54-dev.437

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.436",
4
+ "version": "1.0.54-dev.437",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
package/src/lang/index.js CHANGED
@@ -1,51 +1,56 @@
1
- import Vue from 'vue'
2
- import VueI18n from 'vue-i18n'
3
-
4
- import enLocale from 'element-ui/lib/locale/lang/en'
5
- import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
6
- import zhCN_vxe from 'vxe-table/lib/locale/lang/zh-CN'
7
- import enUS_vxe from 'vxe-table/lib/locale/lang/en-US'
8
- import VXETable from 'vxe-table'
9
- import ElementLocale from 'element-ui/lib/locale'
10
- import settingConfig from "@/settings";
11
-
12
- Vue.use(VueI18n);
13
-
14
- const messages = {
15
- en: {
16
- ...enLocale,
17
- ...enUS_vxe
18
- },
19
- zh: {
20
- ...zhLocale,
21
- ...zhCN_vxe
22
- }
23
- };
24
-
25
- /*const enLocaleMine = require.context('@/lang/locale/en', false, /\w+\.js/);
26
- const zhLocaleMine = require.context('@/lang/locale/zh', false, /\w+\.js/);
27
-
28
- zhLocaleMine.keys().map(fileName => {
29
- let comp = zhLocaleMine(fileName).default;
30
- Object.assign(messages["zh"], comp);
31
- });
32
- enLocaleMine.keys().map(fileName => {
33
- let comp = enLocaleMine(fileName).default;
34
- Object.assign(messages["en"], comp);
35
- });*/
36
-
37
- // Create VueI18n instance with options
38
- let i18nLang = localStorage.getItem("i18n-lang");
39
- const i18n = new VueI18n({
40
- locale: i18nLang || settingConfig.languageCode || 'zh', // set locale
41
- messages, // set locale messages
42
- });
43
-
44
- ElementLocale.i18n((key, value) => i18n.t(key, value));
45
-
46
- VXETable.setup({
47
- // 对组件内置的提示语进行国际化翻译
48
- i18n: (key, args) => i18n.t(key, args)
49
- });
50
-
51
- export default i18n;
1
+ import Vue from 'vue'
2
+ import VueI18n from 'vue-i18n'
3
+
4
+ import enLocale from 'element-ui/lib/locale/lang/en'
5
+ import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
6
+ import zhCN_vxe from 'vxe-table/lib/locale/lang/zh-CN'
7
+ import enUS_vxe from 'vxe-table/lib/locale/lang/en-US'
8
+ import VXETable from 'vxe-table'
9
+ import ElementLocale from 'element-ui/lib/locale'
10
+ import settingConfig from "@/settings";
11
+
12
+ import enLogin from "./locale/en/login.js"
13
+ import zhLogin from "./locale/zh/login.js"
14
+
15
+ Vue.use(VueI18n);
16
+
17
+ const messages = {
18
+ en: {
19
+ ...enLocale,
20
+ ...enUS_vxe,
21
+ ...enLogin
22
+ },
23
+ zh: {
24
+ ...zhLocale,
25
+ ...zhCN_vxe,
26
+ ...zhLogin
27
+ }
28
+ };
29
+
30
+ /*const enLocaleMine = require.context('@/lang/locale/en', false, /\w+\.js/);
31
+ const zhLocaleMine = require.context('@/lang/locale/zh', false, /\w+\.js/);
32
+
33
+ zhLocaleMine.keys().map(fileName => {
34
+ let comp = zhLocaleMine(fileName).default;
35
+ Object.assign(messages["zh"], comp);
36
+ });
37
+ enLocaleMine.keys().map(fileName => {
38
+ let comp = enLocaleMine(fileName).default;
39
+ Object.assign(messages["en"], comp);
40
+ });*/
41
+
42
+ // Create VueI18n instance with options
43
+ let i18nLang = localStorage.getItem("i18n-lang");
44
+ const i18n = new VueI18n({
45
+ locale: i18nLang || settingConfig.languageCode || 'zh', // set locale
46
+ messages, // set locale messages
47
+ });
48
+
49
+ ElementLocale.i18n((key, value) => i18n.t(key, value));
50
+
51
+ VXETable.setup({
52
+ // 对组件内置的提示语进行国际化翻译
53
+ i18n: (key, args) => i18n.t(key, args)
54
+ });
55
+
56
+ export default i18n;
@@ -1,24 +1,49 @@
1
1
  <template>
2
- <div class="login-container" :class="backgroundClass" ref="login-container" v-show="showContent">
3
- <div class="login-main" style="height: auto;">
2
+ <div
3
+ class="login-container"
4
+ :class="backgroundClass"
5
+ ref="login-container"
6
+ v-show="showContent"
7
+ >
8
+ <div class="login-main" style="height: auto">
4
9
  <el-tabs v-model="activeName" @tab-click="changeTab">
5
- <el-tab-pane label="账号登录" name="first">
6
- <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="box-form login" autocomplete="on"
7
- label-position="left">
10
+ <el-tab-pane :label="$t1('账号登录')" name="first">
11
+ <el-form
12
+ ref="loginForm"
13
+ :model="loginForm"
14
+ :rules="loginRules"
15
+ class="box-form login"
16
+ autocomplete="on"
17
+ label-position="left"
18
+ >
8
19
  <el-form-item prop="username" class="txt">
9
- <span class="svg-container"><i class="el-icon-user"/></span>
10
- <el-input ref="username" v-model="loginForm.username" placeholder="请输入用户名" name="" type="text"
11
- tabindex="1" autocomplete="on" @keyup.enter.native="handleLogin"/>
20
+ <span class="svg-container"><i class="el-icon-user" /></span>
21
+ <el-input
22
+ ref="username"
23
+ v-model="loginForm.username"
24
+ :placeholder="$t1('请输入用户名')"
25
+ name=""
26
+ type="text"
27
+ tabindex="1"
28
+ autocomplete="on"
29
+ @keyup.enter.native="handleLogin"
30
+ />
12
31
  </el-form-item>
13
- <el-tooltip :enterable="false" v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
32
+ <el-tooltip
33
+ :enterable="false"
34
+ v-model="capsTooltip"
35
+ content="Caps lock is On"
36
+ placement="right"
37
+ manual
38
+ >
14
39
  <el-form-item prop="password" class="txt">
15
- <span class="svg-container"><i class="el-icon-lock"/></span>
40
+ <span class="svg-container"><i class="el-icon-lock" /></span>
16
41
  <el-input
17
42
  :key="passwordType"
18
43
  ref="password"
19
44
  v-model="loginForm.password"
20
45
  :type="passwordType"
21
- placeholder="请输入密码"
46
+ :placeholder="$t1('请输入密码')"
22
47
  name=""
23
48
  tabindex="2"
24
49
  autocomplete="on"
@@ -27,48 +52,101 @@
27
52
  @blur="capsTooltip = false"
28
53
  @keyup.enter.native="handleLogin"
29
54
  />
30
- <span class="show-pwd" @click="showPwd"><svg-icon
31
- :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"/></span>
55
+ <span class="show-pwd" @click="showPwd"
56
+ ><svg-icon
57
+ :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
58
+ /></span>
32
59
  </el-form-item>
33
60
  </el-tooltip>
34
61
  <div class="">
35
- <el-checkbox v-model="isRememberPassword">记住密码</el-checkbox>
62
+ <el-checkbox v-model="isRememberPassword">{{
63
+ $t1("记住密码")
64
+ }}</el-checkbox>
36
65
  </div>
37
- <el-button :loading="loading" type="primary" @click.prevent.stop="handleLogin" class="btn">登录</el-button>
66
+ <el-button
67
+ :loading="loading"
68
+ type="primary"
69
+ @click.prevent.stop="handleLogin"
70
+ class="btn"
71
+ >{{ $t1("登录") }}</el-button
72
+ >
38
73
  </el-form>
39
74
  </el-tab-pane>
40
- <el-tab-pane label="手机登录" name="second" v-if="settingConfig.mobileLoginEnabled">
41
- <el-form ref="loginForm" :model="loginForm2" :rules="loginRules" class="box-form login" autocomplete="on"
42
- label-position="left">
43
- <el-form-item prop="username" class="txt" style="width:66%">
44
- <span class="svg-container"><i class="el-icon-mobile-phone"/></span>
45
- <el-input ref="mobile" v-model="loginForm2.username" placeholder="请输入手机号" name="" type="text"
46
- tabindex="1" autocomplete="on" @keyup.enter.native="handleLogin"/>
75
+ <el-tab-pane
76
+ :label="$t1('手机登录')"
77
+ name="second"
78
+ v-if="settingConfig.mobileLoginEnabled"
79
+ >
80
+ <el-form
81
+ ref="loginForm"
82
+ :model="loginForm2"
83
+ :rules="loginRules"
84
+ class="box-form login"
85
+ autocomplete="on"
86
+ label-position="left"
87
+ >
88
+ <el-form-item prop="username" class="txt" style="width: 66%">
89
+ <span class="svg-container"><i class="el-icon-mobile-phone" /></span>
90
+ <el-input
91
+ ref="mobile"
92
+ v-model="loginForm2.username"
93
+ :placeholder="$t1('请输入手机号')"
94
+ name=""
95
+ type="text"
96
+ tabindex="1"
97
+ autocomplete="on"
98
+ @keyup.enter.native="handleLogin"
99
+ />
47
100
  </el-form-item>
48
- <el-button class="btn-send" type="success" :class="{'gray-btn':isCounting}" @click="sendCode">
101
+ <el-button
102
+ class="btn-send"
103
+ type="success"
104
+ :class="{ 'gray-btn': isCounting }"
105
+ @click="sendCode"
106
+ >
49
107
  {{ buttonText }}
50
108
  </el-button>
51
109
  <el-form-item prop="smsCode" class="txt">
52
- <span class="svg-container"><i class="el-icon-message"/></span>
53
- <el-input ref="smsCode" v-model="loginForm2.smsCode" placeholder="请输入验证码" name="" type="text"
54
- tabindex="1" autocomplete="on" @keyup.enter.native="handleLogin"/>
110
+ <span class="svg-container"><i class="el-icon-message" /></span>
111
+ <el-input
112
+ ref="smsCode"
113
+ v-model="loginForm2.smsCode"
114
+ :placeholder="$t1('请输入验证码')"
115
+ name=""
116
+ type="text"
117
+ tabindex="1"
118
+ autocomplete="on"
119
+ @keyup.enter.native="handleLogin"
120
+ />
55
121
  </el-form-item>
56
- <el-button :loading="loading" type="primary" @click.prevent.stop="handleLogin" class="btn">登录</el-button>
122
+ <el-button
123
+ :loading="loading"
124
+ type="primary"
125
+ @click.prevent.stop="handleLogin"
126
+ class="btn"
127
+ >{{ $t1("登录") }}</el-button
128
+ >
57
129
  </el-form>
58
130
  </el-tab-pane>
59
- <el-tab-pane label="扫码登录" name="third" v-if="settingConfig.qrLoginEnabled">
131
+ <el-tab-pane
132
+ :label="$t1('扫码登录')"
133
+ name="third"
134
+ v-if="settingConfig.qrLoginEnabled"
135
+ >
60
136
  <div class="login-qr">
61
- <img class="qr__img" :src="qrBase64" v-if="activeName==='third'"/>
62
- <span class="qr__txt">扫一扫,登录系统</span>
63
- <div v-if="qrExpired" @click="initQR" class="qr__lose"><span><i class="el-icon-refresh"></i>二维码失效</span></div>
137
+ <img class="qr__img" :src="qrBase64" v-if="activeName === 'third'" />
138
+ <span class="qr__txt">{{ $t1("扫一扫,登录系统") }}</span>
139
+ <div v-if="qrExpired" @click="initQR" class="qr__lose">
140
+ <span><i class="el-icon-refresh"></i>{{ $t1("二维码失效") }}</span>
141
+ </div>
64
142
  </div>
65
143
  </el-tab-pane>
66
144
  </el-tabs>
67
145
  </div>
68
- <div class="tc copyright" v-show="false">
146
+ <div class="tc copyright">
69
147
  <slot name="footer">
70
- © 广州同望科技发展有限公司
71
- <span style="margin-left:50px;">4000646100</span>
148
+ © {{ $t1("广州同望科技发展有限公司") }}
149
+ <span style="margin-left: 50px">4000646100</span>
72
150
  </slot>
73
151
  </div>
74
152
  </div>
@@ -78,12 +156,12 @@
78
156
  import mixin from "./indexMixin";
79
157
 
80
158
  export default {
81
- name: 'Login',
82
- mixins: [mixin]
83
- }
159
+ name: "Login",
160
+ mixins: [mixin],
161
+ };
84
162
  </script>
85
163
  <style lang="scss" scoped>
86
- @import '@/resources/css/login.scss';
164
+ @import "@/resources/css/login.scss";
87
165
 
88
166
  .login-container.tc {
89
167
  background: url(~@/resources/images/bg-login5.jpg) center center/cover no-repeat;
@@ -101,7 +179,9 @@ export default {
101
179
  right: 5px;
102
180
  top: 25px;
103
181
  }
104
- .box-form{height: 330px;}
182
+ .box-form {
183
+ height: 330px;
184
+ }
105
185
  ::v-deep .login-main .el-tabs__header {
106
186
  margin-bottom: 0;
107
187
 
@@ -139,11 +219,22 @@ export default {
139
219
  ::v-deep .login-main .el-tabs__header .el-tabs__nav .el-tabs__item {
140
220
  width: 33%;
141
221
  }
142
- .login-qr{height: 330px;text-align: center;position: relative;
143
- .qr__img{width: 220px;margin-top:40px;}
144
- .qr__txt{color: #666;font-size: 15px;display: block;}
145
- .qr__lose{
146
- position: absolute;cursor: pointer;
222
+ .login-qr {
223
+ height: 330px;
224
+ text-align: center;
225
+ position: relative;
226
+ .qr__img {
227
+ width: 220px;
228
+ margin-top: 40px;
229
+ }
230
+ .qr__txt {
231
+ color: #666;
232
+ font-size: 15px;
233
+ display: block;
234
+ }
235
+ .qr__lose {
236
+ position: absolute;
237
+ cursor: pointer;
147
238
  width: 192px;
148
239
  height: 192px;
149
240
  background: rgb(255 255 255 / 76%);
@@ -153,8 +244,15 @@ export default {
153
244
  line-height: 64px;
154
245
  font-weight: 600;
155
246
  font-size: 26px;
156
- span{line-height: 1;margin-top:30px;}
157
- i{display: block;font-size:42px;margin-top: 46px;}
247
+ span {
248
+ line-height: 1;
249
+ margin-top: 30px;
250
+ }
251
+ i {
252
+ display: block;
253
+ font-size: 42px;
254
+ margin-top: 46px;
255
+ }
158
256
  }
159
257
  }
160
258
  </style>
@@ -19,7 +19,7 @@ export default {
19
19
  return {
20
20
  isCounting: false,
21
21
  countdown: 0,
22
- buttonText: '获取验证码',
22
+ buttonText: this.$t1('获取验证码'),
23
23
  smsTimer: null,
24
24
  isRememberPassword: false,
25
25
  loginForm: {
@@ -98,7 +98,15 @@ export default {
98
98
  window.removeEventListener('keydown', this.keyDown, false);
99
99
  },
100
100
  methods: {
101
+ initLang(){
102
+ if(this.$route.query.lang){
103
+ debugger
104
+ this.$i18n.locale = this.$route.query.lang;
105
+ localStorage.setItem("i18n-lang",this.$route.query.lang);
106
+ }
107
+ },
101
108
  init() {
109
+ this.initLang();
102
110
  let searchParam = getUrlParams(location.search);
103
111
  this.searchParam = searchParam;
104
112
  //小熊SSO返回判断--目前因为小熊单点返回ticket有问题要特殊处理
@@ -155,7 +163,7 @@ export default {
155
163
  let username = this.loginForm2.username;
156
164
  let smsCode = this.loginForm2.smsCode;
157
165
  if (!username || !smsCode) {
158
- this.$baseAlert("请输入手机号和验证码");
166
+ this.$baseAlert(this.$t1('请输入手机号和验证码'));
159
167
  return;
160
168
  }
161
169
  loadingObj = this.$baseLoading();
@@ -354,15 +362,15 @@ export default {
354
362
  });
355
363
  this.isCounting = true
356
364
  this.countdown = 60
357
- this.buttonText = '60秒后重新获取'
365
+ this.buttonText = this.$t1('60秒后重新获取')
358
366
  this.clearSmsTimer();
359
367
  this.smsTimer = setInterval(() => {
360
368
  this.countdown--;
361
- this.buttonText = this.countdown + '秒后重新获取'
369
+ this.buttonText = this.$t1('{time}秒后重新获取',{time:this.countdown})
362
370
  if (this.countdown == 0) {
363
371
  this.clearSmsTimer();
364
372
  this.isCounting = false
365
- this.buttonText = '获取验证码'
373
+ this.buttonText = this.$t1('获取验证码')
366
374
  }
367
375
  }, 1000)
368
376
  }
@@ -516,7 +524,7 @@ export default {
516
524
  let token = res.objx;
517
525
  if (token) {
518
526
  this.$message({
519
- message: "登录成功",
527
+ message: this.$t1('登录成功'),
520
528
  type: 'success'
521
529
  });
522
530
  this.clearQrLoginTimer();