mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-05 19:41:59 +08:00
chore: remove crypto-js
This commit is contained in:
parent
1bb05bf4c3
commit
3300188081
@ -78,6 +78,10 @@ If you feel that this project is helpful for your work or study, please help me
|
||||
|
||||

|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#chansee97/nova-admin&Date)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
@ -78,6 +78,10 @@ Nova-Admin 是完全开源免费的项目,目前仍然在优化迭代中,旨
|
||||
|
||||

|
||||
|
||||
## Star 历史
|
||||
|
||||
[](https://star-history.com/#chansee97/nova-admin&Date)
|
||||
|
||||
## 协议
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
@ -53,7 +53,6 @@
|
||||
"@tinymce/tinymce-vue": "^5.1.1",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"alova": "^2.17.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
"echarts": "^5.5.0",
|
||||
"md-editor-v3": "^4.11.3",
|
||||
"pinia": "^2.1.7",
|
||||
@ -66,7 +65,6 @@
|
||||
"@antfu/eslint-config": "^2.8.3",
|
||||
"@iconify-json/icon-park-outline": "^1.1.15",
|
||||
"@iconify/vue": "^4.1.1",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/node": "^20.11.28",
|
||||
"@types/qs": "^6.9.12",
|
||||
"@vitejs/plugin-vue": "^5.0.4",
|
||||
|
@ -9,7 +9,7 @@ const text = useVModel(props, 'modelValue', emit)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="copy-wrap">
|
||||
<div v-if="text" class="copy-wrap">
|
||||
<n-ellipsis :style="{ 'max-width': maxLength || '12em' }">
|
||||
{{ text }}
|
||||
</n-ellipsis>
|
||||
|
@ -2,7 +2,7 @@
|
||||
import HeaderButton from '../common/HeaderButton.vue'
|
||||
|
||||
function toMyGithub() {
|
||||
window.open('https://github.com/chansee97')
|
||||
window.open('https://github.com/chansee97/nova-admin')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -6,7 +6,11 @@ interface Ilogin {
|
||||
}
|
||||
|
||||
export function fetchLogin(params: Ilogin) {
|
||||
return alovaInstance.Post<any>('/login', params)
|
||||
const methodInstance = alovaInstance.Post<any>('/login', params)
|
||||
methodInstance.meta = {
|
||||
authRole: null,
|
||||
}
|
||||
return methodInstance
|
||||
}
|
||||
export function fetchUpdateToken(params: any) {
|
||||
const method = alovaInstance.Post<ApiAuth.loginToken>('/updateToken', params)
|
||||
|
@ -7,8 +7,6 @@ const isHttpProxy = import.meta.env.VITE_HTTP_PROXY === 'Y' || false
|
||||
|
||||
export const request = createAlovaInstance({
|
||||
baseURL: isHttpProxy ? urlPattern : url,
|
||||
}, {
|
||||
msgKey: 'msg',
|
||||
})
|
||||
|
||||
export const alovaInstance = createAlovaInstance({
|
||||
|
@ -1,6 +1,4 @@
|
||||
import qs from 'qs'
|
||||
import { ERROR_NO_TIP_STATUS } from './config'
|
||||
import { isArray, isEmpty, isFile, isNullOrUnDef } from '@/utils'
|
||||
|
||||
export function showError(error: Service.RequestError) {
|
||||
// 如果error不需要提示,则跳过
|
||||
@ -10,41 +8,3 @@ export function showError(error: Service.RequestError) {
|
||||
|
||||
window.$message?.error(error.msg)
|
||||
}
|
||||
/**
|
||||
* 请求数据的转换
|
||||
* @param requestData - 请求数据
|
||||
* @param contentType - 请求头的Content-Type
|
||||
*/
|
||||
export function transformRequestData(
|
||||
requestData: any,
|
||||
contentType?: UnionKey.ContentType,
|
||||
) {
|
||||
// application/json类型不处理,清除发送参数的无效字段
|
||||
let data: any = requestData
|
||||
|
||||
// form类型转换
|
||||
if (contentType === 'application/x-www-form-urlencoded')
|
||||
data = qs.stringify(data)
|
||||
|
||||
// form-data类型转换
|
||||
if (contentType === 'multipart/form-data')
|
||||
data = handleFormData(data)
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
function handleFormData(data: Record<string, any>) {
|
||||
const formData = new FormData()
|
||||
const entries = Object.entries(data)
|
||||
|
||||
entries.forEach(([key, value]) => {
|
||||
const isFileType
|
||||
= isFile(value) || (isArray(value) && value.length && isFile(value[0]))
|
||||
|
||||
if (isFileType && isArray(value))
|
||||
value.forEach(item => formData.append(key, item))
|
||||
else formData.append(key, value)
|
||||
})
|
||||
|
||||
return formData
|
||||
}
|
||||
|
@ -10,16 +10,10 @@ const roleList: Auth.RoleType[] = ['super', 'admin', 'user']
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
权限示例:
|
||||
<n-card title="权限示例">
|
||||
<n-h1> 当前权限:{{ role }}</n-h1>
|
||||
<n-button-group>
|
||||
<n-button
|
||||
v-for="item in roleList"
|
||||
:key="item"
|
||||
type="default"
|
||||
@click="authStore.toggleUserRole(item)"
|
||||
>
|
||||
<n-button v-for="item in roleList" :key="item" type="default" @click="authStore.toggleUserRole(item)">
|
||||
{{ item }}
|
||||
</n-button>
|
||||
</n-button-group>
|
||||
@ -45,7 +39,7 @@ const roleList: Auth.RoleType[] = ['super', 'admin', 'user']
|
||||
admin和user可见
|
||||
</n-button>
|
||||
</n-space>
|
||||
</div>
|
||||
</n-card>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
@ -3,7 +3,10 @@ const text = ref('nova-admin')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<n-card title="二维码">
|
||||
<n-alert :show-icon="false" type="info">
|
||||
使用navieUI - QR Code 实现
|
||||
</n-alert>
|
||||
<n-qr-code :value="text" />
|
||||
<n-input v-model:value="text" :maxlength="60" type="text" />
|
||||
</n-card>
|
||||
|
@ -1,17 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
const text = ref('Hello v-copy')
|
||||
const text = ref('Hello nova-admin')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-card>
|
||||
<n-h1> v-copy 使用</n-h1>
|
||||
<n-card title="剪切板示例">
|
||||
<n-h3>v-copy 指令</n-h3>
|
||||
<n-input-group>
|
||||
<n-input v-model:value="text" placeholder="请输入要复制的内容" />
|
||||
<n-button v-copy="text" type="primary">
|
||||
v-copy复制
|
||||
</n-button>
|
||||
</n-input-group>
|
||||
<n-h1> copy-text组件 使用</n-h1>
|
||||
<n-h3>copy-text 组件</n-h3>
|
||||
<copy-text v-model="text" />
|
||||
</n-card>
|
||||
</template>
|
||||
|
@ -3,8 +3,13 @@ const text = ref('# Hello Editor  {
|
||||
msg.value = import.meta.env
|
||||
}
|
||||
function get() {
|
||||
fetachGet({ a: 112211 }).then((res) => {
|
||||
fetachGet({ a: 112211, b: false }).then((res) => {
|
||||
msg.value = res
|
||||
})
|
||||
}
|
||||
@ -118,7 +118,7 @@ function getBlobFile() {
|
||||
msg.value = 'this is blob!'
|
||||
const link = URL.createObjectURL(res)
|
||||
const eleLink = document.createElement('a')
|
||||
eleLink.download = 'okk.png'
|
||||
eleLink.download = 'okk'
|
||||
eleLink.style.display = 'none'
|
||||
eleLink.href = link
|
||||
document.body.appendChild(eleLink)
|
||||
@ -133,7 +133,7 @@ function getBlobFile() {
|
||||
<n-space vertical :size="12">
|
||||
<pre class="bg-#eee">
|
||||
{{ msg }}
|
||||
</pre>
|
||||
</pre>
|
||||
<n-descriptions label-placement="left" bordered>
|
||||
<n-descriptions-item label="检查环境变量">
|
||||
<n-button strong secondary type="success" @click="pinterEnv">
|
||||
|
Loading…
x
Reference in New Issue
Block a user