提交 b15c6950 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 6a6a734e
import fs from 'fs'
import path from 'path'
import chalk from 'chalk'
import OSS from 'ali-oss'
const log = console.log
const __dirname = path.resolve()
const client = new OSS({
region: 'oss-cn-beijing',
accessKeyId: 'LTAIOTuuLTaWoGJj',
accessKeySecret: 'dE5tTGm2lh35eItct2krW2DeH2lf2I',
bucket: 'webapp-pub'
})
async function uploadTarget(src, dist) {
try {
const result = await client.put(dist, path.join(__dirname, src))
log(chalk.green('上传成功', result.url))
} catch (e) {
log(chalk.red('上传失败', src))
log(e)
}
}
function generateUploadTarget(src, dist) {
fs.readdir(path.join(__dirname, src), function (err, files) {
if (err) {
log(err)
return
}
files.forEach(function (file) {
const _src = src + '/' + file
const _dist = dist + '/' + file
const stats = fs.statSync(path.join(__dirname, _src))
// 判断是否为文件
stats.isFile() && uploadTarget(_src, _dist)
// 判断是否为文件夹
stats.isDirectory() && generateUploadTarget(_src, _dist)
})
})
}
generateUploadTarget('./dist', '/website/prod/center-user')
差异被折叠。
...@@ -2,16 +2,19 @@ ...@@ -2,16 +2,19 @@
"name": "user-center", "name": "user-center",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite --mode dev",
"build": "run-p type-check build-only", "build": "vue-tsc --noEmit && vite build --mode prod && npm run deploy",
"build:test": "vue-tsc --noEmit && vite build --mode test",
"build:pre": "vue-tsc --noEmit && vite build --mode pre",
"preview": "vite preview --port 4173", "preview": "vite preview --port 4173",
"build-only": "vite build", "typecheck": "vue-tsc --noEmit",
"type-check": "vue-tsc --noEmit", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" "deploy": "node ./deploy.js"
}, },
"dependencies": { "dependencies": {
"@element-plus/icons-vue": "^2.0.9", "@element-plus/icons-vue": "^2.0.9",
"axios": "^0.27.2", "axios": "^0.27.2",
"blueimp-md5": "^2.19.0",
"element-plus": "^2.2.15", "element-plus": "^2.2.15",
"pinia": "^2.0.21", "pinia": "^2.0.21",
"qs": "^6.11.0", "qs": "^6.11.0",
...@@ -20,14 +23,16 @@ ...@@ -20,14 +23,16 @@
}, },
"devDependencies": { "devDependencies": {
"@rushstack/eslint-patch": "^1.1.4", "@rushstack/eslint-patch": "^1.1.4",
"@types/blueimp-md5": "^2.18.0",
"@types/node": "^16.11.56", "@types/node": "^16.11.56",
"@types/qs": "^6.9.7",
"@vitejs/plugin-vue": "^3.0.3", "@vitejs/plugin-vue": "^3.0.3",
"@vue/eslint-config-typescript": "^11.0.0", "@vue/eslint-config-typescript": "^11.0.0",
"@vue/tsconfig": "^0.1.3", "@vue/tsconfig": "^0.1.3",
"ali-oss": "^6.17.1", "ali-oss": "^6.17.1",
"chalk": "^5.0.1",
"eslint": "^8.21.0", "eslint": "^8.21.0",
"eslint-plugin-vue": "^9.4.0", "eslint-plugin-vue": "^9.4.0",
"npm-run-all": "^4.1.5",
"sass": "^1.54.6", "sass": "^1.54.6",
"typescript": "~4.7.4", "typescript": "~4.7.4",
"unplugin-auto-import": "^0.11.2", "unplugin-auto-import": "^0.11.2",
......
...@@ -179,7 +179,6 @@ defineExpose({ refetch, tableRef }) ...@@ -179,7 +179,6 @@ defineExpose({ refetch, tableRef })
:data="dataList" :data="dataList"
v-loading="loading" v-loading="loading"
v-bind="$attrs" v-bind="$attrs"
style="height: 100%"
ref="tableRef" ref="tableRef"
> >
<el-table-column align="center" v-bind="item || {}" v-for="item in columns" :key="item.prop"> <el-table-column align="center" v-bind="item || {}" v-for="item in columns" :key="item.prop">
......
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { getUser, logout } from '@/api/base' import { getUser, logout } from '@/api/base'
import type { UserType } from '@/types' import type { UserType, PermissionType } from '@/types'
interface State { interface State {
user: UserType | null user: UserType | null
permissions: PermissionType[]
} }
export const useUserStore = defineStore({ export const useUserStore = defineStore({
id: 'user', id: 'user',
state: (): State => ({ state: (): State => ({
user: null user: null,
permissions: []
}), }),
getters: { getters: {
isLogin: state => !!state.user, isLogin: state => !!state.user,
......
...@@ -18,3 +18,15 @@ export interface UserType { ...@@ -18,3 +18,15 @@ export interface UserType {
nickname: string nickname: string
avatar: string avatar: string
} }
// 权限信息
export interface PermissionType {
desc: string
effect_uris: string
id: string
name: string
parent_id: string
system_tag: number
type: number
tag: string
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论