diff --git a/code/base-project/base-uniapp-main/.gitignore b/code/base-project/base-uniapp-main/.gitignore index a547bf36..8b7e5021 100644 --- a/code/base-project/base-uniapp-main/.gitignore +++ b/code/base-project/base-uniapp-main/.gitignore @@ -13,8 +13,6 @@ dist-ssr *.local # Editor directories and files -.vscode/* -!.vscode/extensions.json .idea .DS_Store *.suo diff --git a/code/base-project/base-uniapp-main/.vscode/settings.json b/code/base-project/base-uniapp-main/.vscode/settings.json new file mode 100644 index 00000000..4472e953 --- /dev/null +++ b/code/base-project/base-uniapp-main/.vscode/settings.json @@ -0,0 +1,51 @@ +{ + "editor.cursorSmoothCaretAnimation": "on", + // Disable the default formatter, use eslint instead + "prettier.enable": false, + "editor.formatOnSave": false, + + // Auto fix + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "severity": "off", "fixable": true }, + { "rule": "format/*", "severity": "off", "fixable": true }, + { "rule": "*-indent", "severity": "off", "fixable": true }, + { "rule": "*-spacing", "severity": "off", "fixable": true }, + { "rule": "*-spaces", "severity": "off", "fixable": true }, + { "rule": "*-order", "severity": "off", "fixable": true }, + { "rule": "*-dangle", "severity": "off", "fixable": true }, + { "rule": "*-newline", "severity": "off", "fixable": true }, + { "rule": "*quotes", "severity": "off", "fixable": true }, + { "rule": "*semi", "severity": "off", "fixable": true } + ], + + // Enable eslint for all supported languages + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "xml", + "gql", + "graphql", + "astro", + "svelte", + "css", + "less", + "scss", + "pcss", + "postcss" + ] +} diff --git a/code/base-project/base-uniapp-main/src/App.vue b/code/base-project/base-uniapp-main/src/App.vue index 6ebe5683..38bcbfea 100644 --- a/code/base-project/base-uniapp-main/src/App.vue +++ b/code/base-project/base-uniapp-main/src/App.vue @@ -8,7 +8,7 @@ onLaunch(() => { console.log('App Launch') }) onShow(() => { - userStore.requireLogin() + // userStore.requireLogin() console.log('App Show') }) diff --git a/code/base-project/base-uniapp-main/src/interceptor/router.ts b/code/base-project/base-uniapp-main/src/interceptor/router.ts index bc9d3f30..66f76a30 100644 --- a/code/base-project/base-uniapp-main/src/interceptor/router.ts +++ b/code/base-project/base-uniapp-main/src/interceptor/router.ts @@ -34,9 +34,9 @@ export const navigateToInterceptor = { export const routeInterceptor = { install() { - uni.addInterceptor('navigateTo', navigateToInterceptor) - uni.addInterceptor('reLaunch', navigateToInterceptor) - uni.addInterceptor('redirectTo', navigateToInterceptor) - uni.addInterceptor('switchTab', navigateToInterceptor) + // uni.addInterceptor('navigateTo', navigateToInterceptor) + // uni.addInterceptor('reLaunch', navigateToInterceptor) + // uni.addInterceptor('redirectTo', navigateToInterceptor) + // uni.addInterceptor('switchTab', navigateToInterceptor) }, } diff --git a/code/base-project/base-uniapp-main/src/pages-sub/login/index.vue b/code/base-project/base-uniapp-main/src/pages-sub/login/index.vue index aa3afe64..a61c77e3 100644 --- a/code/base-project/base-uniapp-main/src/pages-sub/login/index.vue +++ b/code/base-project/base-uniapp-main/src/pages-sub/login/index.vue @@ -34,35 +34,47 @@ function onSubmit() { formRef.value ?.validate() .then(() => { - _loading.value = true - loginOrgApi({ - orgid: formModel.orgid, - userid: formModel.userid, - password: formModel.password, - }).then((res) => { - if (res.data) { - userStore.userInfo.orgid = formModel.orgid - userStore.userInfo.userid = formModel.userid - userStore.userInfo.token = res.data + userStore.userInfo.orgid = formModel.orgid + userStore.userInfo.userid = formModel.userid + userStore.userInfo.token = '123' - uni.showToast({ - title: '登录成功', - icon: 'success', - }) - - uni.switchTab({ - url: '/pages/home/index', - }) - } - else { - uni.showToast({ - title: '登录失败,请稍后再试', - icon: 'error', - }) - } - }).finally(() => { - _loading.value = false + uni.showToast({ + title: '登录成功', + icon: 'success', }) + + uni.switchTab({ + url: '/pages/home/index', + }) + // _loading.value = true + // loginOrgApi({ + // orgid: formModel.orgid, + // userid: formModel.userid, + // password: formModel.password, + // }).then((res) => { + // if (res.data) { + // userStore.userInfo.orgid = formModel.orgid + // userStore.userInfo.userid = formModel.userid + // userStore.userInfo.token = res.data + + // uni.showToast({ + // title: '登录成功', + // icon: 'success', + // }) + + // uni.switchTab({ + // url: '/pages/home/index', + // }) + // } + // else { + // uni.showToast({ + // title: '登录失败,请稍后再试', + // icon: 'error', + // }) + // } + // }).finally(() => { + // _loading.value = false + // }) }) .catch((error: FieldValidateError[]) => { toast.fail(error[0].message) diff --git a/code/base-project/base-uniapp-main/src/pages.json b/code/base-project/base-uniapp-main/src/pages.json index 5e45e1fa..7f586b81 100644 --- a/code/base-project/base-uniapp-main/src/pages.json +++ b/code/base-project/base-uniapp-main/src/pages.json @@ -2,8 +2,8 @@ "globalStyle": { "navigationStyle": "default", "navigationBarTitleText": "App", - "navigationBarBackgroundColor": "#fff", - "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#2c3e50", + "navigationBarTextStyle": "white", "backgroundColor": "#FFFFFF" }, "easycom": { diff --git a/code/base-project/base-uniapp-main/src/pages/account/index.vue b/code/base-project/base-uniapp-main/src/pages/account/index.vue index afcdd0c3..3f543977 100644 --- a/code/base-project/base-uniapp-main/src/pages/account/index.vue +++ b/code/base-project/base-uniapp-main/src/pages/account/index.vue @@ -11,6 +11,10 @@ function handleLoginOut() { onConfirm() { toast.success('退出成功') userStore.reset() + + uni.navigateTo({ + url: '/pages-sub/login/index', + }) }, }) } diff --git a/code/base-project/base-uniapp-main/src/style/index.scss b/code/base-project/base-uniapp-main/src/style/index.scss index a3741204..09ac3b9e 100644 --- a/code/base-project/base-uniapp-main/src/style/index.scss +++ b/code/base-project/base-uniapp-main/src/style/index.scss @@ -4,7 +4,7 @@ page, .sar-portal { --sar-input-border-color: #ddd; - --sar-primary: #0064fa; + --sar-primary: #34495E; --sar-rounded: 4rpx; } diff --git a/code/base-project/base-uniapp-main/test.html b/code/base-project/base-uniapp-main/test.html index bf194924..11910410 100644 --- a/code/base-project/base-uniapp-main/test.html +++ b/code/base-project/base-uniapp-main/test.html @@ -1,92 +1,128 @@ - + - - - - 个人中心 - - - -
-

个人中心

-

机构码:123456

-

账户:zhangsan

-
+ .info-item { + display: flex; + justify-content: space-between; + padding: 14px 16px; + font-size: 15px; + border-bottom: 1px solid #e0e0e0; + } -
-
- 修改密码 + .info-item:last-child { + border-bottom: none; + } + + .info-label { + color: #7f8c8d; + } + + .info-value { + font-weight: 500; + color: #2c3e50; + } + + + +
+ +
+
U
+ +
+ + +
+
+ 账号 + zhangsan +
+
+ 机构码 + 123456 +
+
-
- 退出登录 -
-
- - - +