From 1ce6f2140fdf60d0b1e737c7bf387e1541ca551d Mon Sep 17 00:00:00 2001 From: liaoboping <344114999@qq.com> Date: Sun, 7 Sep 2025 19:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=EF=BC=8C=E8=A7=92=E8=89=B2?= =?UTF-8?q?=EF=BC=8C=E5=9B=BE=E5=BD=A2=EF=BC=8C=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E5=BD=95=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 +- .env.production | 5 + public/config.js | 2 + src/assets/images/blank.png | Bin 0 -> 2145 bytes .../Common/Form/AntOriginSelect.vue | 28 +- .../Common/Form/AntOriginTreeSelect.vue | 2 - src/components/Common/Form/Image2Base64.vue | 67 ++++ src/components/Common/register.js | 2 + src/config/router.config.js | 5 + src/permission.js | 2 +- src/router/generator-routers.js | 2 - src/store/modules/user.js | 4 - src/utils/openThirdLogin.js | 11 + src/views/isystem/modules/AErole.vue | 100 ----- src/views/isystem/modules/AEuser.vue | 253 ------------ src/views/isystem/roleList.vue | 314 ++++----------- src/views/isystem/userList.vue | 367 +++++------------- src/views/simulationScene/database/txsjk.vue | 58 ++- src/views/user/Login.vue | 3 +- src/views/user/ThirdLogin.vue | 198 ++++++++++ 20 files changed, 530 insertions(+), 896 deletions(-) create mode 100644 .env.production create mode 100644 src/assets/images/blank.png create mode 100644 src/components/Common/Form/Image2Base64.vue create mode 100644 src/utils/openThirdLogin.js delete mode 100644 src/views/isystem/modules/AErole.vue delete mode 100644 src/views/isystem/modules/AEuser.vue create mode 100644 src/views/user/ThirdLogin.vue diff --git a/.env.development b/.env.development index 5513e9b..12196ea 100644 --- a/.env.development +++ b/.env.development @@ -2,5 +2,4 @@ NODE_ENV=development VUE_APP_PREVIEW=true VUE_APP_API_BASE_URL=/api VUE_APP_API_URL=http://192.168.0.189:8099 -VUE_APP_WEBSOCKET_URL -=ws://192.168.0.96:9001 \ No newline at end of file +VUE_APP_WEBSOCKET_URL=ws://192.168.0.96:9001 \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..9fae15a --- /dev/null +++ b/.env.production @@ -0,0 +1,5 @@ +NODE_ENV=production +VUE_APP_PREVIEW=true +VUE_APP_API_BASE_URL=/api +VUE_APP_API_URL=http://127.0.0.1:8099 +VUE_APP_WEBSOCKET_URL=ws://127.0.0.1:9001 \ No newline at end of file diff --git a/public/config.js b/public/config.js index e1d21dd..c6de118 100644 --- a/public/config.js +++ b/public/config.js @@ -2,4 +2,6 @@ window._CONFIG = { ImageryProviderUrl: '/map/mapWX/{z}/{x}/{y}.jpg', RoadProviderUrl: '', TerrainProviderUrl: '/map/mapDem/', + thirdLoginUrl: 'http://127.0.0.1:8080/thirdLogin', + clientId: '0123456789', } diff --git a/src/assets/images/blank.png b/src/assets/images/blank.png new file mode 100644 index 0000000000000000000000000000000000000000..87e8056accd1df8466a64a230a11b1dd0b1c1edc GIT binary patch literal 2145 zcmcguX;jh+7XP;lX=8lho-ncI%qLaH-P{N(SybB0W1+YNw4jn8YqY5~JlK)>YGxO*m8@Tz}zg9Ru zRI7Kqj=^9snTI|p=@xz4lr$Dj3I;+L8tq;e@SQyQj8?1}Ef@*wO52a6D~*K>)$_sH z_AoPswnNgh^E9zo45y~Qu(r$`=WsY{Yk2$8oRE|al0+mD&CTh*l)bW76^1i890M(O ze3}b~5x(TZkH%aU#6Za{IxmC2>6&HUzcES;o@*>|dtO$&yuMyvGfxd3sn_J^odJ18 zX|!8(UovJkH8o}N1V4VvMA`IPXtpEXuUe_9!dh2s`z%YA7l@!6$6u z1DUcN7(~G}8;bXdgZ|OfG{=@mjjlQ=x@l_W_t*6FG{)p3Uc44mJ)iJy;vI`c5+k+~ zJ1~)K|JqT$%HA|ToWjYghARDd_9%aSQ#@3nCjzI`*A*6}5=c>D!J6||%k6P~OWiK8Q5`Qavy zWW?Dv7nD;J+A3L5C=^QWl8lAgT?oq>e3F~yZ*$>-QP*~s{C9z`S)n+37Z;$hFfe#^S=@uESv%*kyDl`+1J5}yBx&`<}k^xaNggKU{)f(kds z8I(;tGC!e?xZ|MqZ(X03D!L`bwpTr;ecnHd$X$B)WVNtmG$?w}wiiG4wK9`+5A}D_ z1lZoh`t89Sxn-5pAahyE?eGxrV%~gX%{-Ly0De^I_HNS;6#1l9p?E1yV_|oRB!qt| z_2V^}KjBMpw)fzRHGdd>#%!evHYwax3hP1V)QBJ<^0L(}T0p0(E_K&XY z@GTE~_D)MVHYJ=tGkn`LZgF$0Zz;f3&$pZ~o)8R0K1cRs`Q1gHLK_818>}{FD^7Ha zwx_xRydJNGFHcwe{AthKbQ$uzGr8jZp45Q}EDsc~5;&p7gYt@sUgwlA5A-D}9~h2e zAWKNGOp$$YNIl8cw$h4o5&~%r6gQD<45_fH=I`3*#vy+r%?ziywgX=+l}0_J$#UDg3Vfx4VMQwMZZ=5 z{^c$=7FW5{{n2fjwMui$?r4J?N@YwU1J(b+xKAE0FUZ7~Pg1)LQ4PwjVmw z6*AELA_tsJ!!@|=lnV$qdA+9{1a^1U?G-3EcZ+yq^>$Miw|VHCtW(Tj+V)@%s;of2 zao873hHGu{Z=jL10dq(2JyjK>RQZ{MTCLR|FD!;fc`wWiyE;sL8cfrDUW-sPm?{hiDorV6BYxj*>kjJz;)B(3QFr&UuMa#>m=Rp#qn?__!4zu(FKq6&jaz|OPJ V%8PuW<)l9Y;OgW7t8v7n{0ozO`(6M5 literal 0 HcmV?d00001 diff --git a/src/components/Common/Form/AntOriginSelect.vue b/src/components/Common/Form/AntOriginSelect.vue index ca90d38..ebf5bcb 100644 --- a/src/components/Common/Form/AntOriginSelect.vue +++ b/src/components/Common/Form/AntOriginSelect.vue @@ -31,21 +31,21 @@ export default { immediate: { type: Boolean, default: true }, allowEmpty: { type: [Boolean, Array], default: true }, }, - data () { + data() { return { originData: [], } }, computed: { _value: { - get () { + get() { return this.value }, - set (val) { + set(val) { this.$emit('input', val) }, }, - getListeners () { + getListeners() { const listeners = {} for (const key in this.$listeners) { if (key === 'change') continue @@ -53,40 +53,40 @@ export default { } return listeners }, - selectMode () { + selectMode() { return this.multiple ? 'multiple' : '' }, - options () { + options() { return this.originData.map((o) => ({ value: o[this.valueKey], label: o[this.labelKey], disabled: o.disabled, })) }, - getText () { + getText() { if (this.multiple) { return (this._value || []).map((v) => this.options.find((o) => o.value === v)?.label).join(',') } else { return this.options.find((o) => o.value === this._value)?.label } }, - getOriginItem () { + getOriginItem() { return (this._value || []).map((v) => this.originData.find((d) => d[this.valueKey] === v)) }, - selectConf () { + selectConf() { return { ...defaultSelectConfig, ...this.$attrs, } }, }, - created () { + created() { if (this.immediate) { this.getOptions(true) } }, methods: { - async getOptions (visible) { + async getOptions(visible) { if (!visible) return try { const res = await this.dataSource() @@ -100,10 +100,10 @@ export default { this.originData = [] } }, - filterOption (input, selectVm) { + filterOption(input, selectVm) { return selectVm.componentOptions.children[0]?.text.toLowerCase().includes(input.toLowerCase()) || false }, - handleChange (v) { + handleChange(v) { this.$nextTick(() => { this.$emit( 'change', @@ -117,7 +117,7 @@ export default { ) }) }, - commitAction (action, payload = true) { + commitAction(action, payload = true) { switch (action) { case 'get': this.getOptions(payload) diff --git a/src/components/Common/Form/AntOriginTreeSelect.vue b/src/components/Common/Form/AntOriginTreeSelect.vue index a7af8d6..a81f4c5 100644 --- a/src/components/Common/Form/AntOriginTreeSelect.vue +++ b/src/components/Common/Form/AntOriginTreeSelect.vue @@ -48,11 +48,9 @@ export default { }, }, getItem() { - console.log('----', this.treeData, this._value) return this.findInTree(this.treeData, this._value) }, getText() { - console.log('----', this.getItem) return this.getItem && this.getItem[this.labelKey] }, getListeners() { diff --git a/src/components/Common/Form/Image2Base64.vue b/src/components/Common/Form/Image2Base64.vue new file mode 100644 index 0000000..3867b56 --- /dev/null +++ b/src/components/Common/Form/Image2Base64.vue @@ -0,0 +1,67 @@ + + + + + \ No newline at end of file diff --git a/src/components/Common/register.js b/src/components/Common/register.js index fcee2b4..d8bff2d 100644 --- a/src/components/Common/register.js +++ b/src/components/Common/register.js @@ -7,6 +7,7 @@ import AntQueryTable from './Layout/AntQueryTable.vue' import AntOriginSelect from './Form/AntOriginSelect.vue' import AntOriginTreeSelect from './Form/AntOriginTreeSelect.vue' import DurationPicker from './Form/DurationPicker.vue' +import Image2Base64 from './Form/Image2Base64.vue' import WangEditor from './WangEditor/Index.vue' @@ -28,6 +29,7 @@ export default { Vue.component('AntOriginSelect', AntOriginSelect) Vue.component('AntOriginTreeSelect', AntOriginTreeSelect) Vue.component('DurationPicker', DurationPicker) + Vue.component('Image2Base64', Image2Base64) Vue.component('WangEditor', WangEditor) diff --git a/src/config/router.config.js b/src/config/router.config.js index ba6a1ad..7569f91 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -174,6 +174,11 @@ export const constantRouterMap = [ name: 'login', component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login'), }, + { + path: 'thirdLogin', + name: 'thirdLogin', + component: () => import(/* webpackChunkName: "user" */ '@/views/user/ThirdLogin'), + }, { path: 'register', name: 'register', diff --git a/src/permission.js b/src/permission.js index 306a213..68d8130 100644 --- a/src/permission.js +++ b/src/permission.js @@ -10,7 +10,7 @@ import store from './store' NProgress.configure({ showSpinner: false }) // NProgress Configuration -const allowList = ['login', 'register', 'registerResult'] // no redirect allowList +const allowList = ['thirdLogin', 'login', 'register', 'registerResult'] // no redirect allowList const loginRoutePath = '/user/login' const defaultRoutePath = '/simulationScene' diff --git a/src/router/generator-routers.js b/src/router/generator-routers.js index 3b01eb3..7ff0642 100644 --- a/src/router/generator-routers.js +++ b/src/router/generator-routers.js @@ -76,7 +76,6 @@ const rootRouter = { // }) // } export const generatorDynamicRouter = token => { - console.log('generatorDynamicRoute111111r') return new Promise((resolve, reject) => { loginService .getCurrentUserNav() @@ -113,7 +112,6 @@ export const generatorDynamicRouter = token => { export const generator = (routerMap, parent) => { return routerMap.map(item => { const { title, show, hideChildren, hiddenHeaderContent, target, icon } = item || item.meta || {} - console.log('xxxxxxxddddd', `${(parent && parent.path) || ''}/${item.key}`) const currentRouter = { // 如果路由设置了 path,则作为默认 path,否则 路由地址 动态拼接生成如 /dashboard/workplace path: item.path || `${(parent && parent.path) || ''}/${item.key}`, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index bc55a89..be202ff 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -53,7 +53,6 @@ const user = { return new Promise((resolve, reject) => { getInfo().then(response => { const result = response.data - console.log('result', result) if (result && result.id) { localStorage.setItem('userId',result.id) localStorage.setItem('uRealName', result.nickName) @@ -67,12 +66,9 @@ const user = { per.actionList = action } }) - console.log('xxxxxxxxxxxxxxxx') // role.permissionList = role.permissions.map(permission => { return permission }) - console.log('xxxxxxxxxxxxxxxx') commit('SET_ROLES', result.roles) commit('SET_INFO', result) - console.log('xxxxxxxxxxxxxxxx') } else { reject(new Error('getInfo: roles must be a non-null array !')) } diff --git a/src/utils/openThirdLogin.js b/src/utils/openThirdLogin.js new file mode 100644 index 0000000..ae8d028 --- /dev/null +++ b/src/utils/openThirdLogin.js @@ -0,0 +1,11 @@ +export default () => { + const redirectUri = window.location.origin + window.location.pathname + window.location.href = + window._CONFIG.thirdLoginUrl + + '?response_type=code&active_type=user&state=' + + Math.random().toString(16).slice(2) + + '&client_id=' + + window._CONFIG.clientId + + '&redirect_uri=' + + btoa(encodeURI(redirectUri)) +} diff --git a/src/views/isystem/modules/AErole.vue b/src/views/isystem/modules/AErole.vue deleted file mode 100644 index 1b5fb04..0000000 --- a/src/views/isystem/modules/AErole.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - diff --git a/src/views/isystem/modules/AEuser.vue b/src/views/isystem/modules/AEuser.vue deleted file mode 100644 index 9bddae2..0000000 --- a/src/views/isystem/modules/AEuser.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - diff --git a/src/views/isystem/roleList.vue b/src/views/isystem/roleList.vue index 7e958e9..5c38517 100644 --- a/src/views/isystem/roleList.vue +++ b/src/views/isystem/roleList.vue @@ -1,258 +1,108 @@