소스 검색

按钮样式

Xiao_123 1 년 전
부모
커밋
948a49df1f

+ 6 - 0
src/api/personal/user.js

@@ -0,0 +1,6 @@
+import http from '@/utils/request'
+
+// 获取用户信息
+export const getUserInfo = (params) => {
+  return http.get('/menduner/system/mde-user/get', params)
+}

+ 1 - 1
src/components/VerificationCode/index.vue

@@ -125,7 +125,7 @@ defineExpose({
 <style lang="scss" scoped>
 .login-code {
   width: 62px;
-  color: var(--default-color); 
+  color: var(--v-primary-base); 
   font-size: 12px; 
   cursor: pointer;
 }

+ 2 - 2
src/layout/personal/footer.vue

@@ -67,9 +67,9 @@ const list = [
   cursor: pointer;
 }
 .bottom span:hover {
-  color: var(--default-color);
+  color: var(--v-primary-base);
 }
 .second div:hover {
-  color: var(--default-color);
+  color: var(--v-primary-base);
 }
 </style>

+ 1 - 1
src/layout/personal/navBar.vue

@@ -103,7 +103,7 @@ const handleLogout = async () => {
 }
 
 const items = ref([
-  { title: '账号与安全中心', change: () => router.push({ path: '/personalAccount' }) },
+  { title: '账号设置', change: () => router.push({ path: '/personalAccount' }) },
   { title: '切换为招聘者', change: changeRole },
   { title: '退出登录', change: handleLogout }
 ])

+ 1 - 1
src/router/modules/personal.js

@@ -11,7 +11,7 @@ const personal = [
         path: '/personalAccount',
         component: () => import('@/views/Home/personal/account/index'),
         meta: {
-          title: '账号与安全中心'
+          title: '账号设置'
         },
         children: [
           {

+ 2 - 1
src/store/user.js

@@ -15,6 +15,7 @@ export const userLocaleStore = defineStore('user',
           console.log(data, 'res-login')
           setToken(data.accessToken)
           userInfo = data
+          localStorage.setItem('userInfo', JSON.stringify(data))
           localStorage.setItem('expiresTime', data.expiresTime) // token过期时间
           resolve()
         }).catch(err => { reject(err) })
@@ -25,7 +26,7 @@ export const userLocaleStore = defineStore('user',
       await logout()
       deleteToken()
       userInfo = {}
-      localStorage.removeItem('expiresTime')
+      localStorage.clear()
     }
     return {
       userInfo,

+ 15 - 1
src/styles/index.css

@@ -1,4 +1,18 @@
 :root {
   --zIndex-dialog: 9999;
-  --default-color: #00897B;
+  --v-primary-base: #00897B;
+  --v-primary-lighten1: #26A69A;
+  --v-primary-lighten2: #4DB6AC;
+  --v-primary-lighten3: #80CBC4;
+  --v-primary-lighten4: #B2DFDB;
+}
+
+.buttons {
+  height: 36px;
+  width: 224px;
+}
+
+.half-button {
+  height: 36px;
+  width: 88px;
 }

+ 1 - 1
src/styles/index.min.css

@@ -1 +1 @@
-:root{--zIndex-dialog:9999;--default-color:#00897B}
+:root{--zIndex-dialog:9999;--v-primary-base:#00897B;--v-primary-lighten1:#26A69A;--v-primary-lighten2:#4DB6AC;--v-primary-lighten3:#80CBC4;--v-primary-lighten4:#B2DFDB}.buttons{height:36px;width:224px}.half-button{height:36px;width:88px}

+ 15 - 1
src/styles/index.scss

@@ -1,4 +1,18 @@
 :root {
   --zIndex-dialog: 9999;
-  --default-color: #00897B;
+  --v-primary-base: #00897B;
+  --v-primary-lighten1: #26A69A;
+  --v-primary-lighten2: #4DB6AC;
+  --v-primary-lighten3: #80CBC4;
+  --v-primary-lighten4: #B2DFDB;
+}
+// 长按钮
+.buttons {
+  height: 36px;
+  width: 224px;
+}
+// 短按钮
+.half-button {
+  height: 36px;
+  width: 88px;
 }

+ 2 - 2
src/styles/protocol/index.css

@@ -58,7 +58,7 @@ del, ins, u, s, a, a:hover {
 .large {
   width: 100%;
   height: 1px;
-  background-color: var(--default-color);
+  background-color: var(--v-primary-base);
 }
 
 .Protocol {
@@ -87,7 +87,7 @@ del, ins, u, s, a, a:hover {
 }
 
 .subtitle, .crosshead {
-  color: var(--default-color);
+  color: var(--v-primary-base);
   font-size: 14px;
   line-height: 30px;
 }

+ 1 - 1
src/styles/protocol/index.min.css

@@ -1 +1 @@
-html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:0;padding:0}header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block}table{border-collapse:collapse;border-spacing:0}caption,th{text-align:left;font-weight:normal}html,body,fieldset,img,iframe,abbr{border:0}i,cite,em,var,address,dfn{font-style:normal}[hidefocus],summary{outline:0}li{list-style:none}h1,h2,h3,h4,h5,h6,small{font-size:100%}a,button{cursor:pointer}h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold}del,ins,u,s,a,a:hover{text-decoration:none}.conter,.conttle{width:100%;overflow:hidden}.large{width:100%;height:1px;background-color:var(--default-color)}.Protocol{width:1040px;margin:0 auto;background-color:#fff;padding:40px 40px 90px;box-sizing:border-box;font-family:"微软雅黑"}.Protocol p{color:#333333;font-size:14px;line-height:30px}.segment{width:100%;font-size:22px;color:#333333;margin-top:45px;margin-bottom:32px;font-weight:700;text-align:center}.subtitle,.crosshead{color:var(--default-color);font-size:14px;line-height:30px}.crosshead{color:#333333}.text-color{margin-top:0px;margin-bottom:0px;padding:0px;color:#333;font-size:14px;line-height:30px;font-family:微软雅黑;white-space:normal}.text-font{font-family:宋体, SimSun}.text-size{margin:0px;padding:0px;font-size:14px;color:#00897B;line-height:30px;font-family:微软雅黑;white-space:normal}.text-p{text-align:justify;font-family:Calibri;font-size:14px;white-space:normal}
+html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:0;padding:0}header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block}table{border-collapse:collapse;border-spacing:0}caption,th{text-align:left;font-weight:normal}html,body,fieldset,img,iframe,abbr{border:0}i,cite,em,var,address,dfn{font-style:normal}[hidefocus],summary{outline:0}li{list-style:none}h1,h2,h3,h4,h5,h6,small{font-size:100%}a,button{cursor:pointer}h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold}del,ins,u,s,a,a:hover{text-decoration:none}.conter,.conttle{width:100%;overflow:hidden}.large{width:100%;height:1px;background-color:var(--v-primary-base)}.Protocol{width:1040px;margin:0 auto;background-color:#fff;padding:40px 40px 90px;box-sizing:border-box;font-family:"微软雅黑"}.Protocol p{color:#333333;font-size:14px;line-height:30px}.segment{width:100%;font-size:22px;color:#333333;margin-top:45px;margin-bottom:32px;font-weight:700;text-align:center}.subtitle,.crosshead{color:var(--v-primary-base);font-size:14px;line-height:30px}.crosshead{color:#333333}.text-color{margin-top:0px;margin-bottom:0px;padding:0px;color:#333;font-size:14px;line-height:30px;font-family:微软雅黑;white-space:normal}.text-font{font-family:宋体, SimSun}.text-size{margin:0px;padding:0px;font-size:14px;color:#00897B;line-height:30px;font-family:微软雅黑;white-space:normal}.text-p{text-align:justify;font-family:Calibri;font-size:14px;white-space:normal}

+ 2 - 2
src/styles/protocol/index.scss

@@ -56,7 +56,7 @@ del,ins,u,s,a,a:hover {
 .large {
   width: 100%;
   height: 1px;
-  background-color: var(--default-color);
+  background-color: var(--v-primary-base);
 }
 
 .Protocol {
@@ -85,7 +85,7 @@ del,ins,u,s,a,a:hover {
 }
 
 .subtitle,.crosshead {
-  color: var(--default-color);
+  color: var(--v-primary-base);
   font-size: 14px;
   line-height: 30px;
 }

+ 1 - 0
src/utils/request.js

@@ -16,6 +16,7 @@ service.interceptors.request.use(
     config.headers['tenant-id'] = import.meta.env.VITE_TENANTCODE
     if (getToken()) {
       config.headers.token = `Bearer ${getToken()}`
+      config.headers.Authorization = `Bearer ${getToken()}`
     }
     config.headers.token = `Bearer ${getToken()}`
     return config

+ 26 - 1
src/views/Home/personal/account/dynamic/editPassword.vue

@@ -2,6 +2,10 @@
   <div>
     <h3>修改密码</h3>
     <v-divider class="mb-4"></v-divider>
+    <div>
+      <div class="login-user">当前登录账号: <span style="color: #483d3d;">13229740091</span></div>
+      <div class="error-tips mt-2 mb-1">检测到当前账号未设置密码,设置后可使用账号密码进行登录。</div>
+    </div>
     <div style="width: 300px;">
       <PhonePage ref="phoneRef"></PhonePage>
       <v-form ref="passwordRef">
@@ -38,8 +42,9 @@
 <script setup name="editPassword">
 import PhonePage from '@/components/VerificationCode'
 import { resetPassword } from '@/api/common/index'
-
+import { getUserInfo } from '@/api/personal/user'
 import { ref, reactive, computed } from 'vue'
+
 const phoneRef = ref()
 const passwordRef = ref()
 const passwordType = ref(false)
@@ -53,6 +58,17 @@ const passwordCheck = computed(() => {
   return query.checkPassword === query.password || '两次密码输入不一致'
 })
 
+const getUserInfos = async () => {
+  const userInfo = JSON.parse(localStorage.getItem('userInfo'))
+  try {
+    const { data } = await getUserInfo({ id: userInfo.userId })
+    console.log(data, 'data')
+  } catch (error) {
+    console.log(error, 'error')
+  }
+}
+getUserInfos()
+
 const handleSubmit = async () => {
   const { valid: phoneValid } = await phoneRef.value.phoneForm.validate()
   const { valid: passValid} = await passwordRef.value.validate()
@@ -75,4 +91,13 @@ h3 {
   font-weight: 600;
   padding-bottom: 25px;
 }
+.error-tips {
+  color: #f44336;
+  font-size: 14px;
+  font-weight: 600;
+}
+.login-user {
+  color: grey;
+  font-weight: 600;
+}
 </style>

+ 4 - 7
src/views/Home/personal/account/index.vue

@@ -2,7 +2,7 @@
 <template>
   <div class="d-flex" style="height: 700px;">
     <v-card class="left">
-      <h3>账号与安全中心</h3>
+      <h3>账号设置</h3>
       
       <v-list>
         <v-list-item
@@ -25,13 +25,10 @@
 <script setup>
 defineOptions({ name:'personal-account-index'})
 const items = [
-  { title: '首页', value: 1, },
-  { title: '账号管理', value: 2, },
-  { title: '权限管理', value: 3, },
+  { title: '账号绑定', value: 1, },
+  { title: '实名认证', value: 2, },
   { title: '修改密码', path: '/personalAccount/editPassword', },
-  { title: '身份验证', value: 5, },
-  { title: '个人信息管理', value: 6, },
-  { title: '登录设备管理', value: 7, },
+  { title: '隐私设置', value: 4 }
 ]
 </script>
 

+ 1 - 1
src/views/login/components/phonePage.vue

@@ -124,7 +124,7 @@ defineExpose({
 <style lang="scss" scoped>
 .login-code {
   width: 62px;
-  color: var(--default-color); 
+  color: var(--v-primary-base); 
   font-size: 12px; 
   cursor: pointer;
 }

+ 1 - 1
src/views/login/index.vue

@@ -184,6 +184,6 @@ const handlePrivacyPolicy = () => {
 }
 
 .color {
-  color: var(--default-color); 
+  color: var(--v-primary-base); 
 }
 </style>