cyl/dev
zsk 2 years ago
commit d25ed663b2

@ -43,3 +43,10 @@ export function updatePswApi(data) {
data: setqs(data), data: setqs(data),
}); });
} }
// 检查token信息获取最新登录信息
export function checkTokenApi(data) {
return request({
url: "/appLoginByToken",
method: "get",
});
}

@ -116,7 +116,7 @@ export function setUserPswApi (data) {
export function setUserTelApi (data) { export function setUserTelApi (data) {
return request({ return request({
url: "/yishoudan/user/changeTel", url: "/yishoudan/user/changeTel",
// method: "post", method: "post",
data: setqs(data), data: setqs(data),
}); });
} }
@ -213,8 +213,21 @@ export function dataStatisticsListApiold (data) {
}); });
} }
// 团队列表获取
export function getTeamListApi (data) {
return request({
url: "/yishoudan/agency/group/user/listByUser",
method: "get",
});
}
// 切换团队
export function changeTeamApi(agencyId) {
return request({
url: `/yishoudan/agency/group/user/changeGroup/${agencyId}`,
method: "get",
});
}

@ -168,7 +168,7 @@ export default {
} }
} }
.jobBox { .jobBox {
padding: 16px 20px; padding: 16px 20px 0 20px;
border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px;
overflow: hidden; overflow: hidden;
.jobinfobox:last-of-type { .jobinfobox:last-of-type {

@ -13,8 +13,8 @@
<!-- <a-breadcrumb-item href="" v-if="!islist"> --> <!-- <a-breadcrumb-item href="" v-if="!islist"> -->
<a-breadcrumb-item> <a-breadcrumb-item>
<router-link :to="'/detail?id=' + firminfo.id"> <router-link :to="'/detail?id=' + firminfo.id">
<!-- <span @click="$router.back(-1)"></span> --> <!-- <span @click="$router.back(-1)"></span> -->
<span>企业详情</span> <span>职位详情</span>
</router-link> </router-link>
</a-breadcrumb-item> </a-breadcrumb-item>
<a-breadcrumb-item href=""> <a-breadcrumb-item href="">

@ -13,7 +13,7 @@
</a> </a>
</a-breadcrumb-item> </a-breadcrumb-item>
<a-breadcrumb-item href> <a-breadcrumb-item href>
<span style="color: #333">{{ from == "vocational" ? "详情" : "企业详情" }}</span> <span style="color: #333">{{ from == "vocational" ? "详情" : "职位详情" }}</span>
</a-breadcrumb-item> </a-breadcrumb-item>
</a-breadcrumb> </a-breadcrumb>
<!-- 主体区域 --> <!-- 主体区域 -->
@ -425,7 +425,7 @@
<div class="companyinfo" v-if="from != 'vocational'"> <div class="companyinfo" v-if="from != 'vocational'">
<div class="companydetail"> <div class="companydetail">
<h1 class="bottombox"> <h1 class="bottombox">
<i>企业详情</i> <i>职位详情</i>
</h1> </h1>
</div> </div>
<div class="companylocation" style="text-align: center; padding: 0 20px 20px" v-if="positionInfo.lng"> <div class="companylocation" style="text-align: center; padding: 0 20px 20px" v-if="positionInfo.lng">

@ -222,7 +222,7 @@
<div class="maincontentleft" v-if="!isVocational" style="padding-top: 50px"> <div class="maincontentleft" v-if="!isVocational" style="padding-top: 50px">
<div class="tabBar" @click="changeTab($event)"> <div class="tabBar" @click="changeTab($event)">
<div class="tabSubset" :class="{ active: signType == '' }" data-type="0">全部</div> <div class="tabSubset" :class="{ active: signType == '' }" data-type="0">全部</div>
<div class="tabSubset" :class="{ active: signType == 1 }" v-if="loginValue.agencyName == '郑州一才工作'" data-type="1"></div> <div class="tabSubset" :class="{ active: signType == 1 }" v-if="loginValue.agencyName == '郑州一才工作' || loginValue.agencyName == '一才工作'" data-type="1"></div>
<!-- <div class="tabSubset" :class="{ active: signType == 2 }" data-type="2">三方</div> --> <!-- <div class="tabSubset" :class="{ active: signType == 2 }" data-type="2">三方</div> -->
</div> </div>
<div class="filter" v-show="signType == ''" :class="[filterStatus == 0 ? '' : 'nobd']" style> <div class="filter" v-show="signType == ''" :class="[filterStatus == 0 ? '' : 'nobd']" style>
@ -540,10 +540,10 @@
<span v-for="(item1, index) in item.jobSpecialLabelNames" :key="index">{{ item1 }}</span> <span v-for="(item1, index) in item.jobSpecialLabelNames" :key="index">{{ item1 }}</span>
<span v-if="item.jobSpecialLabelNames.length == 0"></span> <span v-if="item.jobSpecialLabelNames.length == 0"></span>
</div> </div>
<div class="jobpricehour" v-html="getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue)"></div> <div class="jobpricehour" v-html="getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue)"></div>
<div class="jobpricemonth" v-if="item.minMonthlyPay"> <div class="jobpricemonth" v-if="item.minMonthlyPay">
<template v-if="formvalue.signType != 1"> <template v-if="formvalue.signType != 1">
<span>{{ item.minMonthlyPay ? item.minMonthlyPay : "" }}</span <span>{{ item.minMonthlyPay ? item.minMonthlyPay : "" }}</span
>-<span>{{ item.maxMonthlyPay ? item.maxMonthlyPay : "" }}</span >-<span>{{ item.maxMonthlyPay ? item.maxMonthlyPay : "" }}</span
>/ >/
@ -1761,8 +1761,8 @@ export default {
this.formvalue.aliasName = ""; this.formvalue.aliasName = "";
this.formvalue.keys = ""; this.formvalue.keys = "";
this.formvalue.ageStr = ""; this.formvalue.ageStr = "";
console.log('this.formvalue',this.formvalue);
if (this.formvalue.signType != 0) { if (this.formvalue.signType == 1) {
this.getJobListYicai(); this.getJobListYicai();
} else { } else {
this.getJobList(); this.getJobList();

@ -14,8 +14,8 @@
</a-breadcrumb-item> </a-breadcrumb-item>
<a-breadcrumb-item> <a-breadcrumb-item>
<router-link :to="'/detail'"> <router-link :to="'/detail'">
<!-- <span @click="$router.back(-1)"></span> --> <!-- <span @click="$router.back(-1)"></span> -->
<span>企业详情</span> <span>职位详情</span>
</router-link> </router-link>
</a-breadcrumb-item> </a-breadcrumb-item>
<a-breadcrumb-item href> <a-breadcrumb-item href>

@ -14,8 +14,8 @@
</a-breadcrumb-item> </a-breadcrumb-item>
<a-breadcrumb-item> <a-breadcrumb-item>
<router-link :to="'/detailYicai'"> <router-link :to="'/detailYicai'">
<!-- <span @click="$router.back(-1)"></span> --> <!-- <span @click="$router.back(-1)"></span> -->
<span>企业详情</span> <span>职位详情</span>
</router-link> </router-link>
</a-breadcrumb-item> </a-breadcrumb-item>
<a-breadcrumb-item href> <a-breadcrumb-item href>

@ -15,12 +15,26 @@
<!-- <template v-show="loginway === 1"> --> <!-- <template v-show="loginway === 1"> -->
<a-form id="components-form-demo-normal-login" v-show="loginway === 1" :form="form" class="login-form" @submit="userhandleSubmit"> <a-form id="components-form-demo-normal-login" v-show="loginway === 1" :form="form" class="login-form" @submit="userhandleSubmit">
<a-form-item style="text-align: left"> <a-form-item style="text-align: left">
<a-input v-decorator="[ 'tel', { rules: [ { required: true, message: '请输入手机号' }, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确手机号' }, ], validateTrigger: 'submit', }, ]" :maxLength="11" placeholder="请输入手机号"> <a-input
v-decorator="[
'tel',
{
rules: [
{ required: true, message: '请输入手机号' },
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确手机号' },
],
validateTrigger: 'submit',
},
]"
:maxLength="11"
placeholder="请输入手机号"
>
<i slot="prefix" class="iconfont icon-yonghuming" style="font-size: 24px" /> <i slot="prefix" class="iconfont icon-yonghuming" style="font-size: 24px" />
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item style="text-align: left"> <a-form-item style="text-align: left">
<a-input v-decorator="[ <a-input
v-decorator="[
'password', 'password',
{ {
rules: [ rules: [
@ -31,7 +45,10 @@
], ],
validateTrigger: 'submit', validateTrigger: 'submit',
}, },
]" type="password" placeholder="请输入密码"> ]"
type="password"
placeholder="请输入密码"
>
<i slot="prefix" class="iconfont icon-mima" /> <i slot="prefix" class="iconfont icon-mima" />
</a-input> </a-input>
</a-form-item> </a-form-item>
@ -42,12 +59,12 @@
<label for="register">下次自动登录</label> <label for="register">下次自动登录</label>
</span> </span>
<!-- <router-link to="updatepsw" class="login-form-forgot" href>忘记密码</router-link> --> <!-- <router-link to="updatepsw" class="login-form-forgot" href>忘记密码</router-link> -->
<div @click="showModal" class="login-form-forgot" style="cursor:pointer">忘记密码</div> <div @click="showModal" class="login-form-forgot" style="cursor: pointer">忘记密码</div>
</div> </div>
<a-form-item class="mb0"> <a-form-item class="mb0">
<a-button type="primary" html-type="submit" class="login-form-button">登录</a-button> <a-button type="primary" html-type="submit" class="login-form-button">登录</a-button>
</a-form-item> </a-form-item>
<div class="mt16 f12" style="color:#576B95"> <div class="mt16 f12" style="color: #576b95">
<router-link to="/main">返回首页</router-link> <router-link to="/main">返回首页</router-link>
</div> </div>
</a-form> </a-form>
@ -58,7 +75,8 @@
<template v-show="loginway === 2"> --> <template v-show="loginway === 2"> -->
<a-form id="components-form-demo-normal-login" v-show="loginway === 2" :form="form1" class="login-form" @submit="phonehandleSubmit"> <a-form id="components-form-demo-normal-login" v-show="loginway === 2" :form="form1" class="login-form" @submit="phonehandleSubmit">
<a-form-item style="text-align: left"> <a-form-item style="text-align: left">
<a-input v-decorator="[ <a-input
v-decorator="[
'tel', 'tel',
{ {
rules: [ rules: [
@ -70,12 +88,17 @@
], ],
validateTrigger: 'submit', validateTrigger: 'submit',
}, },
]" autocomplete="off" :maxLength="11" placeholder="请输入手机号"> ]"
autocomplete="off"
:maxLength="11"
placeholder="请输入手机号"
>
<i slot="prefix" class="icon-shouji iconfont" style="font-size: 24px" /> <i slot="prefix" class="icon-shouji iconfont" style="font-size: 24px" />
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item style="text-align: left"> <a-form-item style="text-align: left">
<a-input v-decorator="[ <a-input
v-decorator="[
'code', 'code',
{ {
rules: [ rules: [
@ -86,7 +109,10 @@
], ],
validateTrigger: 'submit', validateTrigger: 'submit',
}, },
]" type="text" placeholder="请输入验证码"> ]"
type="text"
placeholder="请输入验证码"
>
<i slot="prefix" class="icon-duanxinyanzheng iconfont" /> <i slot="prefix" class="icon-duanxinyanzheng iconfont" />
<span class="getrulecode" slot="suffix"> <span class="getrulecode" slot="suffix">
<span @click="getPhoneCode" data-mark="getcode" v-if="timedata.isfinish"></span> <span @click="getPhoneCode" data-mark="getcode" v-if="timedata.isfinish"></span>
@ -105,7 +131,7 @@
<a-form-item class="mb0"> <a-form-item class="mb0">
<a-button type="primary" html-type="submit" class="login-form-button">登录</a-button> <a-button type="primary" html-type="submit" class="login-form-button">登录</a-button>
</a-form-item> </a-form-item>
<div class="mt16 f12" style="color:#576B95"> <div class="mt16 f12" style="color: #576b95">
<router-link to="/main">返回首页</router-link> <router-link to="/main">返回首页</router-link>
</div> </div>
</a-form> </a-form>
@ -115,7 +141,7 @@
</div>--> </div>-->
<!-- </template> --> <!-- </template> -->
<a-modal title="找回密码" :width="760" footer :visible="loginShow" class="modal" @ok="handleOk" @cancel="handleCancel" :maskClosable="false" okText="提交" cancelText="取消" :destroyOnClose="true"> <a-modal title="找回密码" :width="760" footer :visible="loginShow" class="modal" @ok="handleOk" @cancel="handleCancel" :maskClosable="false" okText="提交" cancelText="取消" :destroyOnClose="true">
<loginpsw :loginShow.sync='loginShow'></loginpsw> <loginpsw :loginShow.sync="loginShow"></loginpsw>
</a-modal> </a-modal>
</div> </div>
</div> </div>
@ -123,15 +149,15 @@
</template> </template>
<script> <script>
import { loginApi, getPhoneCodeApi } from '../../api/login' import { loginApi, getPhoneCodeApi } from "../../api/login";
import timmer from './components/countback.vue' import timmer from "./components/countback.vue";
import loginpsw from './updatepsw.vue' import loginpsw from "./updatepsw.vue";
import Cookies from 'js-cookie' import Cookies from "js-cookie";
export default { export default {
inject: ['reload'], inject: ["reload"],
// //
name: '', name: "",
// //
components: { components: {
timmer, timmer,
@ -153,27 +179,27 @@ export default {
timmer: null, timmer: null,
}, },
loginShow: false, loginShow: false,
} };
}, },
// //
computed: {}, computed: {},
// //
watch: { watch: {
loginway(val) { loginway(val) {
console.log(val) console.log(val);
setTimeout(() => { setTimeout(() => {
console.log(this.form.getFieldsValue().tel); console.log(this.form.getFieldsValue().tel);
if (val == 2 && this.form.getFieldsValue().tel != undefined) { if (val == 2 && this.form.getFieldsValue().tel != undefined) {
console.log(this.form.getFieldsValue().tel); console.log(this.form.getFieldsValue().tel);
this.form1.setFieldsValue({ this.form1.setFieldsValue({
tel: this.form.getFieldsValue().tel, tel: this.form.getFieldsValue().tel,
}) });
} else if (val == 1 && this.form1.getFieldsValue().tel) { } else if (val == 1 && this.form1.getFieldsValue().tel) {
this.form.setFieldsValue({ this.form.setFieldsValue({
tel: this.form1.getFieldsValue().tel, tel: this.form1.getFieldsValue().tel,
}) });
} }
}, 10) }, 10);
}, },
}, },
// //
@ -190,86 +216,91 @@ export default {
methods: { methods: {
userhandleSubmit(e) { userhandleSubmit(e) {
// //
e.preventDefault() e.preventDefault();
let params let params;
this.form.validateFields(async (err, values) => { this.form.validateFields(async (err, values) => {
console.log(values) console.log(values);
if (!err) { if (!err) {
params = { ...values, loginType: 0 } params = { ...values, loginType: 0 };
console.log(params) console.log(params);
try { try {
const { data } = await loginApi(params) const { data } = await loginApi(params);
console.log(data) console.log(data);
if (data.status !== 200) { if (data.status !== 200) {
this.$message.warning(data.msg) this.$message.warning(data.msg);
return return;
} }
localStorage.setItem('LOGIN_DATA', JSON.stringify(data.data)) localStorage.setItem("DAOTIAN_agencyid", data.data.user.agencyId);
this.$router.push('/list') localStorage.setItem("LOGIN_DATA", JSON.stringify(data.data));
localStorage.setItem("LOGIN_DATA_token", data.data.token);
this.$router.push("/list");
// console.log(Cookies.get("LOGIN_DATA")); // console.log(Cookies.get("LOGIN_DATA"));
this.reload() this.reload();
// this.$router.push("/list"); // this.$router.push("/list");
} catch (err) { } catch (err) {
console.log(err) console.log(err);
} }
} else { } else {
console.log(err) console.log(err);
} }
}) });
}, },
phonehandleSubmit(e) { phonehandleSubmit(e) {
e.preventDefault() e.preventDefault();
let params let params;
this.form1.validateFields(async (err, values) => { this.form1.validateFields(async (err, values) => {
console.log(err) console.log(err);
if (!err) { if (!err) {
params = { ...values, loginType: 1 } params = { ...values, loginType: 1 };
try { try {
const { data } = await loginApi(params) const { data } = await loginApi(params);
console.log(data) console.log(data);
if (data.status !== 200) { if (data.status !== 200) {
this.$message.warning(data.msg) this.$message.warning(data.msg);
return return;
} }
localStorage.setItem('LOGIN_DATA', JSON.stringify(data.data)) localStorage.setItem("DAOTIAN_agencyid", data.data.user.agencyId);
this.$router.push('/list') localStorage.setItem("LOGIN_DATA", JSON.stringify(data.data));
this.reload() localStorage.setItem("LOGIN_DATA_token", data.data.token);
this.$router.push("/list");
this.reload();
} catch (err) { } catch (err) {
console.log(err) console.log(err);
} }
} else { } else {
console.log(err) console.log(err);
} }
}) });
}, },
async getPhoneCode() { async getPhoneCode() {
const that = this const that = this;
this.form1.validateFields(['tel'], async (err, values) => { this.form1.validateFields(["tel"], async (err, values) => {
console.log(values) console.log(values);
if (!err) { if (!err) {
that.timedata.isfinish = false that.timedata.isfinish = false;
try { try {
const { data } = await getPhoneCodeApi({ tel: values.tel }) const { data } = await getPhoneCodeApi({ tel: values.tel });
console.log(data) console.log(data);
if (data.status !== 200) { if (data.status !== 200) {
this.$message.warning(data.msg) this.$message.warning(data.msg);
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error);
} }
} else { } else {
console.log(err) console.log(err);
} }
}) });
}, },
showModal() { showModal() {
console.log('modal') console.log("modal");
this.loginShow = true this.loginShow = true;
}, },
/** /**
* 关闭忘记密码弹窗 * 关闭忘记密码弹窗
@ -277,9 +308,8 @@ export default {
* *
*/ */
handleCancel() { handleCancel() {
this.loginShow = false this.loginShow = false;
console.log(123 console.log(123);
);
}, },
/** /**
* 提交更改密码信息 * 提交更改密码信息
@ -288,10 +318,10 @@ export default {
*/ */
handleOk() {}, handleOk() {},
checked() { checked() {
console.log(this.ischecked) console.log(this.ischecked);
}, },
}, },
} };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@ -337,7 +367,7 @@ export default {
margin-top: 20px; margin-top: 20px;
font-size: 14px; font-size: 14px;
text-align: left; text-align: left;
color: #cccccc; color: #999;
line-height: 22px; line-height: 22px;
cursor: pointer; cursor: pointer;
} }
@ -457,7 +487,7 @@ export default {
line-height: 12px; line-height: 12px;
color: #4d575e; color: #4d575e;
span[data-mark='getcode'] { span[data-mark="getcode"] {
padding: 0 0 0 5px; padding: 0 0 0 5px;
cursor: pointer; cursor: pointer;
} }

@ -46,9 +46,9 @@ Vue.prototype.$moment = moment; //挂载到当前vue实例对象
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(antd); Vue.use(antd);
new Vue({ let newVue = new Vue({
router, router,
store, store,
render: (h) => h(App), render: (h) => h(App),
}).$mount("#app"); }).$mount("#app");
export default Vue; export default newVue;

@ -48,9 +48,11 @@ Vue.prototype.$moment = moment; //挂载到当前vue实例对象
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(antd); Vue.use(antd);
new Vue({ let newVue = new Vue({
router, router,
store, store,
render: (h) => h(App), render: (h) => h(App),
}).$mount("#app"); }).$mount("#app");
export default Vue; export default newVue;
// export default Vue;

@ -1,4 +1,4 @@
@import "http://at.alicdn.com/t/c/font_3135652_nopyx9nvfil.css"; @import "http://at.alicdn.com/t/c/font_3135652_nd5ivglbv4.css";
@font-face { @font-face {
font-family: "DingTalk"; /* 这里的字体名称是自定义的 */ font-family: "DingTalk"; /* 这里的字体名称是自定义的 */
src: url("../assets/fonts/DingTalk\ Sans.ttf"); /* 服务器上ttf文件的路径记得配置域名权限 */ src: url("../assets/fonts/DingTalk\ Sans.ttf"); /* 服务器上ttf文件的路径记得配置域名权限 */
@ -454,6 +454,9 @@ i {
.c3 { .c3 {
color: #333; color: #333;
} }
.cf40 {
color: #f40;
}
.c6 { .c6 {
color: #666; color: #666;
} }
@ -476,6 +479,11 @@ i {
align-items: center; align-items: center;
justify-content: start; justify-content: start;
} }
.fse {
display: flex;
align-items: center;
justify-content: end;
}
.fsc { .fsc {
display: flex; display: flex;
align-items: center; align-items: center;
@ -757,19 +765,19 @@ i {
// left: 0; // left: 0;
// left: calc((100vw - 1200px) / 2 + 1013px) !important; // left: calc((100vw - 1200px) / 2 + 1013px) !important;
.loginbox:not(.backTable) { .loginbox:not(.backTable) {
width: 180px; // width: 180px;
// height: 114px; // height: 114px;
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
text-align: center; text-align: center;
box-shadow: 0px 0px 10px rgba(128, 128, 128, 0.4); box-shadow: 0px 0px 10px rgba(128, 128, 128, 0.4);
padding: 0 16px 10px 16px; padding: 4px;
> div { > div {
padding: 16px; // padding: 16px;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
font-weight: bold; // font-weight: bold;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
> a { > a {
@ -780,10 +788,10 @@ i {
line-height: 24px; line-height: 24px;
// font-weight: bold; // font-weight: bold;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #eee; // border-bottom: 1px solid #eee;
&:hover { // &:hover {
color: #ff4400; // color: #ff4400;
} // }
span { span {
line-height: 24px; line-height: 24px;

@ -1,9 +1,12 @@
import axios from "axios"; import axios from "axios";
import router from "@/router"; import router from "@/router";
import vue from '../main-dev.js'
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import qs from "qs"; import qs from "qs";
console.log('use message in request', this);
console.log('use message in request', vue);
// import Vue from "vue"; // import Vue from "vue";
// console.log('use message in request2', Vue);
// const baseURL = "http://1shoudan.com"; // 正式环境线上 废弃 // const baseURL = "http://1shoudan.com"; // 正式环境线上 废弃
// const baseURL = "//idaotian.com"; // 正式环境线上 // const baseURL = "//idaotian.com"; // 正式环境线上
const baseURL = "//test.renminshitang.com.cn/daotian/api_dev"; // 测试环境本地 const baseURL = "//test.renminshitang.com.cn/daotian/api_dev"; // 测试环境本地
@ -36,10 +39,16 @@ service.interceptors.request.use(
// } // }
if (localStorage.getItem("LOGIN_DATA")) { if (localStorage.getItem("LOGIN_DATA")) {
req.headers.Authorization = "Bearer " + JSON.parse(localStorage.getItem("LOGIN_DATA")).token; console.log('req', req);
req.headers.appId = "daotianpc"; console.log('req url', req.url);
req.headers["g-open-env"]= 'WEB-PAGE',
req.headers.Authorization = "Bearer " + localStorage.getItem("LOGIN_DATA_token");
req.headers.agencyId = JSON.parse(localStorage.getItem("DAOTIAN_agencyid"))
req.headers.appId = "daotianpc";
req.headers["g-open-env"] = 'WEB-PAGE'
if (req.url == '/assistant/custom/job/v2/list') {
req.headers.appId = ''
}
console.log('getToken++++++++++++++++++++++++++++++++++++++++++++++++++++'); console.log('getToken++++++++++++++++++++++++++++++++++++++++++++++++++++');
} }
// application/json // application/json
@ -54,23 +63,59 @@ service.interceptors.request.use(
); );
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
// console.log(response); console.log('response', response);
let { msg, status } = response.data; let { msg, status } = response.data;
// status = 9999 // status = 9999
// return response; // return response;
// console.log(status); // console.log(status);
if (status == 9999) { // response.data.status = 9999
if (response.data.status == 9999) {
localStorage.removeItem("LOGIN_DATA"); localStorage.removeItem("LOGIN_DATA");
localStorage.removeItem("LOGIN_DATA_token");
localStorage.removeItem("DAOTIAN_agencyid");
router.push("/login"); router.push("/login");
// 跳转到登录页面 // 跳转到登录页面
// this.$message.warning(msg); // this.$message.warning(msg);
return Promise.reject(new Error("token过期")); return Promise.reject(new Error("token过期"));
} }
if (response.status === 200) { if (response.data.status === 200) {
return response; return response;
} else if (response.data.status === 2001) {// 职位名称
// message.error('职位名称:请不要填写【' + response.data.msg + '】相关违禁内容');
// this.$message.error(response.data.msg);
return response;
// return Promise.reject({
// code: 2001,
// msg: response.data.msg
// });
} else if (response.data.status === 2002) {// 职位名称
// message.error('职位名称:请不要填写【' + response.data.msg + '】相关违禁内容');
console.log('response.data.status === 2002', response.data.status);
vue.$message.error(response.data.msg)
// this.$message.error(response.data.msg);
setTimeout(() => {
localStorage.removeItem("LOGIN_DATA");
localStorage.removeItem("LOGIN_DATA_token");
localStorage.removeItem("DAOTIAN_agencyid");
// router.push({
// path: "/login",
// });
router.push("/login");
}, 2000);
return Promise.reject(new Error("token过期"));
// return Promise.reject({
// code: 2002,
// msg: response.data.msg
// });
} else { } else {
// Message.error(message) // Message.error(response.data.msg)
return Promise.reject(new Error(msg)); // vue.$message.error(response.data.msg)
return response;
// return Promise.reject(new Error(msg));
} }
}, },
(error) => { (error) => {

@ -55,7 +55,7 @@
</a-dropdown> </a-dropdown>
</li> </li>
<li v-else> <li v-else>
<router-link to="/mybill" :class="routertitleindex == 5? 'titleactive' : ''"> <router-link to="/mybill" :class="routertitleindex == 5 ? 'titleactive' : ''">
<!-- <div> --> <!-- <div> -->
<span>职位报名</span> <span>职位报名</span>
<!-- <i class="iconfont icon-youjiantou"></i> --> <!-- <i class="iconfont icon-youjiantou"></i> -->
@ -120,10 +120,39 @@
</div> </div>
</a-dropdown> </a-dropdown>
</div> </div>
<!-- v-if="false" -->
<!-- <div class="g_mr_16 more-team">
<a-dropdown :trigger="['click']" class="" placement="bottomRight" :getPopupContainer="(node) => node.parentNode">
<div class="fsa more-team-button" style="padding: 0px 12px">
<div class="fss">
<div>
<div class="logo">{{ userbaseInfo.agencyName && userbaseInfo.agencyName.charAt(0) }}</div>
</div>
<div class="hover-f40" style="max-width: 98px">{{ userbaseInfo.agencyName }}</div>
</div>
<i class="iconfont icon-paixu f12" style="color: #ccc; margin-left: 4px"></i>
</div>
<div class="" slot="overlay" style="box-shadow: 0px 2px 4px 0px rgba(229, 229, 229, 0.5), 0px 4px 12px 0px rgba(0, 0, 0, 0.15)">
<div class="more-team-drop">
<div class="fsa p12 pr8 hover-blue" style="border-radius: 4px; cursor: pointer" @click="changeTeam(item)" v-for="(item, index) in teamList">
<div class="fss">
<div>
<img v-if="item.logo" :src="item.logo" alt="" />
<div v-else class="logo">{{ item.agencyName && item.agencyName.charAt(0) }}</div>
</div>
<div class="" style="width: 98px">{{ item.agencyName }}</div>
</div>
<div class="ml12 f12 cf4" v-if="item.checked"></div>
</div>
</div>
</div>
</a-dropdown>
</div> -->
<a-dropdown <a-dropdown
:trigger="['click']" :trigger="['click']"
overlayClassName="logindropdown"
placement="bottomRight" placement="bottomRight"
overlayClassName="logindropdown"
:getPopupContainer=" :getPopupContainer="
(triggerNode) => { (triggerNode) => {
return triggerNode.parentNode || document.body; return triggerNode.parentNode || document.body;
@ -135,11 +164,11 @@
<img :src="userbaseInfo.imgSrc" class="mr4" style="border-radius: 50%; width: 28px; height: 28px" alt v-else /> <img :src="userbaseInfo.imgSrc" class="mr4" style="border-radius: 50%; width: 28px; height: 28px" alt v-else />
<div class="ml4 f14 c6">{{ userbaseInfo.userName || userbaseInfo.nickName || "-" }}</div> <div class="ml4 f14 c6">{{ userbaseInfo.userName || userbaseInfo.nickName || "-" }}</div>
</span> </span>
<div class="loginbox" slot="overlay"> <div class="loginbox" slot="overlay" style="width: 224px">
<router-link to="/accountsetting"> <router-link to="/accountsetting">
<div> <div class="hover-blue br4" style="padding: 12px 12px">
<span> <i class="iconfont icon-gerenzhongxin"></i>个人中心 </span> <span> <i class="iconfont icon-gerenzhongxin"></i>个人中心 </span>
<i class="iconfont icon-youjiantou"></i> <i class="iconfont icon-youjiantou c9"></i>
</div> </div>
</router-link> </router-link>
<!-- <router-link to="/merchantBack" v-if="loginValue.agencyName == '郑州一才工作' "> <!-- <router-link to="/merchantBack" v-if="loginValue.agencyName == '郑州一才工作' ">
@ -151,12 +180,39 @@
</div> </div>
</router-link>--> </router-link>-->
<!-- 2023-11-29 注释该条件 && (loginValue.agencyRole == 2 || loginValue.agencyRole == 1 ) --> <!-- 2023-11-29 注释该条件 && (loginValue.agencyRole == 2 || loginValue.agencyRole == 1 ) -->
<router-link to="###" v-if="loginValue.agencyName == '郑州一才工作' || loginValue.id == '116253'"> <!-- v-if="loginValue.agencyName == '郑州一才工作' || loginValue.id == '116253'" -->
<div @click="goAdmin">
<span> <i class="iconfont icon-shangjiahoutai"></i>商家后台 </span> <div @click.stop="goAdmin" class="hover-blue br4 fsa" style="padding: 12px 12px; line-height: 25px; border-bottom: 0" v-if="loginValue.agencyName == '郑州一才工作' || loginValue.id == '116253'">
<i class="iconfont icon-youjiantou"></i> <span class="f14"> <i class="iconfont icon-shangjiahoutai mr6"></i>商家后台 </span>
<i class="iconfont icon-youjiantou c9"></i>
</div> </div>
</router-link>
<a-dropdown :trigger="['click']" class="more-team" :getPopupContainer="(node) => node.parentNode" overlayClassName="setPosition">
<span class="fsa more-team-button hover-blue br4" style="padding: 6px 12px" @click.stop>
<div class="fss">
<div>
<i class="icon-qiehuantuandui iconfont g_mr_5" style="font-size: 16px"></i>
切换团队
</div>
</div>
<div class="fse">
<div class="cf40 esl" style="max-width: 98px">{{ userbaseInfo.agencyName }}</div>
<i class="iconfont icon-youjiantou c9"></i>
</div>
</span>
<div class="more-team-drop" slot="overlay">
<div class="fsa p12 hover-blue" style="border-radius: 4px; cursor: pointer" @click="changeTeam(item)" v-for="(item, index) in teamList">
<div class="fss">
<div>
<img v-if="item.logo" class="mr8" :src="item.logo" style="width: 16px; height: 16px" alt="" />
<div v-else class="logo mr8">{{ item.agencyName && item.agencyName.charAt(0) }}</div>
</div>
<div class="tl" style="width: 98px">{{ item.agencyName }}</div>
</div>
<div class="ml12 f12 cf4" v-if="item.checked"></div>
</div>
</div>
</a-dropdown>
<!-- <router-link to="###" v-if="loginValue.agencyName == '郑州一才工作'"> <!-- <router-link to="###" v-if="loginValue.agencyName == '郑州一才工作'">
<div @click="goJiaofu"> <div @click="goJiaofu">
<span> <span>
@ -165,7 +221,7 @@
<i class="iconfont icon-youjiantou"></i> <i class="iconfont icon-youjiantou"></i>
</div> </div>
</router-link> --> </router-link> -->
<button @click="logout">退</button> <button @click="logout" class="mb6">退出登</button>
</div> </div>
</a-dropdown> </a-dropdown>
</span> </span>
@ -284,7 +340,8 @@ import {
// getCityApi, // getCityApi,
} from "../api/job"; } from "../api/job";
import { logoutApi } from "../api/login"; import { logoutApi, checkTokenApi } from "../api/login";
import { getTeamListApi, changeTeamApi } from "../api/userinfo";
export default { export default {
inject: ["reload"], inject: ["reload"],
@ -329,6 +386,7 @@ export default {
userbaseInfo: JSON.parse(localStorage.getItem("LOGIN_DATA")), userbaseInfo: JSON.parse(localStorage.getItem("LOGIN_DATA")),
loginPage: false, loginPage: false,
routertitleindex: 0, routertitleindex: 0,
teamList: [],
}; };
}, },
// //
@ -445,6 +503,7 @@ export default {
// this.getJobListYicai(); // this.getJobListYicai();
this.isLaoxiangshow(); this.isLaoxiangshow();
this.showfooter(); this.showfooter();
this.getTeamList();
}, },
/** /**
* el 被新创建的 vm.el 替换并挂载到实例上去之后调用该钩子 * el 被新创建的 vm.el 替换并挂载到实例上去之后调用该钩子
@ -532,7 +591,58 @@ export default {
this.laoxiangshow = true; this.laoxiangshow = true;
} }
}, },
/**
* 获取团队列表
*/
getTeamList() {
let that = this;
getTeamListApi().then((res) => {
console.log(res);
that.teamList = res.data.data;
console.log("that.teamList", that.teamList);
that.teamList.forEach((item, index) => {
if (item.id == that.loginValue.user.agencyId) {
item.checked = true;
}
});
});
},
changeTeam(_item) {
let that = this;
if (_item.id == that.loginValue.user.agencyId) {
return false;
}
console.log(_item);
changeTeamApi(_item.id).then((res1) => {
console.log("res1", res1);
if (res1.data.status == 2001) {
// localStorage.setItem("DAOTIAN_userinfo_agencyid", _item.id);
that.$message.error(res1.data.msg);
that.getTeamList();
} else {
localStorage.setItem("DAOTIAN_agencyid", _item.id);
checkTokenApi().then((res) => {
console.log(res.data);
localStorage.setItem("LOGIN_DATA", JSON.stringify(res.data.data));
let routeUrl = that.$router.resolve({
path: "/list",
});
window.open(routeUrl.href, "_blank");
setTimeout(() => {
window.close();
}, 10);
// return
// localStorage.setItem("DAOTIAN_token", res.data.token);
// that.reload();
// location.reload();
// router.push("/merchantManagement/homePage");
});
}
});
},
async logout() { async logout() {
// logoutApi().then((result) => { // logoutApi().then((result) => {
// console.log(result); // console.log(result);
@ -543,6 +653,7 @@ export default {
if (data.status === 200) { if (data.status === 200) {
localStorage.removeItem("LOGIN_DATA"); localStorage.removeItem("LOGIN_DATA");
localStorage.removeItem("DAOTIAN_token"); localStorage.removeItem("DAOTIAN_token");
localStorage.removeItem("LOGIN_DATA_token");
localStorage.removeItem("daotian_to_admin_token"); localStorage.removeItem("daotian_to_admin_token");
this.reload(); this.reload();
this.$router.push("/main"); this.$router.push("/main");
@ -595,33 +706,36 @@ export default {
goAdmin() { goAdmin() {
let obj = JSON.parse(localStorage.getItem("LOGIN_DATA")); let obj = JSON.parse(localStorage.getItem("LOGIN_DATA"));
console.log(JSON.stringify(obj.user)); let token = localStorage.getItem("LOGIN_DATA_token");
console.log(obj);
console.log(token);
if (window.location.hostname == "localhost") { if (window.location.hostname == "localhost") {
// URLtoken // URLtoken
window.open("http://localhost:3000/#/login?token=" + obj.token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj)); window.open("http://localhost:3000/#/login?token=" + token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj));
} else { } else {
// //
localStorage.setItem("daotian_to_admin", JSON.stringify(obj)); localStorage.setItem("daotian_to_admin", JSON.stringify(obj));
localStorage.setItem("daotian_to_admin_token", obj.token); localStorage.setItem("daotian_to_admin_token", token);
localStorage.setItem("daotian_to_admin_avatar", obj.imgSrc); localStorage.setItem("daotian_to_admin_avatar", obj.imgSrc);
localStorage.setItem("daotian_to_admin_username", obj.user.userName ? obj.user.userName : obj.user.nickName); localStorage.setItem("daotian_to_admin_username", obj.user.userName ? obj.user.userName : obj.user.nickName);
localStorage.setItem("daotian_to_admin_roleid", obj.user.agencyRoleId); localStorage.setItem("daotian_to_admin_roleid", obj.user.agencyRoleId);
localStorage.setItem("daotian_to_admin_agencyid", obj.user.agencyId); localStorage.setItem("daotian_to_admin_agencyid", obj.user.agencyId);
if (window.location.origin.indexOf("www") > -1) { if (window.location.origin.indexOf("www") > -1) {
window.open("http://www.ibocai.cn/#/login?token=" + obj.token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj)); window.open("http://www.ibocai.cn/#/login?token=" + token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj));
} else { } else {
window.open("http://ibocai.cn/#/login?token=" + obj.token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj)); window.open("http://ibocai.cn/#/login?token=" + token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj));
} }
} }
}, },
goJiaofu() { goJiaofu() {
let obj = JSON.parse(localStorage.getItem("LOGIN_DATA")); let obj = JSON.parse(localStorage.getItem("LOGIN_DATA"));
let token = JSON.parse(localStorage.getItem("LOGIN_DATA_token"));
if (window.location.hostname == "localhost") { if (window.location.hostname == "localhost") {
// URLtoken // URLtoken
window.open("http://localhost:3000/#/other/delivery?token=" + obj.token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj)); window.open("http://localhost:3000/#/other/delivery?token=" + token + "&username=" + (obj.user.userName ? obj.user.userName : obj.user.nickName) + "&avatar=" + obj.imgSrc + "&roleid=" + obj.user.agencyRoleId + "&agencyid=" + obj.user.agencyId + "&userInfo=" + JSON.stringify(obj));
} else { } else {
// //
localStorage.setItem("daotian_to_admin_token", obj.token); localStorage.setItem("daotian_to_admin_token", token);
localStorage.setItem("daotian_to_admin", JSON.stringify(obj)); localStorage.setItem("daotian_to_admin", JSON.stringify(obj));
localStorage.setItem("daotian_to_admin_avatar", obj.imgSrc); localStorage.setItem("daotian_to_admin_avatar", obj.imgSrc);
localStorage.setItem("daotian_to_admin_username", obj.user.userName ? obj.user.userName : obj.user.nickName); localStorage.setItem("daotian_to_admin_username", obj.user.userName ? obj.user.userName : obj.user.nickName);
@ -1106,4 +1220,49 @@ export default {
/deep/ .ant-dropdown { /deep/ .ant-dropdown {
top: 68px !important; top: 68px !important;
} }
.hover-blue {
cursor: pointer;
&:hover {
background-color: #f5f5f5;
}
}
.more-team {
.more-team-button {
height: 32px;
margin-right: 16px;
border-radius: 4px;
cursor: pointer;
border: 1px solid #ddd;
&:hover {
.hover-f40 {
color: #ff4400;
}
}
}
.more-team-drop {
padding: 6px;
background: #fff;
border-radius: 4px;
}
}
/deep/.setPosition {
padding: 4px;
left: -218px !important;
border-radius: 4px;
background-color: #fff;
box-shadow: 0px 2px 4px 0px rgba(229, 229, 229, 0.5), 0px 4px 12px 0px rgba(0, 0, 0, 0.15);
}
.logo {
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
color: #fff;
font-size: 10px;
background: #ff6a00;
border-radius: 2px;
margin-right: 8px;
}
</style> </style>

Loading…
Cancel
Save