Skip to content

Commit 66666ed

Browse files
author
奇淼(piexlmax
committed
调整eslint,优化oc判断
1 parent dfcb283 commit 66666ed

File tree

9 files changed

+103
-139
lines changed

9 files changed

+103
-139
lines changed

server/api/v1/system/sys_user.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ func (b *BaseApi) Login(c *gin.Context) {
4747
global.BlackCache.Set(key, 1, time.Second*time.Duration(openCaptchaTimeOut))
4848
}
4949

50-
var oc bool
51-
if openCaptcha == 0 || openCaptcha < interfaceToInt(v) {
52-
oc = true
53-
}
50+
var oc bool = openCaptcha == 0 || openCaptcha < interfaceToInt(v)
5451

5552
if !oc || store.Verify(l.CaptchaId, l.Captcha, true) {
5653
u := &system.SysUser{Username: l.Username, Password: l.Password}

server/utils/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var (
55
ApiVerify = Rules{"Path": {NotEmpty()}, "Description": {NotEmpty()}, "ApiGroup": {NotEmpty()}, "Method": {NotEmpty()}}
66
MenuVerify = Rules{"Path": {NotEmpty()}, "ParentId": {NotEmpty()}, "Name": {NotEmpty()}, "Component": {NotEmpty()}, "Sort": {Ge("0")}}
77
MenuMetaVerify = Rules{"Title": {NotEmpty()}}
8-
LoginVerify = Rules{"CaptchaId": {NotEmpty()}, "Captcha": {}, "Username": {NotEmpty()}, "Password": {NotEmpty()}}
8+
LoginVerify = Rules{"CaptchaId": {NotEmpty()}, "Username": {NotEmpty()}, "Password": {NotEmpty()}}
99
RegisterVerify = Rules{"Username": {NotEmpty()}, "NickName": {NotEmpty()}, "Password": {NotEmpty()}, "AuthorityId": {NotEmpty()}}
1010
PageInfoVerify = Rules{"Page": {NotEmpty()}, "PageSize": {NotEmpty()}}
1111
CustomerVerify = Rules{"CustomerName": {NotEmpty()}, "CustomerPhoneData": {NotEmpty()}}

web/limit.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ const path = require('path')
44
const wfPath = path.resolve(__dirname, './node_modules/.bin')
55

66
fs.readdir(wfPath, (err, files) => {
7-
if (err) {
8-
console.log(err)
9-
} else {
10-
if (files.length != 0) {
11-
files.forEach((item) => {
12-
if (item.split('.')[1] === 'cmd') {
13-
replaceStr(`${wfPath}/${item}`, /"%_prog%"/, '%_prog%')
14-
}
15-
})
7+
if (err) {
8+
console.log(err)
9+
} else {
10+
if (files.length !== 0) {
11+
files.forEach((item) => {
12+
if (item.split('.')[1] === 'cmd') {
13+
replaceStr(`${wfPath}/${item}`, /"%_prog%"/, '%_prog%')
1614
}
15+
})
1716
}
17+
}
1818
})
1919

2020
// 参数:[文件路径、 需要修改的字符串、修改后的字符串] (替换对应文件内字符串的公共函数)
2121
function replaceStr(filePath, sourceRegx, targetSrt) {
22-
fs.readFile(filePath, (err, data) => {
22+
fs.readFile(filePath, (err, data) => {
23+
if (err) {
24+
console.log(err)
25+
} else {
26+
let str = data.toString()
27+
str = str.replace(sourceRegx, targetSrt)
28+
fs.writeFile(filePath, str, (err) => {
2329
if (err) {
24-
console.log(err)
30+
console.log(err)
2531
} else {
26-
let str = data.toString()
27-
str = str.replace(sourceRegx, targetSrt)
28-
fs.writeFile(filePath, str, (err) => {
29-
if(err){
30-
console.log(err)
31-
}else{
32-
console.log("\x1B[42m%s\x1B[0m","文件修改成功")
33-
}
34-
})
32+
console.log('\x1B[42m%s\x1B[0m', '文件修改成功')
3533
}
36-
})
37-
}
34+
})
35+
}
36+
})
37+
}

web/src/core/config.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@
33
*/
44

55
const config = {
6-
appName: 'Gin-Vue-Admin',
7-
appLogo: 'https://www.gin-vue-admin.com/img/logo.png',
8-
showViteLogo: true
6+
appName: 'Gin-Vue-Admin',
7+
appLogo: 'https://www.gin-vue-admin.com/img/logo.png',
8+
showViteLogo: true
99
}
1010

1111
export const viteLogo = (env) => {
12-
if (config.showViteLogo) {
13-
const chalk = require('chalk')
14-
console.log(
15-
chalk.green(
16-
`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`
17-
)
18-
)
19-
console.log(
20-
chalk.green(
21-
`> 当前版本:v2.5.5`
22-
)
23-
)
24-
console.log(
25-
chalk.green(
26-
`> 加群方式:微信:shouzi_1994 QQ群:622360840`
27-
)
28-
)
29-
console.log(
30-
chalk.green(
31-
`> GVA讨论社区:https://support.qq.com/products/371961`
32-
)
33-
)
34-
console.log(
35-
chalk.green(
36-
`> 插件市场:https://plugin.gin-vue-admin.com`
37-
)
38-
)
39-
console.log(
40-
chalk.green(
41-
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
42-
)
43-
)
44-
console.log(
45-
chalk.green(
46-
`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`
47-
)
48-
)
49-
console.log(
50-
chalk.green(
51-
`> 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html`
52-
)
53-
)
54-
console.log('\n')
55-
}
12+
if (config.showViteLogo) {
13+
const chalk = require('chalk')
14+
console.log(
15+
chalk.green(
16+
`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`
17+
)
18+
)
19+
console.log(
20+
chalk.green(
21+
`> 当前版本:v2.5.5`
22+
)
23+
)
24+
console.log(
25+
chalk.green(
26+
`> 加群方式:微信:shouzi_1994 QQ群:622360840`
27+
)
28+
)
29+
console.log(
30+
chalk.green(
31+
`> GVA讨论社区:https://support.qq.com/products/371961`
32+
)
33+
)
34+
console.log(
35+
chalk.green(
36+
`> 插件市场:https://plugin.gin-vue-admin.com`
37+
)
38+
)
39+
console.log(
40+
chalk.green(
41+
`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`
42+
)
43+
)
44+
console.log(
45+
chalk.green(
46+
`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`
47+
)
48+
)
49+
console.log(
50+
chalk.green(
51+
`> 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html`
52+
)
53+
)
54+
console.log('\n')
55+
}
5656
}
5757

58-
export default config
58+
export default config

web/src/core/gin-vue-admin.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import { register } from './global'
77

88
export default {
9-
install: (app) => {
10-
register(app)
11-
console.log(`
9+
install: (app) => {
10+
register(app)
11+
console.log(`
1212
欢迎使用 Gin-Vue-Admin
1313
当前版本:v2.5.5
1414
加群方式:微信:shouzi_1994 QQ群:622360840
@@ -18,5 +18,5 @@ export default {
1818
默认前端文件运行地址:http://127.0.0.1:${import.meta.env.VITE_CLI_PORT}
1919
如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html
2020
`)
21-
}
22-
}
21+
}
22+
}

web/src/view/init/index.vue

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
</p>
2020
</div>
2121
</div>
22-
<div v-if="hello > 0 " :class="[(hello > 0 && !out)? 'slide-in-left' : '' , out ? 'slide-out-right' : '']"
23-
class="form">
22+
<div
23+
v-if="hello > 0 "
24+
:class="[(hello > 0 && !out)? 'slide-in-left' : '' , out ? 'slide-out-right' : '']"
25+
class="form"
26+
>
2427
<el-form ref="formRef" :model="form" label-width="100px">
2528
<el-form-item label="数据库类型">
2629
<el-select v-model="form.dbType" placeholder="请选择" @change="changeDB">
@@ -143,7 +146,7 @@ const changeDB = (val) => {
143146
})
144147
}
145148
}
146-
const onSubmit = async () => {
149+
const onSubmit = async() => {
147150
const loading = ElLoading.service({
148151
lock: true,
149152
text: '正在初始化数据库,请稍候',
@@ -241,72 +244,60 @@ const onSubmit = async () => {
241244
}
242245
@-webkit-keyframes slide-in-fwd-top {
243246
0% {
244-
-webkit-transform: translateZ(-1400px) translateY(-800px);
245247
transform: translateZ(-1400px) translateY(-800px);
246248
opacity: 0;
247249
}
248250
100% {
249-
-webkit-transform: translateZ(0) translateY(0);
250251
transform: translateZ(0) translateY(0);
251252
opacity: 1;
252253
}
253254
}
254255
@keyframes slide-in-fwd-top {
255256
0% {
256-
-webkit-transform: translateZ(-1400px) translateY(-800px);
257257
transform: translateZ(-1400px) translateY(-800px);
258258
opacity: 0;
259259
}
260260
100% {
261-
-webkit-transform: translateZ(0) translateY(0);
262261
transform: translateZ(0) translateY(0);
263262
opacity: 1;
264263
}
265264
}
266265
@-webkit-keyframes slide-out-right {
267266
0% {
268-
-webkit-transform: translateX(0);
269267
transform: translateX(0);
270268
opacity: 1;
271269
}
272270
100% {
273-
-webkit-transform: translateX(1000px);
274271
transform: translateX(1000px);
275272
opacity: 0;
276273
}
277274
}
278275
@keyframes slide-out-right {
279276
0% {
280-
-webkit-transform: translateX(0);
281277
transform: translateX(0);
282278
opacity: 1;
283279
}
284280
100% {
285-
-webkit-transform: translateX(1000px);
286281
transform: translateX(1000px);
287282
opacity: 0;
288283
}
289284
}
290285
@-webkit-keyframes slide-in-left {
291286
0% {
292-
-webkit-transform: translateX(-1000px);
293287
transform: translateX(-1000px);
294288
opacity: 0;
295289
}
296290
100% {
297-
-webkit-transform: translateX(0);
298291
transform: translateX(0);
299292
opacity: 1;
300293
}
301294
}
302295
@keyframes slide-in-left {
303296
0% {
304-
-webkit-transform: translateX(-1000px);
305297
transform: translateX(-1000px);
306298
opacity: 0;
307299
}
308300
100% {
309-
-webkit-transform: translateX(0);
310301
transform: translateX(0);
311302
opacity: 1;
312303
}

web/src/view/layout/search/search.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,15 @@ const toService = () => {
104104
animation:turn 0.5s linear infinite;
105105
}
106106
@keyframes turn {
107-
0%{-webkit-transform:rotate(0deg);}
108-
25%{-webkit-transform:rotate(90deg);}
109-
50%{-webkit-transform:rotate(180deg);}
110-
75%{-webkit-transform:rotate(270deg);}
111-
100%{-webkit-transform:rotate(360deg);}
107+
0%{transform:rotate(0deg);}
108+
25%{transform:rotate(90deg);}
109+
50%{transform:rotate(180deg);}
110+
75%{transform:rotate(270deg);}
111+
100%{transform:rotate(360deg);}
112112
}
113113
114-
115114
.service {
116-
font-family: "gvaIcon" !important;
115+
font-family: "gvaIcon",serif !important;
117116
font-size: 16px;
118117
font-style: normal;
119118
font-weight: 800;

0 commit comments

Comments
 (0)