Commit 937f9a74 authored by 吴冠's avatar 吴冠

CA取消

parent bc7f9688
...@@ -123,6 +123,14 @@ export function getListContent(params){ ...@@ -123,6 +123,14 @@ export function getListContent(params){
params params
}) })
} }
//文章列表首页
export function getListSSS(params){
return request({
url:"/news/list-content",
method:'get',
params:params
})
}
//分类列表 //分类列表
export function getCategoryList(){ export function getCategoryList(){
return request({ return request({
......
...@@ -26,13 +26,14 @@ ...@@ -26,13 +26,14 @@
<script> <script>
export default { export default {
created(){
},
mounted(){ mounted(){
let tokenStr = window.localStorage.getItem("token") let tokenStr = window.localStorage.getItem("token")
if(!tokenStr){ if(tokenStr){
console.log('1111')
}else{
this.showDefault = false this.showDefault = false
this.userName = window.localStorage.getItem("userInfo") this.userName = window.localStorage.getItem("companyName")
} }
}, },
data() { data() {
...@@ -53,6 +54,9 @@ ...@@ -53,6 +54,9 @@
let token=localStorage.getItem("token") let token=localStorage.getItem("token")
window.location.href=`http://192.168.200.201:8082/purchaser/Home?token=${token}` window.location.href=`http://192.168.200.201:8082/purchaser/Home?token=${token}`
// window.location.href=`http://localhost:8080/purchaser/Home?token=${token}` // window.location.href=`http://localhost:8080/purchaser/Home?token=${token}`
},
getUserName(){
return window.localStorage.getItem("companyName");
} }
}, },
......
...@@ -28,15 +28,15 @@ ...@@ -28,15 +28,15 @@
</div> </div>
</div> </div>
<div class="content flex-between"> <div class="content flex-between">
<div v-for="(item,index) in dynamicList" :key="index" class="dynamic-item"> <div v-for="(item,index) in dynamicList" :key="index" v-if="index<3" class="dynamic-item">
<div class="flex-between"> <div class="flex-between">
<div class="t3">{{item.title}}</div> <div class="t3">{{item.title}}</div>
<div class="more t1">更多 ></div> <div class="more t1 list-con" >更多 ></div>
</div> </div>
<ul> <ul>
<li v-for="(item,index) in item.list" :key="index" class="flex-between"> <li v-for="(item,index) in dynamicList.list" :key="index" v-if="index<5" class="flex-between list-con">
<nuxt-link tag="div" to="/about">{{item}}</nuxt-link> <nuxt-link tag="div" to="#">{{item.title}}</nuxt-link>
<div class="time">07-08</div> <div class="time">{{item.createTime.slice(5,10)}}</div>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -54,21 +54,46 @@ ...@@ -54,21 +54,46 @@
<script> <script>
import {getLoopPic} from '@/common/list.js' import {getLoopPic} from '@/common/list.js'
import {getSecond} from '@/common/list.js' import {getSecond,getCategoryList,getListSSS} from '@/common/list.js'
export default { export default {
/* computed:{
//取出特定的三项值
dynamicList(){
return this.dynamicList.slice(3,3)
}
}, */
created(){ created(){
this.getLoopPic() this.getLoopPic()
this.getSecond() this.getSecond()
//文章列表
this.getCategoryList()
this.getListSSS()
}, },
methods:{ methods:{
async getCategoryList(){
const {data} = await getCategoryList()
this.dynamicList = data
console.log(data,'-------------')
},
async getListSSS(){
let message = {}
message.cateId = this.id
const {data} = await getListSSS(message)
console.log(data,'++++++++++++++++++++++++')
this.dynamicList.list = data
},
//添加验证方法 //添加验证方法
async getSecond(){ async getSecond(){
let tokenStr = window.localStorage.getItem('token') let tokenStr = window.localStorage.getItem('token')
if(tokenStr){ if(tokenStr){
this.showDefault = false this.showDefault = false
const {data:res} = await getSecond() const {data,code} = await getSecond()
console.log(res) //code为401,失效 清空并返回至登录页
window.localStorage.setItem("companyName",res.companyName) if(code ==401){
window.localStorage.clear()
this.$router.push("/login/user")
}
window.localStorage.setItem("companyName",data.companyName)
this.userName = window.localStorage.getItem("companyName") this.userName = window.localStorage.getItem("companyName")
} }
/* const {data} = await getSecond() /* const {data} = await getSecond()
...@@ -95,6 +120,7 @@ import {getSecond} from '@/common/list.js' ...@@ -95,6 +120,7 @@ import {getSecond} from '@/common/list.js'
}, },
data() { data() {
return { return {
dyname:[],
showDefault:true, showDefault:true,
userName:'Hi~欢迎来到捷安彩', userName:'Hi~欢迎来到捷安彩',
userHeader: '', userHeader: '',
...@@ -220,7 +246,7 @@ import {getSecond} from '@/common/list.js' ...@@ -220,7 +246,7 @@ import {getSecond} from '@/common/list.js'
height: 2.78rem; height: 2.78rem;
border: 1px solid rgba(151, 152, 153, 1); border: 1px solid rgba(151, 152, 153, 1);
box-sizing: border-box; box-sizing: border-box;
padding: 0.2rem padding: 0.2rem;
} }
.dynamic-item>div { .dynamic-item>div {
...@@ -260,4 +286,7 @@ import {getSecond} from '@/common/list.js' ...@@ -260,4 +286,7 @@ import {getSecond} from '@/common/list.js'
.cooperation{ .cooperation{
margin-bottom:1.21rem; margin-bottom:1.21rem;
} }
.list-con{
cursor: pointer;
}
</style> </style>
...@@ -146,8 +146,7 @@ import { ...@@ -146,8 +146,7 @@ import {
.sidebar { .sidebar {
width: 2.4rem; width: 2.4rem;
border: 1px solid rgba(219, 219, 219, 1); border: 1px solid rgba(219, 219, 219, 1);
position: absolute; position: relative;
left:-193px;
} }
.el-menu { .el-menu {
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
<div class="user"> <div class="user">
<div class="user-login"> <div class="user-login">
<div class="login-type flex"> <div class="login-type flex">
<div @click="change" :class='[type==0?"active":""]'>{{message}}</div> <div class="pos">{{message}}</div>
<div @click="change" :class='[type==1?"active":""]' style="color:#000000">CA登录</div>
</div> </div>
<div class="el-form"> <div class="el-form">
<!-- 密码登录 --> <!-- 密码登录 -->
...@@ -20,17 +19,6 @@ ...@@ -20,17 +19,6 @@
<el-button type="primary" @click="submitForm()" style="width: 100%;">登录</el-button> <el-button type="primary" @click="submitForm()" style="width: 100%;">登录</el-button>
</div> </div>
</el-form> </el-form>
<!-- CA登录 -->
<el-form ref="ca" :model="ca" :rules="rules" class="ms-content" v-if="type==1">
<el-form-item prop="ca" style="width:3rem;height: 0.45rem;">
<el-select v-model="ca.type" placeholder="请选择CA">
<el-option label="USB" value="usb"></el-option>
</el-select>
</el-form-item>
<div class="login-btn">
<el-button type="primary" @click="submitForm()" style="width: 100%;">检测CA并登录</el-button>
</div>
</el-form>
<!-- 手机验证码验证 --> <!-- 手机验证码验证 -->
<el-form ref="phone" :model="phone" :rules="rules" class="ms-content" v-if="type==2"> <el-form ref="phone" :model="phone" :rules="rules" class="ms-content" v-if="type==2">
<el-form-item prop="phone" class="item"> <el-form-item prop="phone" class="item">
...@@ -40,17 +28,17 @@ ...@@ -40,17 +28,17 @@
<el-form-item prop="phonecode" class="item"> <el-form-item prop="phonecode" class="item">
<el-input v-model="phone.phonecode" placeholder="请输入短信验证码" style="width:1.8rem" maxlength="30"></el-input> <el-input v-model="phone.phonecode" placeholder="请输入短信验证码" style="width:1.8rem" maxlength="30"></el-input>
</el-form-item> </el-form-item>
<div class="phonecode">获取短信验证码</div> <div class="phonecode handle">获取短信验证码</div>
</div> </div>
<div class="login-btn"> <div class="login-btn">
<el-button type="primary" @click="submitForm()" style="width: 100%;">登录</el-button> <el-button type="primary" @click="submitForm()" style="width: 100%;">登录</el-button>
</div> </div>
</el-form> </el-form>
<div class="login-font flex-between"> <div class="login-font flex-between">
<div @click="forget">忘记密码</div> <div @click="forget" class="handle">忘记密码</div>
<div @click="examine">我要注册</div> <div @click="examine" class="handle">我要注册</div>
</div> </div>
<div class="code-login" @click="changephone">{{changemessage}}</div> <div class="code-login handle" @click="changephone">{{changemessage}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -58,9 +46,9 @@ ...@@ -58,9 +46,9 @@
<script> <script>
import {powerLogin} from '~/api/bid/login'; import {powerLogin} from '~/api/bid/login';
import {getSecond} from '@/common/list.js' import {getSecond} from '@/common/list.js';
export default { export default {
data: function() { data() {
return { return {
changemessage: "手机验证码登录", changemessage: "手机验证码登录",
message: "密码登录", message: "密码登录",
...@@ -70,9 +58,6 @@ ...@@ -70,9 +58,6 @@
account: "", account: "",
password: "" password: ""
}, },
ca: {
type: ""
},
phone: { phone: {
phone: "", phone: "",
phonecode: "" phonecode: ""
...@@ -169,6 +154,13 @@ ...@@ -169,6 +154,13 @@
</script> </script>
<style scoped> <style scoped>
.handle{
cursor: pointer;
}
.pos{
position: absolute;
left:25%;
}
.getphonecode { .getphonecode {
position: relative; position: relative;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment