diff --git a/package.json b/package.json index 174f025..870d178 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@element-plus/icons-vue": "^2.3.1", "axios": "^1.9.0", + "cropperjs": "1.5.13", "crypto-js": "^4.2.0", "element-plus": "^2.9.10", "nprogress": "^0.2.0", diff --git a/src/api/model/auth.ts b/src/api/model/auth.ts index 7043e73..169e0f8 100644 --- a/src/api/model/auth.ts +++ b/src/api/model/auth.ts @@ -16,4 +16,16 @@ export default { logout: async function(){ return await http.get("logout"); }, + saveTag: async function(data = {}) { + return await http.post("save/tag", data); + }, + saveInfo: async function(data = {}) { + return await http.post("save/info", data); + }, + loginLog: async function(data){ + return await http.get("log/login", data); + }, + savePass: async function(data = {}) { + return await http.post("save/pass", data); + }, } diff --git a/src/api/model/system.ts b/src/api/model/system.ts index b492bd2..c636092 100644 --- a/src/api/model/system.ts +++ b/src/api/model/system.ts @@ -2,36 +2,36 @@ import http from "@/utils/request" export default { account: { - list: async function(data={}){ + list: async function (data = {}) { return await http.get("account/list", data); }, - add: async function(data={}){ + add: async function (data = {}) { return await http.post("account/add", data); }, - edit: async function(data={}){ + edit: async function (data = {}) { return await http.put("account/edit", data); }, - del: async function(data={}){ + del: async function (data = {}) { return await http.delete("account/del", data); }, }, menu: { - list: async function(data={}){ + list: async function (data = {}) { return await http.get("menu/list", data); }, - add: async function(data = {}){ + add: async function (data = {}) { return await http.post("menu/add", data); }, - edit: async function(data = {}){ + edit: async function (data = {}) { return await http.put("menu/edit", data); }, - del: async function(data = {}){ + del: async function (data = {}) { return await http.delete("menu/del", data); }, - option: async function(data={}){ + option: async function (data = {}) { return await http.get("menu/option", data); }, - quick: async function(data = {}){ + quick: async function (data = {}) { return await http.post("menu/quick", data); }, }, @@ -86,4 +86,7 @@ export default { return await http.get("post/option", data); }, }, + upload: async function (data, config = {}) { + return await http.post("upload", data, config); + }, } diff --git a/src/assets/icons/Birthday.vue b/src/assets/icons/Birthday.vue new file mode 100644 index 0000000..3baa4ea --- /dev/null +++ b/src/assets/icons/Birthday.vue @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icons/Sex.vue b/src/assets/icons/Sex.vue new file mode 100644 index 0000000..d20ea9f --- /dev/null +++ b/src/assets/icons/Sex.vue @@ -0,0 +1,3 @@ + + + diff --git a/src/components/piCropper/index.vue b/src/components/piCropper/index.vue new file mode 100644 index 0000000..df16e4f --- /dev/null +++ b/src/components/piCropper/index.vue @@ -0,0 +1,75 @@ + + + + + + + 图像预览 + + + + + + + diff --git a/src/components/piPasswordStrength/index.vue b/src/components/piPasswordStrength/index.vue new file mode 100644 index 0000000..a72bef4 --- /dev/null +++ b/src/components/piPasswordStrength/index.vue @@ -0,0 +1,79 @@ + + + + + + + + + diff --git a/src/components/piTable/index.vue b/src/components/piTable/index.vue index ddcdb70..3bd7340 100644 --- a/src/components/piTable/index.vue +++ b/src/components/piTable/index.vue @@ -1,6 +1,6 @@ - + @@ -125,6 +125,7 @@ const props = defineProps({ remoteSummary: {type: Boolean, default: false}, hidePagination: {type: Boolean, default: false}, hideDo: {type: Boolean, default: false}, + hideAct: {type: Boolean, default: false}, hideRefresh: {type: Boolean, default: false}, hideSetting: {type: Boolean, default: false}, paginationLayout: {type: String, default: config.paginationLayout}, diff --git a/src/components/piUpload/file.vue b/src/components/piUpload/file.vue new file mode 100644 index 0000000..d52f591 --- /dev/null +++ b/src/components/piUpload/file.vue @@ -0,0 +1,192 @@ + + + + + 上传 + + + {{tip}} + + + + + + + + + diff --git a/src/components/piUpload/index.vue b/src/components/piUpload/index.vue new file mode 100644 index 0000000..83049e3 --- /dev/null +++ b/src/components/piUpload/index.vue @@ -0,0 +1,285 @@ + + + + + + + + + + + + + Loading... + + + + + + + + + + + + + {{title}} + + + + + + + + + 取 消 + 确 定 + + + + + + + + diff --git a/src/components/piUpload/multiple.vue b/src/components/piUpload/multiple.vue new file mode 100644 index 0000000..4085352 --- /dev/null +++ b/src/components/piUpload/multiple.vue @@ -0,0 +1,257 @@ + + + + + + + + {{tip}} + + + + + + + Loading... + + + + + + + + + + + + + + + + + + + diff --git a/src/config/icon.js b/src/config/icon.ts similarity index 100% rename from src/config/icon.js rename to src/config/icon.ts diff --git a/src/config/upload.ts b/src/config/upload.ts new file mode 100644 index 0000000..a5e13bc --- /dev/null +++ b/src/config/upload.ts @@ -0,0 +1,18 @@ +import API from "@/api"; + +//上传配置 + +export default { + apiObj: API.system.upload, //上传请求API对象 + filename: "file", //form请求时文件的key + successCode: 0, //请求完成代码 + maxSize: 10, //最大文件大小 默认10MB + parseData: function (res) { + return { + fileName: res.fileName, + src: res.filePath, + } + }, + apiObjFile: API.system.upload, //附件上传请求API对象 + maxSizeFile: 10 //最大文件大小 默认10MB +} diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 2c23f30..34b9b77 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -178,7 +178,7 @@ function closeHandle() { //个人信息 function handleUser(command) { if (command === "uc") { - router.push({path: '/usercenter'}); + router.push({path: '/system/user'}); } if (command === "cmd") { router.push({path: '/cmd'}); diff --git a/src/pi.ts b/src/pi.ts index 02f9951..8630e17 100644 --- a/src/pi.ts +++ b/src/pi.ts @@ -12,6 +12,7 @@ import errorHandler from "@/utils/errorHandler"; import piDialog from "@/components/piDialog" import piTable from "@/components/piTable" import piPage from "@/components/piPage" +import piUpload from "@/components/piUpload" export default { install(app: App) { @@ -19,6 +20,7 @@ export default { app.component('piDialog', piDialog) app.component('piTable', piTable) app.component('piPage', piPage) + app.component('piUpload', piUpload) //注册全局指令 app.directive('auth', auth) diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 8e4d166..ff337d6 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -143,6 +143,24 @@ const tools = { } } return arr + }, + getBrowser(userAgent: string) { + // 检测浏览器类型和版本 + if (/Opera|OPR/.test(userAgent)) { + return 'Opera'; + } else if (/Edg/.test(userAgent)) { + return 'Edge'; + } else if (/Chrome/.test(userAgent)) { + return 'Chrome'; + } else if (/Safari/.test(userAgent)) { + return 'Safari'; + } else if (/Firefox/.test(userAgent)) { + return 'Firefox'; + } else if (/MSIE|Trident/.test(userAgent)) { + return 'IE'; + } else { + return '未知' + } } } diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index bcbd6dc..fcac4b0 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -3,13 +3,128 @@ - {{nicknameF}} - {{userInfo.nickname||userInfo.username}} - {{userInfo.bio}} + + {{ nicknameF }} + + {{ userInfo.nickname || userInfo.username }} + {{ userInfo.bio }} + + + + + + + + {{ userInfo.posts.map(item => item.post_name)?.join(" && ") }} + + + + + + + {{ userInfo.birthday || "保密" }} + + + + + + + {{ sex }} + + + + + + + {{ userInfo.dept?.join(" - ") }} + + + + + {{ tag }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保 存 + + + + + + + + + 必须提供当前登录用户密码才能进行更改 + + + + + 请输入包含英文、数字的6位以上密码 + + + + + + 保存密码 + + + + + + + + + + {{scope.row.code == 0 ? '成功' : '失败'}} + + + + + + {{tools.getBrowser(scope.row.ua)}} + + + + + + @@ -18,29 +133,164 @@ -
{{userInfo.nickname||userInfo.username}}
{{userInfo.bio}}
+ {{ userInfo.nickname || userInfo.username }}
{{ userInfo.bio }}