fix: useThirdLogin 变量声明方式
parent
d8170cb681
commit
318886e8a6
|
@ -37,7 +37,7 @@ export function useThirdLogin() {
|
||||||
const thirdCaptcha = ref('');
|
const thirdCaptcha = ref('');
|
||||||
//第三方登录
|
//第三方登录
|
||||||
function onThirdLogin(source) {
|
function onThirdLogin(source) {
|
||||||
let url = `${glob.uploadUrl}/sys/thirdLogin/render/${source}`;
|
const url = `${glob.uploadUrl}/sys/thirdLogin/render/${source}`;
|
||||||
window.open(
|
window.open(
|
||||||
url,
|
url,
|
||||||
`login ${source}`,
|
`login ${source}`,
|
||||||
|
@ -46,15 +46,15 @@ export function useThirdLogin() {
|
||||||
thirdType.value = source;
|
thirdType.value = source;
|
||||||
thirdLoginInfo.value = {};
|
thirdLoginInfo.value = {};
|
||||||
thirdLoginState.value = false;
|
thirdLoginState.value = false;
|
||||||
let receiveMessage = function (event) {
|
const receiveMessage = function (event) {
|
||||||
let token = event.data;
|
const token = event.data;
|
||||||
if (typeof token === 'string') {
|
if (typeof token === 'string') {
|
||||||
//如果是字符串类型 说明是token信息
|
//如果是字符串类型 说明是token信息
|
||||||
if (token === '登录失败') {
|
if (token === '登录失败') {
|
||||||
createMessage.warning(token);
|
createMessage.warning(token);
|
||||||
} else if (token.includes('绑定手机号')) {
|
} else if (token.includes('绑定手机号')) {
|
||||||
bindingPhoneModal.value = true;
|
bindingPhoneModal.value = true;
|
||||||
let strings = token.split(',');
|
const strings = token.split(',');
|
||||||
thirdUserUuid.value = strings[1];
|
thirdUserUuid.value = strings[1];
|
||||||
} else {
|
} else {
|
||||||
doThirdLogin(token);
|
doThirdLogin(token);
|
||||||
|
@ -113,7 +113,7 @@ export function useThirdLogin() {
|
||||||
.post({ url: '/sys/third/user/create', params: { thirdLoginInfo: unref(thirdLoginInfo) } }, { isTransformResponse: false })
|
.post({ url: '/sys/third/user/create', params: { thirdLoginInfo: unref(thirdLoginInfo) } }, { isTransformResponse: false })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let token = res.result;
|
const token = res.result;
|
||||||
doThirdLogin(token);
|
doThirdLogin(token);
|
||||||
thirdConfirmShow.value = false;
|
thirdConfirmShow.value = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -126,7 +126,7 @@ export function useThirdLogin() {
|
||||||
}
|
}
|
||||||
// 核实密码
|
// 核实密码
|
||||||
function thirdLoginCheckPassword() {
|
function thirdLoginCheckPassword() {
|
||||||
let params = Object.assign({}, unref(thirdLoginInfo), { password: unref(thirdLoginPassword) });
|
const params = Object.assign({}, unref(thirdLoginInfo), { password: unref(thirdLoginPassword) });
|
||||||
defHttp.post({ url: '/sys/third/user/checkPassword', params }, { isTransformResponse: false }).then((res) => {
|
defHttp.post({ url: '/sys/third/user/checkPassword', params }, { isTransformResponse: false }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
thirdLoginNoPassword();
|
thirdLoginNoPassword();
|
||||||
|
@ -156,7 +156,7 @@ export function useThirdLogin() {
|
||||||
if (!unref(thirdCaptcha)) {
|
if (!unref(thirdCaptcha)) {
|
||||||
cmsFailed('请输入验证码');
|
cmsFailed('请输入验证码');
|
||||||
}
|
}
|
||||||
let params = {
|
const params = {
|
||||||
mobile: unref(thirdPhone),
|
mobile: unref(thirdPhone),
|
||||||
captcha: unref(thirdCaptcha),
|
captcha: unref(thirdCaptcha),
|
||||||
thirdUserUuid: unref(thirdUserUuid),
|
thirdUserUuid: unref(thirdUserUuid),
|
||||||
|
|
Loading…
Reference in New Issue