feat: 蓝星登录
This commit is contained in:
@@ -237,6 +237,18 @@ export function getPermissionInfo() {
|
|||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取token
|
||||||
|
export function socialLogin(token) {
|
||||||
|
return request({
|
||||||
|
url: '/admin-api/system/auth/social-login',
|
||||||
|
method: 'post',
|
||||||
|
token,
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 账号注销
|
// 账号注销
|
||||||
export function accountCancel(token) {
|
export function accountCancel(token) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<u-button size="mini" v-if="disabled" class="jnpf-file-disabled">{{buttonText}}</u-button>
|
<u-button size="mini" v-if="disabled" class="jnpf-file-disabled">{{buttonText}}</u-button>
|
||||||
<view v-for='(item,index) in fileList' :key="index" class="jnpf-file-item u-type-primary u-flex u-line-1"
|
<view v-for='(item,index) in fileList' :key="index" class="jnpf-file-item u-type-primary u-flex u-line-1"
|
||||||
@tap='downLoad(item)'>
|
@click.stop='downLoad(item)'>
|
||||||
<view class="jnpf-file-item-txt u-line-1" v-if="item.fileSize">
|
<view class="jnpf-file-item-txt u-line-1" v-if="item.fileSize">
|
||||||
<!-- {{item.name+'('+`${jnpf.toFileSize(item.fileSize)}`+' )'}} -->
|
<!-- {{item.name+'('+`${jnpf.toFileSize(item.fileSize)}`+' )'}} -->
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
@@ -208,20 +208,23 @@
|
|||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
downLoad(item) {
|
downLoad(item) {
|
||||||
if (item.fileExtension && imgTypeList.includes(item.fileExtension)) return this.previewImage(item)
|
const {fileUrl} = item
|
||||||
|
window.location.href = fileUrl
|
||||||
|
// if (item.fileExtension && imgTypeList.includes(item.fileExtension)) return this.previewImage(item)
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
this.previewFile(item)
|
// this.previewFile(item)
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifndef MP
|
// #ifndef MP
|
||||||
getDownloadUrl('annex', item.fileId).then(res => {
|
// getDownloadUrl('annex', item.fileId).then(res => {
|
||||||
const fileUrl = this.baseURL + res.data.url + '&name=' + item.name;
|
// const fileUrl = this.baseURL + res.data.url + '&name=' + item.name;
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
window.location.href = fileUrl;
|
// window.location.href = fileUrl;
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.downloadFile(res.data.url);
|
// this.downloadFile(res.data.url);
|
||||||
// #endif
|
// #endif
|
||||||
})
|
// })
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
// 移除某个文件
|
// 移除某个文件
|
||||||
|
|||||||
@@ -298,7 +298,6 @@
|
|||||||
} from '@/api/apply/visualDev'
|
} from '@/api/apply/visualDev'
|
||||||
import UserSelect from '@/components/Jnpf/CandidateSelect'
|
import UserSelect from '@/components/Jnpf/CandidateSelect'
|
||||||
import {getOrganizeSelector} from '@/api/common.js'
|
import {getOrganizeSelector} from '@/api/common.js'
|
||||||
import flowBtn from '../../workFlow/components/flowBtn.vue'
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CustomButton,
|
CustomButton,
|
||||||
@@ -332,7 +331,7 @@
|
|||||||
isAdd: false,
|
isAdd: false,
|
||||||
showMoreMenu: false,
|
showMoreMenu: false,
|
||||||
moreMenuList: [],
|
moreMenuList: [],
|
||||||
lc_fire_operation_detail: [],
|
createData: {}, // 初始值
|
||||||
deptList: [],
|
deptList: [],
|
||||||
showProcessDialog: false,
|
showProcessDialog: false,
|
||||||
processList: [],
|
processList: [],
|
||||||
@@ -774,7 +773,7 @@
|
|||||||
this.approvalSubmitting = false
|
this.approvalSubmitting = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获取布局和初始值
|
||||||
async getDesForm() {
|
async getDesForm() {
|
||||||
try {
|
try {
|
||||||
const res = await getDesForm(this.config.modelId);
|
const res = await getDesForm(this.config.modelId);
|
||||||
@@ -782,8 +781,9 @@
|
|||||||
const data = res.data ? JSON.parse(res.data) : {};
|
const data = res.data ? JSON.parse(res.data) : {};
|
||||||
this.formConf = JSON.parse(data.formData);
|
this.formConf = JSON.parse(data.formData);
|
||||||
console.log(this.formConf,'formConf--')
|
console.log(this.formConf,'formConf--')
|
||||||
|
console.log(data,'data--111')
|
||||||
this.formConf.labelWidth = 160;
|
this.formConf.labelWidth = 160;
|
||||||
this.lc_fire_operation_detail = data?.lc_fire_operation_detail || [];
|
this.createData = data
|
||||||
await this.getDeptList();
|
await this.getDeptList();
|
||||||
await this.fillFormData(this.formConf, this.formData);
|
await this.fillFormData(this.formConf, this.formData);
|
||||||
this.showPage = true;
|
this.showPage = true;
|
||||||
@@ -894,11 +894,12 @@
|
|||||||
await this.getApprovalData();
|
await this.getApprovalData();
|
||||||
this.initMoreMenuList()
|
this.initMoreMenuList()
|
||||||
} else {
|
} else {
|
||||||
|
console.log(this.formData,'formData111')
|
||||||
const {user,deptInfoList} = this.userInfo
|
const {user,deptInfoList} = this.userInfo
|
||||||
this.isAdd = true;
|
this.isAdd = true;
|
||||||
this.formData = {
|
this.formData = {
|
||||||
...this.formData,
|
...this.formData,
|
||||||
lc_fire_operation_detail: this.lc_fire_operation_detail,
|
...this.createData,
|
||||||
applyDepId: deptInfoList ? String(deptInfoList[0].deptId) : '' ,
|
applyDepId: deptInfoList ? String(deptInfoList[0].deptId) : '' ,
|
||||||
applyDepName: deptInfoList && deptInfoList[0].deptName,
|
applyDepName: deptInfoList && deptInfoList[0].deptName,
|
||||||
applyUser: user.nickname
|
applyUser: user.nickname
|
||||||
@@ -1042,6 +1043,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(vModel == 'applyUser') {
|
||||||
|
this.$set(item, 'disabled', true);
|
||||||
|
}
|
||||||
if (vModel) {
|
if (vModel) {
|
||||||
let val = data.hasOwnProperty(vModel) ? data[vModel] : config.defaultValue;
|
let val = data.hasOwnProperty(vModel) ? data[vModel] : config.defaultValue;
|
||||||
if (!config.isSubTable) config.defaultValue = val;
|
if (!config.isSubTable) config.defaultValue = val;
|
||||||
|
|||||||
@@ -193,8 +193,9 @@
|
|||||||
if (!isAccept) return this.$u.toast(`请上传图片`)
|
if (!isAccept) return this.$u.toast(`请上传图片`)
|
||||||
// #endif
|
// #endif
|
||||||
let tempFilePaths = res.tempFilePaths[0]
|
let tempFilePaths = res.tempFilePaths[0]
|
||||||
|
console.log(this.baseURL,'baseURL---')
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: this.baseURL + 'userAvatar',
|
url: this.baseURL + '/admin-api/infra/file/jeelowcode/upload',
|
||||||
filePath: tempFilePaths,
|
filePath: tempFilePaths,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
@@ -202,14 +203,18 @@
|
|||||||
},
|
},
|
||||||
success: (uploadFileRes) => {
|
success: (uploadFileRes) => {
|
||||||
let data = JSON.parse(uploadFileRes.data)
|
let data = JSON.parse(uploadFileRes.data)
|
||||||
if (data.code === 200) {
|
console.log(data,'data-----')
|
||||||
UpdateAvatar(data.data.name).then(res => {
|
this.avatarSrc =data.data.fileUrl
|
||||||
|
console.log(this.avatarSrc,'-this.avatarSrc')
|
||||||
this.$u.toast('头像更换成功')
|
this.$u.toast('头像更换成功')
|
||||||
this.avatarSrc = this.baseURL2 + data.data.url
|
// if (data.code === 0) {
|
||||||
})
|
// UpdateAvatar(data.data.name).then(res => {
|
||||||
} else {
|
// this.$u.toast('头像更换成功')
|
||||||
this.$u.toast(data.msg)
|
// this.avatarSrc = this.baseURL2 + data.data.url
|
||||||
}
|
// })
|
||||||
|
// } else {
|
||||||
|
// this.$u.toast(data.msg)
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
this.$u.toast('头像更换失败')
|
this.$u.toast('头像更换失败')
|
||||||
|
|||||||
@@ -49,6 +49,9 @@
|
|||||||
<view class="remember-wrap">
|
<view class="remember-wrap">
|
||||||
<u-checkbox v-model="remember"><span class="remember-text">记住账号密码</span></u-checkbox>
|
<u-checkbox v-model="remember"><span class="remember-text">记住账号密码</span></u-checkbox>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="remember-wrap">
|
||||||
|
<u-checkbox v-model="isCertify"><span class="remember-text">是否认证</span></u-checkbox>
|
||||||
|
</view>
|
||||||
<view class="loginBtnBox">
|
<view class="loginBtnBox">
|
||||||
<u-button @click="login" type="primary" :loading="loading">{{ loading ? "登录中...":"登录"}}
|
<u-button @click="login" type="primary" :loading="loading">{{ loading ? "登录中...":"登录"}}
|
||||||
</u-button>
|
</u-button>
|
||||||
@@ -119,6 +122,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
login,
|
login,
|
||||||
|
socialLogin,
|
||||||
getPermissionInfo,
|
getPermissionInfo,
|
||||||
getByName,
|
getByName,
|
||||||
getCallback,
|
getCallback,
|
||||||
@@ -134,10 +138,12 @@
|
|||||||
useUserStore
|
useUserStore
|
||||||
} from '@/store/modules/user'
|
} from '@/store/modules/user'
|
||||||
import logoImg from '@/static/logo.png'
|
import logoImg from '@/static/logo.png'
|
||||||
|
let unique = 0
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
remember: false,
|
remember: false,
|
||||||
|
isCertify: false,
|
||||||
logoImg,
|
logoImg,
|
||||||
imgUrl: '',
|
imgUrl: '',
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -508,6 +514,18 @@
|
|||||||
// jnpf_ticket: this.ssoTicket,
|
// jnpf_ticket: this.ssoTicket,
|
||||||
// grant_type: 'password',
|
// grant_type: 'password',
|
||||||
// }
|
// }
|
||||||
|
if(this.isCertify){
|
||||||
|
// 认证登录
|
||||||
|
this.certifyLogin()
|
||||||
|
}else {
|
||||||
|
this.getLogin()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 普通登录
|
||||||
|
getLogin(){
|
||||||
let query = {
|
let query = {
|
||||||
tenantName: this.formData.tenantName,
|
tenantName: this.formData.tenantName,
|
||||||
username: this.formData.username,
|
username: this.formData.username,
|
||||||
@@ -555,8 +573,53 @@
|
|||||||
this.changeCode()
|
this.changeCode()
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 认证登录
|
||||||
|
certifyLogin(){
|
||||||
|
lx.biz.getAuthCode({
|
||||||
|
appId: "8889088-16130048", // AppID
|
||||||
|
success: (res) => {
|
||||||
|
console.log('免登授权码:', res.authCode)
|
||||||
|
this.exchangeToken(res.authCode)
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('获取免登授权码失败:', err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '免登失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async exchangeToken(authCode) {
|
||||||
|
try {
|
||||||
|
const type = '110'
|
||||||
|
const code = authCode
|
||||||
|
const state = this.uuid()
|
||||||
|
const res = await socialLogin(type, code, state)
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
// 存储Token和用户信息
|
||||||
|
userStore.setToken(res)
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/indexWork'
|
||||||
});
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error('换取Token失败:', err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '登录失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uuid() {
|
||||||
|
const time = Date.now()
|
||||||
|
const random = Math.floor(Math.random() * 1000000000)
|
||||||
|
unique++
|
||||||
|
return 'qrcode_' + random + unique + String(time)
|
||||||
},
|
},
|
||||||
ssoLogin() {
|
ssoLogin() {
|
||||||
getTicket().then(res => {
|
getTicket().then(res => {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const define = {
|
|||||||
report,
|
report,
|
||||||
pcURL,
|
pcURL,
|
||||||
webSocketUrl,
|
webSocketUrl,
|
||||||
comUploadUrl: baseURL + '/api/file/Uploader/',
|
comUploadUrl: baseURL,
|
||||||
timeout: 1000000,
|
timeout: 1000000,
|
||||||
aMapWebKey: '',
|
aMapWebKey: '',
|
||||||
cipherKey: 'EY8WePvjM5GGwQzn', // 加密key
|
cipherKey: 'EY8WePvjM5GGwQzn', // 加密key
|
||||||
|
|||||||
Reference in New Issue
Block a user