第三方登录
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
8c292eed42
commit
db750bd87c
@ -55,6 +55,7 @@
|
|||||||
"unplugin-svg-component": "0.12.1",
|
"unplugin-svg-component": "0.12.1",
|
||||||
"unplugin-vue-components": "28.4.1",
|
"unplugin-vue-components": "28.4.1",
|
||||||
"vite": "6.2.3",
|
"vite": "6.2.3",
|
||||||
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-svg-loader": "5.1.0",
|
"vite-svg-loader": "5.1.0",
|
||||||
"vitest": "3.0.9",
|
"vitest": "3.0.9",
|
||||||
"vue-tsc": "2.2.8"
|
"vue-tsc": "2.2.8"
|
||||||
|
29
src/common/assets/iconfont/iconfont.css
Normal file
29
src/common/assets/iconfont/iconfont.css
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "iconfont"; /* Project id 4963823 */
|
||||||
|
/* Color fonts */
|
||||||
|
src:
|
||||||
|
url('//at.alicdn.com/t/c/font_4963823_az9ar7pc4xi.woff2?t=1751352287411') format('woff2'),
|
||||||
|
url('//at.alicdn.com/t/c/font_4963823_az9ar7pc4xi.woff?t=1751352287411') format('woff'),
|
||||||
|
url('//at.alicdn.com/t/c/font_4963823_az9ar7pc4xi.ttf?t=1751352287411') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-family: "iconfont" !important;
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-weibo1:before {
|
||||||
|
content: "\e636";
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-qq:before {
|
||||||
|
content: "\e66a";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.icon-weixin:before {
|
||||||
|
content: "\e607";
|
||||||
|
}
|
@ -11,6 +11,7 @@ import "nprogress/nprogress.css";
|
|||||||
import "element-plus/theme-chalk/dark/css-vars.css";
|
import "element-plus/theme-chalk/dark/css-vars.css";
|
||||||
import "vxe-table/lib/style.css";
|
import "vxe-table/lib/style.css";
|
||||||
import "@@/assets/styles/index.scss";
|
import "@@/assets/styles/index.scss";
|
||||||
|
import "@@/assets/iconfont/iconfont.css";
|
||||||
import "virtual:uno.css";
|
import "virtual:uno.css";
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import { loginApi } from "./apis";
|
|||||||
import Owl from "./components/Owl.vue";
|
import Owl from "./components/Owl.vue";
|
||||||
import { useFocus } from "./composables/useFocus";
|
import { useFocus } from "./composables/useFocus";
|
||||||
import { reactive, ref, inject } from "vue";
|
import { reactive, ref, inject } from "vue";
|
||||||
const $md5 = inject('md5')
|
const $md5 = inject("md5");
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ async function handleUserLogin(formEl) {
|
|||||||
await formEl.validate((valid, fields) => {
|
await formEl.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
loginFormData.password = $md5(loginFormData.password)
|
loginFormData.password = $md5(loginFormData.password);
|
||||||
loginApi(loginFormData)
|
loginApi(loginFormData)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
userStore.setToken(data.token);
|
userStore.setToken(data.token);
|
||||||
@ -355,6 +355,23 @@ watch(isDisabled, (newVal, oldVal) => {
|
|||||||
>
|
>
|
||||||
<el-link type="primary" @click="forgetPwd()">忘记密码? </el-link>
|
<el-link type="primary" @click="forgetPwd()">忘记密码? </el-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="login-thirdprty">
|
||||||
|
<div class="css-1vli2z"></div>
|
||||||
|
<div class="css-wna3id">其他方式登录</div>
|
||||||
|
<div class="css-1vli2z"></div>
|
||||||
|
</div>
|
||||||
|
<div class="iconAll">
|
||||||
|
<button>
|
||||||
|
<i class="iconfont icon-weixin"></i>
|
||||||
|
</button>
|
||||||
|
<button>
|
||||||
|
<i class="iconfont icon-qq"></i>
|
||||||
|
</button>
|
||||||
|
<button>
|
||||||
|
<i class="iconfont icon-weibo1"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<el-form
|
<el-form
|
||||||
v-if="isForgetPwd"
|
v-if="isForgetPwd"
|
||||||
ref="forgetFormRef"
|
ref="forgetFormRef"
|
||||||
@ -537,6 +554,36 @@ watch(isDisabled, (newVal, oldVal) => {
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.login-thirdprty {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 20px;
|
||||||
|
display: flex;
|
||||||
|
color: #9196a1;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
.css-1vli2z {
|
||||||
|
width: 128px;
|
||||||
|
height: 0;
|
||||||
|
border-top: 1px solid #ebeced;
|
||||||
|
}
|
||||||
|
.css-wna3id {
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.iconAll {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
margin-top: 20px;
|
||||||
|
button {
|
||||||
|
border: none;
|
||||||
|
background-color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
i {
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
types/auto/components.d.ts
vendored
3
types/auto/components.d.ts
vendored
@ -18,6 +18,7 @@ declare module 'vue' {
|
|||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||||
@ -38,6 +39,8 @@ declare module 'vue' {
|
|||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||||
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||||
ElTag: typeof import('element-plus/es')['ElTag']
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
|
@ -10,7 +10,8 @@ import { ElementPlusResolver } from "unplugin-vue-components/resolvers"
|
|||||||
import Components from "unplugin-vue-components/vite"
|
import Components from "unplugin-vue-components/vite"
|
||||||
import { defineConfig, loadEnv } from "vite"
|
import { defineConfig, loadEnv } from "vite"
|
||||||
import svgLoader from "vite-svg-loader"
|
import svgLoader from "vite-svg-loader"
|
||||||
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||||
|
import path from 'path'
|
||||||
// Configuring Vite: https://cn.vite.dev/config
|
// Configuring Vite: https://cn.vite.dev/config
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const { VITE_PUBLIC_PATH } = loadEnv(mode, process.cwd(), "") as ImportMetaEnv
|
const { VITE_PUBLIC_PATH } = loadEnv(mode, process.cwd(), "") as ImportMetaEnv
|
||||||
@ -131,7 +132,13 @@ export default defineConfig(({ mode }) => {
|
|||||||
Components({
|
Components({
|
||||||
dts: "types/auto/components.d.ts",
|
dts: "types/auto/components.d.ts",
|
||||||
resolvers: [ElementPlusResolver()]
|
resolvers: [ElementPlusResolver()]
|
||||||
})
|
}),
|
||||||
|
// iconfont
|
||||||
|
createSvgIconsPlugin({
|
||||||
|
iconDirs: [path.resolve(process.cwd(), 'src/common/assets/icons')],
|
||||||
|
symbolId: 'icon-[dir]-[name]',
|
||||||
|
}),
|
||||||
|
|
||||||
],
|
],
|
||||||
// Configuring Vitest: https://cn.vitest.dev/config
|
// Configuring Vitest: https://cn.vitest.dev/config
|
||||||
test: {
|
test: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user